1 //========================================================================
5 // An X wrapper for the t1lib Type 1 font rasterizer.
7 // Copyright 2001-2002 Glyph & Cog, LLC
9 //========================================================================
18 #ifdef USE_GCC_PRAGMAS
28 //------------------------------------------------------------------------
30 class T1FontEngine: public SFontEngine {
33 T1FontEngine(Display *displayA, Visual *visualA, int depthA,
34 Colormap colormapA, GBool aaA, GBool aaHighA);
35 GBool isOk() { return ok; }
36 virtual ~T1FontEngine();
40 GBool aa; // use anti-aliasing?
41 GBool aaHigh; // use high-res anti-aliasing?
44 static int t1libInitCount;
46 friend class T1FontFile;
50 //------------------------------------------------------------------------
52 class T1FontFile: public SFontFile {
55 T1FontFile(T1FontEngine *engineA, char *fontFileName,
56 char **fontEnc, double *bboxA);
57 GBool isOk() { return ok; }
58 virtual ~T1FontFile();
63 int id; // t1lib font ID
72 //------------------------------------------------------------------------
74 struct T1FontCacheTag {
76 Gushort mru; // valid bit (0x8000) and MRU index
77 int x, y, w, h; // offset and size of glyph
80 class T1Font: public SFont {
83 T1Font(T1FontFile *fontFileA, double *m);
84 GBool isOk() { return ok; }
86 virtual GBool drawChar(Drawable d, int w, int h, GC gc,
87 int x, int y, int r, int g, int b,
88 CharCode c, Unicode u);
89 virtual GBool getCharPath(CharCode c, Unicode u, GfxState *state);
93 Guchar *getGlyphPixmap(CharCode c, int *x, int *y, int *w, int *h);
99 int glyphW, glyphH; // size of glyph pixmaps
100 int glyphSize; // size of glyph pixmaps, in bytes
101 Guchar *cache; // glyph pixmap cache
102 T1FontCacheTag *cacheTags; // cache tags, i.e., char codes
103 int cacheSets; // number of sets in cache
104 int cacheAssoc; // cache associativity (glyphs per set)
108 #endif // HAVE_T1LIB_H