1 //========================================================================
5 //========================================================================
7 #ifndef SPLASHFONTENGINE_H
8 #define SPLASHFONTENGINE_H
12 #ifdef USE_GCC_PRAGMAS
18 class SplashT1FontEngine;
19 class SplashFTFontEngine;
20 class SplashDTFontEngine;
22 class SplashFontFileID;
25 //------------------------------------------------------------------------
27 #define splashFontCacheSize 16
29 //------------------------------------------------------------------------
31 //------------------------------------------------------------------------
33 class SplashFontEngine {
36 // Create a font engine.
41 #if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
48 // Get a font file from the cache. Returns NULL if there is no
49 // matching entry in the cache.
50 SplashFontFile *getFontFile(SplashFontFileID *id);
52 // Load fonts - these create new SplashFontFile objects.
53 SplashFontFile *loadType1Font(SplashFontFileID *idA, char *fileName,
54 GBool deleteFile, char **enc);
55 SplashFontFile *loadType1CFont(SplashFontFileID *idA, char *fileName,
56 GBool deleteFile, char **enc);
57 SplashFontFile *loadCIDFont(SplashFontFileID *idA, char *fileName,
59 SplashFontFile *loadTrueTypeFont(SplashFontFileID *idA, char *fileName,
61 Gushort *codeToGID, int codeToGIDLen);
63 // Get a font - this does a cache lookup first, and if not found,
64 // creates a new SplashFont object and adds it to the cache. The
68 // specifies the font transform in PostScript style:
69 // [x' y'] = [x y] * mat
70 // Note that the Splash y axis points downward.
71 SplashFont *getFont(SplashFontFile *fontFile, SplashCoord *mat);
75 SplashFont *fontCache[splashFontCacheSize];
78 SplashT1FontEngine *t1Engine;
80 #if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
81 SplashFTFontEngine *ftEngine;