source: trunk/poppler/mypoppler/splash/SplashFontEngine.h @ 44

Last change on this file since 44 was 2, checked in by Eugene Romanenko, 16 years ago

First import

File size: 2.2 KB
Line 
1//========================================================================
2//
3// SplashFontEngine.h
4//
5//========================================================================
6
7#ifndef SPLASHFONTENGINE_H
8#define SPLASHFONTENGINE_H
9
10#ifdef USE_GCC_PRAGMAS
11#pragma interface
12#endif
13
14#include "goo/gtypes.h"
15
16class SplashT1FontEngine;
17class SplashFTFontEngine;
18class SplashDTFontEngine;
19class SplashFontFile;
20class SplashFontFileID;
21class SplashFont;
22class SplashFontSrc;
23
24//------------------------------------------------------------------------
25
26#define splashFontCacheSize 16
27
28//------------------------------------------------------------------------
29// SplashFontEngine
30//------------------------------------------------------------------------
31
32class SplashFontEngine {
33public:
34
35  // Create a font engine.
36  SplashFontEngine(
37#if HAVE_T1LIB_H
38                   GBool enableT1lib,
39#endif
40#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
41                   GBool enableFreeType,
42#endif
43                   GBool aa);
44
45  ~SplashFontEngine();
46
47  // Get a font file from the cache.  Returns NULL if there is no
48  // matching entry in the cache.
49  SplashFontFile *getFontFile(SplashFontFileID *id);
50
51  // Load fonts - these create new SplashFontFile objects.
52  SplashFontFile *loadType1Font(SplashFontFileID *idA, SplashFontSrc *src, char **enc);
53  SplashFontFile *loadType1CFont(SplashFontFileID *idA, SplashFontSrc *src, char **enc);
54  SplashFontFile *loadCIDFont(SplashFontFileID *idA, SplashFontSrc *src);
55  SplashFontFile *loadTrueTypeFont(SplashFontFileID *idA, SplashFontSrc *src,
56                                   Gushort *codeToGID, int codeToGIDLen,
57                                   int faceIndex=0);
58
59  // Get a font - this does a cache lookup first, and if not found,
60  // creates a new SplashFont object and adds it to the cache.  The
61  // matrix:
62  //    [ mat[0] mat[1] ]
63  //    [ mat[2] mat[3] ]
64  // specifies the font transform in PostScript style:
65  //    [x' y'] = [x y] * mat
66  // Note that the Splash y axis points downward.
67  SplashFont *getFont(SplashFontFile *fontFile, SplashCoord *mat);
68
69private:
70
71  SplashFont *fontCache[splashFontCacheSize];
72
73#if HAVE_T1LIB_H
74  SplashT1FontEngine *t1Engine;
75#endif
76#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
77  SplashFTFontEngine *ftEngine;
78#endif
79};
80
81#endif
Note: See TracBrowser for help on using the repository browser.