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 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 //
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 SPLASHFTFONTENGINE_H
26 #define SPLASHFTFONTENGINE_H
27 
28 #if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
29 
30 #ifdef USE_GCC_PRAGMAS
31 #pragma interface
32 #endif
33 
34 #include <ft2build.h>
35 #include FT_FREETYPE_H
36 #include "goo/gtypes.h"
37 
38 class SplashFontFile;
39 class SplashFontFileID;
40 class SplashFontSrc;
41 
42 //------------------------------------------------------------------------
43 // SplashFTFontEngine
44 //------------------------------------------------------------------------
45 
46 class SplashFTFontEngine {
47 public:
48 
49   static SplashFTFontEngine *init(GBool aaA, GBool enableFreeTypeHintingA, GBool enableSlightHinting);
50 
51   ~SplashFTFontEngine();
52 
53   // Load fonts.
54   SplashFontFile *loadType1Font(SplashFontFileID *idA, SplashFontSrc *src,  const char **enc);
55   SplashFontFile *loadType1CFont(SplashFontFileID *idA, SplashFontSrc *src,  const char **enc);
56   SplashFontFile *loadOpenTypeT1CFont(SplashFontFileID *idA, SplashFontSrc *src,  const char **enc);
57   SplashFontFile *loadCIDFont(SplashFontFileID *idA, SplashFontSrc *src);
58   SplashFontFile *loadOpenTypeCFFFont(SplashFontFileID *idA, SplashFontSrc *src,
59                                       int *codeToGID, int codeToGIDLen);
60   SplashFontFile *loadTrueTypeFont(SplashFontFileID *idA, SplashFontSrc *src,
61 				   int *codeToGID, int codeToGIDLen, int faceIndex = 0);
getAA()62   GBool getAA() { return aa; }
setAA(GBool aaA)63   void setAA(GBool aaA) { aa = aaA; }
64 
65 private:
66 
67   SplashFTFontEngine(GBool aaA, GBool enableFreeTypeHintingA, GBool enableSlightHintingA, FT_Library libA);
68 
69   GBool aa;
70   GBool enableFreeTypeHinting;
71   GBool enableSlightHinting;
72   FT_Library lib;
73   GBool useCIDs;
74 
75   friend class SplashFTFontFile;
76   friend class SplashFTFont;
77 };
78 
79 #endif // HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
80 
81 #endif
82