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 Albert Astals Cid <aacid@kde.org>
18
// To see a description of the changes please see the Changelog file that
19
// came with your tarball or type make ChangeLog if you are building from git
21
//========================================================================
23
#ifndef SPLASHFONTENGINE_H
24
#define SPLASHFONTENGINE_H
26
#ifdef USE_GCC_PRAGMAS
30
#include "goo/gtypes.h"
32
class SplashT1FontEngine;
33
class SplashFTFontEngine;
34
class SplashDTFontEngine;
35
class SplashDT4FontEngine;
37
class SplashFontFileID;
41
//------------------------------------------------------------------------
43
#define splashFontCacheSize 16
45
//------------------------------------------------------------------------
47
//------------------------------------------------------------------------
49
class SplashFontEngine {
52
// Create a font engine.
57
#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
59
GBool enableFreeTypeHinting,
65
// Get a font file from the cache. Returns NULL if there is no
66
// matching entry in the cache.
67
SplashFontFile *getFontFile(SplashFontFileID *id);
69
// Load fonts - these create new SplashFontFile objects.
70
SplashFontFile *loadType1Font(SplashFontFileID *idA, SplashFontSrc *src, char **enc);
71
SplashFontFile *loadType1CFont(SplashFontFileID *idA, SplashFontSrc *src, char **enc);
72
SplashFontFile *loadOpenTypeT1CFont(SplashFontFileID *idA, SplashFontSrc *src, char **enc);
73
SplashFontFile *loadCIDFont(SplashFontFileID *idA, SplashFontSrc *src);
74
SplashFontFile *loadOpenTypeCFFFont(SplashFontFileID *idA, SplashFontSrc *src);
75
SplashFontFile *loadTrueTypeFont(SplashFontFileID *idA, SplashFontSrc *src,
76
Gushort *codeToGID, int codeToGIDLen, int faceIndex = 0);
78
// Get a font - this does a cache lookup first, and if not found,
79
// creates a new SplashFont object and adds it to the cache. The
80
// matrix, mat = textMat * ctm:
83
// specifies the font transform in PostScript style:
84
// [x' y'] = [x y] * mat
85
// Note that the Splash y axis points downward.
86
SplashFont *getFont(SplashFontFile *fontFile,
87
SplashCoord *textMat, SplashCoord *ctm);
91
SplashFont *fontCache[splashFontCacheSize];
94
SplashT1FontEngine *t1Engine;
96
#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
97
SplashFTFontEngine *ftEngine;