]> www.fi.muni.cz Git - evince.git/blob - pdf/xpdf/T1Font.h
disable font embedding hack introduced on 2002-12-09 to fix build with
[evince.git] / pdf / xpdf / T1Font.h
1 //========================================================================
2 //
3 // T1Font.h
4 //
5 // An X wrapper for the t1lib Type 1 font rasterizer.
6 //
7 // Copyright 2001-2002 Glyph & Cog, LLC
8 //
9 //========================================================================
10
11 #ifndef T1FONT_H
12 #define T1FONT_H
13
14 #if HAVE_T1LIB_H
15
16 #ifdef __GNUC__
17 #pragma interface
18 #endif
19
20 #include <X11/Xlib.h>
21 #include <t1lib.h>
22 #include "SFont.h"
23
24 class GfxState;
25
26 //------------------------------------------------------------------------
27
28 class T1FontEngine: public SFontEngine {
29 public:
30
31   T1FontEngine(Display *displayA, Visual *visualA, int depthA,
32                Colormap colormapA, GBool aaA, GBool aaHighA);
33   GBool isOk() { return ok; }
34   virtual ~T1FontEngine();
35
36 private:
37
38   GBool aa;                     // use anti-aliasing?
39   GBool aaHigh;                 // use high-res anti-aliasing?
40   GBool ok;
41
42   friend class T1FontFile;
43   friend class T1Font;
44 };
45
46 //------------------------------------------------------------------------
47
48 class T1FontFile: public SFontFile {
49 public:
50
51   T1FontFile(T1FontEngine *engineA, char *fontFileName,
52              char **fontEnc, double *bboxA);
53   GBool isOk() { return ok; }
54   virtual ~T1FontFile();
55
56 private:
57
58   T1FontEngine *engine;
59   int id;                       // t1lib font ID
60   char **enc;
61   char *encStr;
62   double bbox[4];
63   GBool ok;
64
65   friend class T1Font;
66 };
67
68 //------------------------------------------------------------------------
69
70 struct T1FontCacheTag {
71   Gushort code;
72   Gushort mru;                  // valid bit (0x8000) and MRU index
73   int x, y, w, h;               // offset and size of glyph
74 };
75
76 class T1Font: public SFont {
77 public:
78
79   T1Font(T1FontFile *fontFileA, double *m);
80   GBool isOk() { return ok; }
81   virtual ~T1Font();
82   virtual GBool drawChar(Drawable d, int w, int h, GC gc,
83                          int x, int y, int r, int g, int b,
84                          CharCode c, Unicode u);
85   virtual GBool getCharPath(CharCode c, Unicode u, GfxState *state);
86
87 private:
88
89   Guchar *getGlyphPixmap(CharCode c, int *x, int *y, int *w, int *h);
90
91   T1FontFile *fontFile;
92   int id;
93   float size;
94   XImage *image;
95   int glyphW, glyphH;           // size of glyph pixmaps
96   int glyphSize;                // size of glyph pixmaps, in bytes
97   Guchar *cache;                // glyph pixmap cache
98   T1FontCacheTag *cacheTags;    // cache tags, i.e., char codes
99   int cacheSets;                // number of sets in cache
100   int cacheAssoc;               // cache associativity (glyphs per set)
101   GBool ok;
102 };
103
104 #endif // HAVE_T1LIB_H
105
106 #endif