SplashFTFont.h 2.27 KB
Newer Older
Kristian Høgsberg's avatar
Kristian Høgsberg committed
1 2 3 4 5 6
//========================================================================
//
// SplashFTFont.h
//
//========================================================================

7 8 9 10
//========================================================================
//
// Modified under the Poppler project - http://poppler.freedesktop.org
//
11 12 13
// All changes made under the Poppler project to this file are licensed
// under GPL version 2 or later
//
14
// Copyright (C) 2007-2009, 2011, 2018 Albert Astals Cid <aacid@kde.org>
15
// Copyright (C) 2009 Petr Gajdos <pgajdos@novell.com>
16
// Copyright (C) 2011 Andreas Hartmetz <ahartmetz@gmail.com>
17
// Copyright (C) 2017 Adrian Johnson <ajohnson@redneon.com>
Albert Astals Cid's avatar
Albert Astals Cid committed
18
// Copyright (C) 2018 Oliver Sander <oliver.sander@tu-dresden.de>
19 20 21 22 23 24
//
// To see a description of the changes please see the Changelog file that
// came with your tarball or type make ChangeLog if you are building from git
//
//========================================================================

Kristian Høgsberg's avatar
Kristian Høgsberg committed
25 26 27
#ifndef SPLASHFTFONT_H
#define SPLASHFTFONT_H

28
#include "poppler-config.h"
29

Kristian Høgsberg's avatar
Kristian Høgsberg committed
30 31 32 33 34 35 36 37 38 39 40 41 42
#include <ft2build.h>
#include FT_FREETYPE_H
#include "SplashFont.h"

class SplashFTFontFile;

//------------------------------------------------------------------------
// SplashFTFont
//------------------------------------------------------------------------

class SplashFTFont: public SplashFont {
public:

43
  SplashFTFont(SplashFTFontFile *fontFileA, SplashCoord *matA,
44
	       const SplashCoord *textMatA);
Kristian Høgsberg's avatar
Kristian Høgsberg committed
45 46 47 48

  virtual ~SplashFTFont();

  // Munge xFrac and yFrac before calling SplashFont::getGlyph.
49
  bool getGlyph(int c, int xFrac, int yFrac,
Albert Astals Cid's avatar
Albert Astals Cid committed
50
		 SplashGlyphBitmap *bitmap, int x0, int y0, SplashClip *clip, SplashClipResult *clipRes) override;
Kristian Høgsberg's avatar
Kristian Høgsberg committed
51 52 53

  // Rasterize a glyph.  The <xFrac> and <yFrac> values are the same
  // as described for getGlyph.
54
  bool makeGlyph(int c, int xFrac, int yFrac,
Albert Astals Cid's avatar
Albert Astals Cid committed
55
		  SplashGlyphBitmap *bitmap, int x0, int y0, SplashClip *clip, SplashClipResult *clipRes) override;
Kristian Høgsberg's avatar
Kristian Høgsberg committed
56 57

  // Return the path for a glyph.
Albert Astals Cid's avatar
Albert Astals Cid committed
58
  SplashPath *getGlyphPath(int c) override;
Kristian Høgsberg's avatar
Kristian Høgsberg committed
59

60
  // Return the advance of a glyph. (in 0..1 range)
Albert Astals Cid's avatar
Albert Astals Cid committed
61
  double getGlyphAdvance(int c) override;
62

Kristian Høgsberg's avatar
Kristian Høgsberg committed
63 64 65 66
private:

  FT_Size sizeObj;
  FT_Matrix matrix;
67 68
  FT_Matrix textMatrix;
  SplashCoord textScale;
69
  int size;
70 71 72
  bool enableFreeTypeHinting;
  bool enableSlightHinting;
  bool isOk;
Kristian Høgsberg's avatar
Kristian Høgsberg committed
73 74 75
};

#endif