1 //========================================================================
5 // An X wrapper for the t1lib Type 1 font rasterizer.
7 // Copyright 2001-2002 Glyph & Cog, LLC
9 //========================================================================
26 //------------------------------------------------------------------------
28 class T1FontEngine: public SFontEngine {
31 T1FontEngine(Display *displayA, Visual *visualA, int depthA,
32 Colormap colormapA, GBool aaA, GBool aaHighA);
33 GBool isOk() { return ok; }
34 virtual ~T1FontEngine();
38 GBool aa; // use anti-aliasing?
39 GBool aaHigh; // use high-res anti-aliasing?
42 friend class T1FontFile;
46 //------------------------------------------------------------------------
48 class T1FontFile: public SFontFile {
51 T1FontFile(T1FontEngine *engineA, char *fontFileName,
52 char **fontEnc, double *bboxA);
53 GBool isOk() { return ok; }
54 virtual ~T1FontFile();
59 int id; // t1lib font ID
68 //------------------------------------------------------------------------
70 struct T1FontCacheTag {
72 Gushort mru; // valid bit (0x8000) and MRU index
73 int x, y, w, h; // offset and size of glyph
76 class T1Font: public SFont {
79 T1Font(T1FontFile *fontFileA, double *m);
80 GBool isOk() { return ok; }
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);
89 Guchar *getGlyphPixmap(CharCode c, int *x, int *y, int *w, int *h);
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)
104 #endif // HAVE_T1LIB_H