1//========================================================================
2//
3// SplashFTFont.h
4//
5//========================================================================
6
7//========================================================================
8//
9// Modified under the Poppler project - http://poppler.freedesktop.org
10//
11// All changes made under the Poppler project to this file are licensed
12// under GPL version 2 or later
13//
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>
18// Copyright (C) 2018 Oliver Sander <oliver.sander@tu-dresden.de>
19//
20// To see a description of the changes please see the Changelog file that
21// came with your tarball or type make ChangeLog if you are building from git
22//
23//========================================================================
24
25#ifndef SPLASHFTFONT_H
26#define SPLASHFTFONT_H
27
28#include "poppler-config.h"
29
30#include <ft2build.h>
31#include FT_FREETYPE_H
32#include "SplashFont.h"
33
34class SplashFTFontFile;
35
36//------------------------------------------------------------------------
37// SplashFTFont
38//------------------------------------------------------------------------
39
40class SplashFTFont : public SplashFont
41{
42public:
43 SplashFTFont(SplashFTFontFile *fontFileA, SplashCoord *matA, const SplashCoord *textMatA);
44
45 ~SplashFTFont() override;
46
47 // Munge xFrac and yFrac before calling SplashFont::getGlyph.
48 bool getGlyph(int c, int xFrac, int yFrac, SplashGlyphBitmap *bitmap, int x0, int y0, SplashClip *clip, SplashClipResult *clipRes) override;
49
50 // Rasterize a glyph. The <xFrac> and <yFrac> values are the same
51 // as described for getGlyph.
52 bool makeGlyph(int c, int xFrac, int yFrac, SplashGlyphBitmap *bitmap, int x0, int y0, SplashClip *clip, SplashClipResult *clipRes) override;
53
54 // Return the path for a glyph.
55 SplashPath *getGlyphPath(int c) override;
56
57 // Return the advance of a glyph. (in 0..1 range)
58 double getGlyphAdvance(int c) override;
59
60private:
61 FT_Size sizeObj;
62 FT_Matrix matrix;
63 FT_Matrix textMatrix;
64 SplashCoord textScale;
65 int size;
66 bool enableFreeTypeHinting;
67 bool enableSlightHinting;
68 bool isOk;
69};
70
71#endif
72

source code of poppler/splash/SplashFTFont.h