/src/poppler/splash/SplashFTFontEngine.h
Line | Count | Source |
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, 2024 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 | | // Copyright (C) 2024, 2025 g10 Code GmbH, Author: Sune Stolborg Vuorela <sune@vuorela.dk> |
21 | | // |
22 | | // To see a description of the changes please see the Changelog file that |
23 | | // came with your tarball or type make ChangeLog if you are building from git |
24 | | // |
25 | | //======================================================================== |
26 | | |
27 | | #ifndef SPLASHFTFONTENGINE_H |
28 | | #define SPLASHFTFONTENGINE_H |
29 | | |
30 | | #include <ft2build.h> |
31 | | #include FT_FREETYPE_H |
32 | | #include <memory> |
33 | | #include <vector> |
34 | | |
35 | | class SplashFontFile; |
36 | | class SplashFontFileID; |
37 | | class SplashFontSrc; |
38 | | |
39 | | //------------------------------------------------------------------------ |
40 | | // SplashFTFontEngine |
41 | | //------------------------------------------------------------------------ |
42 | | |
43 | | class SplashFTFontEngine |
44 | | { |
45 | | public: |
46 | | static SplashFTFontEngine *init(bool aaA, bool enableFreeTypeHintingA, bool enableSlightHinting); |
47 | | |
48 | | ~SplashFTFontEngine(); |
49 | | |
50 | | SplashFTFontEngine(const SplashFTFontEngine &) = delete; |
51 | | SplashFTFontEngine &operator=(const SplashFTFontEngine &) = delete; |
52 | | |
53 | | // Load fonts. |
54 | | SplashFontFile *loadType1Font(std::unique_ptr<SplashFontFileID> idA, SplashFontSrc *src, const char **enc, int faceIndex); |
55 | | SplashFontFile *loadType1CFont(std::unique_ptr<SplashFontFileID> idA, SplashFontSrc *src, const char **enc, int faceIndex); |
56 | | SplashFontFile *loadOpenTypeT1CFont(std::unique_ptr<SplashFontFileID> idA, SplashFontSrc *src, const char **enc, int faceIndex); |
57 | | SplashFontFile *loadCIDFont(std::unique_ptr<SplashFontFileID> idA, SplashFontSrc *src, int faceIndex); |
58 | | SplashFontFile *loadOpenTypeCFFFont(std::unique_ptr<SplashFontFileID> idA, SplashFontSrc *src, std::vector<int> &&codeToGID, int faceIndex); |
59 | | SplashFontFile *loadTrueTypeFont(std::unique_ptr<SplashFontFileID> idA, SplashFontSrc *src, std::vector<int> &&codeToGID, int faceIndex); |
60 | 22.9k | bool getAA() { return aa; } |
61 | 18.3k | void setAA(bool aaA) { aa = aaA; } |
62 | | |
63 | | private: |
64 | | SplashFTFontEngine(bool aaA, bool enableFreeTypeHintingA, bool enableSlightHintingA, FT_Library libA); |
65 | | |
66 | | bool aa; |
67 | | bool enableFreeTypeHinting; |
68 | | bool enableSlightHinting; |
69 | | FT_Library lib; |
70 | | |
71 | | friend class SplashFTFontFile; |
72 | | friend class SplashFTFont; |
73 | | }; |
74 | | |
75 | | #endif |