25class CharCodeToUnicode;
26struct GfxFontCIDWidths;
49struct GfxFontCIDWidthExcep {
55struct GfxFontCIDWidthExcepV {
62struct GfxFontCIDWidths {
66 GfxFontCIDWidthExcep *exceps;
68 GfxFontCIDWidthExcepV *
77#define fontFixedWidth (1 << 0)
78#define fontSerif (1 << 1)
79#define fontSymbolic (1 << 2)
80#define fontItalic (1 << 6)
81#define fontBold (1 << 18)
87 static GfxFont *makeFont(XRef *xref, const char *tagA, Ref idA, Dict *fontDict);
89 GfxFont( const char *tagA, Ref idA, GString *nameA);
93 GBool isOk() { return ok; }
96 GString *getTag() { return tag; }
99 Ref *getID() { return &id; }
102 GBool matches( char *tagA) { return !tag->cmp(tagA); }
105 GString *getName() { return name; }
108 GfxFontType getType() { return type; }
109 virtual GBool isCIDFont() { return gFalse; }
113 GBool getEmbeddedFontID(Ref *embID)
114 { *embID = embFontID; return embFontID.num >= 0; }
118 GString *getEmbeddedFontName() { return embFontName; }
122 GString *getExtFontFile() { return extFontFile; }
125 GBool isFixedWidth() { return flags & fontFixedWidth; }
126 GBool isSerif() { return flags & fontSerif; }
127 GBool isSymbolic() { return flags & fontSymbolic; }
128 GBool isItalic() { return flags & fontItalic; }
129 GBool isBold() { return flags & fontBold; }
132 double *getFontMatrix() { return fontMat; }
135 double *getFontBBox() { return fontBBox; }
138 double getAscent() { return ascent; }
139 double getDescent() { return descent; }
142 virtual int getWMode() { return 0; }
145 char *readExtFontFile( int *len);
146 char *readEmbFontFile(XRef *xref, int *len);
154 virtual int getNextChar( char *s, int len, CharCode *code,
155 Unicode *u, int uSize, int *uLen,
156 double *dx, double *dy, double *ox, double *oy) = 0;
160 void readFontDescriptor(XRef *xref, Dict *fontDict);
161 CharCodeToUnicode *readToUnicodeCMap(Dict *fontDict, int nBits);
162 void findExtFontFile();
169 GString *embFontName;
171 GString *extFontFile;
184class Gfx8BitFont: public GfxFont {
187 Gfx8BitFont(XRef *xref, const char *tagA, Ref idA, GString *nameA,
188 GfxFontType typeA, Dict *fontDict);
190 virtual ~Gfx8BitFont();
192 virtual int getNextChar( char *s, int len, CharCode *code,
193 Unicode *u, int uSize, int *uLen,
194 double *dx, double *dy, double *ox, double *oy);
197 char **getEncoding() { return enc; }
200 CharCodeToUnicode *getToUnicode();
203 char *getCharName( int code) { return enc[code]; }
206 GBool getHasEncoding() { return hasEncoding; }
209 double getWidth(Guchar c) { return widths[c]; }
212 Dict *getCharProcs();
215 Object *getCharProc( int code, Object *proc);
218 Dict *getResources();
225 CharCodeToUnicode *ctu;
236class GfxCIDFont: public GfxFont {
239 GfxCIDFont(XRef *xref, const char *tagA, Ref idA, GString *nameA,
242 virtual ~GfxCIDFont();
244 virtual GBool isCIDFont() { return gTrue; }
246 virtual int getNextChar( char *s, int len, CharCode *code,
247 Unicode *u, int uSize, int *uLen,
248 double *dx, double *dy, double *ox, double *oy);
251 virtual int getWMode();
254 CharCodeToUnicode *getToUnicode();
257 GString *getCollection();
261 Gushort *getCIDToGID() { return cidToGID; }
262 int getCIDToGIDLen() { return cidToGIDLen; }
267 CharCodeToUnicode *ctu;
268 GfxFontCIDWidths widths;
282 GfxFontDict(XRef *xref, Dict *fontDict);
288 GfxFont *lookup( char *tag);
291 int getNumFonts() { return numFonts; }
292 GfxFont *getFont( int i) { return fonts[i]; }
|