1 //========================================================================
5 // An X wrapper for the t1lib Type 1 font rasterizer.
7 //========================================================================
24 //------------------------------------------------------------------------
26 class T1FontEngine: public SFontEngine {
29 T1FontEngine(Display *display, Visual *visual, int depth,
30 Colormap colormap, GBool aa, GBool aaHigh);
31 GBool isOk() { return ok; }
32 virtual ~T1FontEngine();
36 GBool aa; // use anti-aliasing?
37 GBool aaHigh; // use high-res anti-aliasing?
40 friend class T1FontFile;
44 //------------------------------------------------------------------------
46 class T1FontFile: public SFontFile {
49 T1FontFile(T1FontEngine *engine, char *fontFileName,
50 FontEncoding *fontEnc);
51 GBool isOk() { return ok; }
52 virtual ~T1FontFile();
57 int id; // t1lib font ID
65 //------------------------------------------------------------------------
67 struct T1FontCacheTag {
69 Gushort mru; // valid bit (0x8000) and MRU index
70 int x, y, w, h; // offset and size of glyph
73 class T1Font: public SFont {
76 T1Font(T1FontFile *fontFile, double *m);
77 GBool isOk() { return ok; }
79 virtual GBool drawChar(Drawable d, int w, int h, GC gc,
80 int x, int y, int r, int g, int b, Gushort c);
84 Guchar *getGlyphPixmap(Gushort c, int *x, int *y, int *w, int *h);
90 int glyphW, glyphH; // size of glyph pixmaps
91 int glyphSize; // size of glyph pixmaps, in bytes
92 Guchar *cache; // glyph pixmap cache
93 T1FontCacheTag *cacheTags; // cache tags, i.e., char codes
94 int cacheSets; // number of sets in cache
95 int cacheAssoc; // cache associativity (glyphs per set)
99 #endif // HAVE_T1LIB_H