1 //========================================================================
5 //========================================================================
7 //========================================================================
9 // Modified under the Poppler project - http://poppler.freedesktop.org
11 // All changes made under the Poppler project to this file are licensed
12 // under GPL version 2 or later
14 // Copyright (C) 2006 Takashi Iwai <tiwai@suse.de>
15 // Copyright (C) 2009 Petr Gajdos <pgajdos@novell.com>
16 // Copyright (C) 2009, 2011 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>
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
23 //========================================================================
25 #ifndef SPLASHFONTENGINE_H
26 #define SPLASHFONTENGINE_H
28 #ifdef USE_GCC_PRAGMAS
32 #include "goo/gtypes.h"
33 #include "SplashTypes.h"
35 class SplashT1FontEngine
;
36 class SplashFTFontEngine
;
37 class SplashDTFontEngine
;
38 class SplashDT4FontEngine
;
40 class SplashFontFileID
;
44 //------------------------------------------------------------------------
46 #define splashFontCacheSize 16
48 //------------------------------------------------------------------------
50 //------------------------------------------------------------------------
52 class SplashFontEngine
{
55 // Create a font engine.
60 #if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
62 GBool enableFreeTypeHinting
,
63 GBool enableSlightHinting
,
69 // Get a font file from the cache. Returns NULL if there is no
70 // matching entry in the cache.
71 SplashFontFile
*getFontFile(SplashFontFileID
*id
);
73 // Load fonts - these create new SplashFontFile objects.
74 SplashFontFile
*loadType1Font(SplashFontFileID
*idA
, SplashFontSrc
*src
, const char **enc
);
75 SplashFontFile
*loadType1CFont(SplashFontFileID
*idA
, SplashFontSrc
*src
, const char **enc
);
76 SplashFontFile
*loadOpenTypeT1CFont(SplashFontFileID
*idA
, SplashFontSrc
*src
, const char **enc
);
77 SplashFontFile
*loadCIDFont(SplashFontFileID
*idA
, SplashFontSrc
*src
);
78 SplashFontFile
*loadOpenTypeCFFFont(SplashFontFileID
*idA
, SplashFontSrc
*src
,
79 int *codeToGID
, int codeToGIDLen
);
80 SplashFontFile
*loadTrueTypeFont(SplashFontFileID
*idA
, SplashFontSrc
*src
,
81 int *codeToGID
, int codeToGIDLen
, int faceIndex
= 0);
83 // Get a font - this does a cache lookup first, and if not found,
84 // creates a new SplashFont object and adds it to the cache. The
85 // matrix, mat = textMat * ctm:
88 // specifies the font transform in PostScript style:
89 // [x' y'] = [x y] * mat
90 // Note that the Splash y axis points downward.
91 SplashFont
*getFont(SplashFontFile
*fontFile
,
92 SplashCoord
*textMat
, SplashCoord
*ctm
);
93 #if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
100 SplashFont
*fontCache
[splashFontCacheSize
];
103 SplashT1FontEngine
*t1Engine
;
105 #if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
106 SplashFTFontEngine
*ftEngine
;