1//========================================================================
2//
3// SplashFTFontEngine.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) 2006 Takashi Iwai <tiwai@suse.de>
15// Copyright (C) 2009 Petr Gajdos <pgajdos@novell.com>
16// Copyright (C) 2009, 2018, 2022 Albert Astals Cid <aacid@kde.org>
17// Copyright (C) 2011 Andreas Hartmetz <ahartmetz@gmail.com>
18// Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de>
19// Copyright (C) 2017 Adrian Johnson <ajohnson@redneon.com>
20//
21// To see a description of the changes please see the Changelog file that
22// came with your tarball or type make ChangeLog if you are building from git
23//
24//========================================================================
25
26#ifndef SPLASHFTFONTENGINE_H
27#define SPLASHFTFONTENGINE_H
28
29#include <ft2build.h>
30#include FT_FREETYPE_H
31
32class SplashFontFile;
33class SplashFontFileID;
34class SplashFontSrc;
35
36//------------------------------------------------------------------------
37// SplashFTFontEngine
38//------------------------------------------------------------------------
39
40class SplashFTFontEngine
41{
42public:
43 static SplashFTFontEngine *init(bool aaA, bool enableFreeTypeHintingA, bool enableSlightHinting);
44
45 ~SplashFTFontEngine();
46
47 SplashFTFontEngine(const SplashFTFontEngine &) = delete;
48 SplashFTFontEngine &operator=(const SplashFTFontEngine &) = delete;
49
50 // Load fonts.
51 SplashFontFile *loadType1Font(SplashFontFileID *idA, SplashFontSrc *src, const char **enc);
52 SplashFontFile *loadType1CFont(SplashFontFileID *idA, SplashFontSrc *src, const char **enc);
53 SplashFontFile *loadOpenTypeT1CFont(SplashFontFileID *idA, SplashFontSrc *src, const char **enc);
54 SplashFontFile *loadCIDFont(SplashFontFileID *idA, SplashFontSrc *src);
55 SplashFontFile *loadOpenTypeCFFFont(SplashFontFileID *idA, SplashFontSrc *src, int *codeToGID, int codeToGIDLen);
56 SplashFontFile *loadTrueTypeFont(SplashFontFileID *idA, SplashFontSrc *src, int *codeToGID, int codeToGIDLen, int faceIndex = 0);
57 bool getAA() { return aa; }
58 void setAA(bool aaA) { aa = aaA; }
59
60private:
61 SplashFTFontEngine(bool aaA, bool enableFreeTypeHintingA, bool enableSlightHintingA, FT_Library libA);
62
63 bool aa;
64 bool enableFreeTypeHinting;
65 bool enableSlightHinting;
66 FT_Library lib;
67
68 friend class SplashFTFontFile;
69 friend class SplashFTFont;
70};
71
72#endif
73

source code of poppler/splash/SplashFTFontEngine.h