X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=pdf%2Fxpdf%2FTTFont.h;h=96208e21b256a398e1ea1ce5d726a84bfd22e5ae;hb=884f739665dc56e66f51e104350f2affd33f2dd8;hp=36196d29ce2cea5a3c439192497491eeb16ee966;hpb=7aac8dc8533347e21311b15186e0af82f1b22fd6;p=evince.git diff --git a/pdf/xpdf/TTFont.h b/pdf/xpdf/TTFont.h index 36196d29..96208e21 100644 --- a/pdf/xpdf/TTFont.h +++ b/pdf/xpdf/TTFont.h @@ -4,14 +4,18 @@ // // An X wrapper for the FreeType TrueType font rasterizer. // +// Copyright 2001-2003 Glyph & Cog, LLC +// //======================================================================== #ifndef TTFONT_H #define TTFONT_H -#if HAVE_FREETYPE_FREETYPE_H | HAVE_FREETYPE_H +#include + +#if !FREETYPE2 && (HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H) -#ifdef __GNUC__ +#ifdef USE_GCC_PRAGMAS #pragma interface #endif @@ -22,6 +26,7 @@ #include #include #endif +#include "gtypes.h" #include "SFont.h" //------------------------------------------------------------------------ @@ -29,8 +34,8 @@ class TTFontEngine: public SFontEngine { public: - TTFontEngine(Display *display, Visual *visual, int depth, - Colormap colormap, GBool aa); + TTFontEngine(Display *displayA, Visual *visualA, int depthA, + Colormap colormapA, GBool aaA); GBool isOk() { return ok; } virtual ~TTFontEngine(); @@ -47,10 +52,25 @@ private: //------------------------------------------------------------------------ +enum TTFontIndexMode { + ttFontModeUnicode, + ttFontModeCharCode, + ttFontModeCharCodeOffset, + ttFontModeCodeMap, + ttFontModeCIDToGIDMap +}; + class TTFontFile: public SFontFile { public: - TTFontFile(TTFontEngine *engine, char *fontFileName); + // 8-bit font, TrueType or Type 1/1C + TTFontFile(TTFontEngine *engineA, char *fontFileName, + char **fontEnc, GBool pdfFontHasEncoding); + + // CID font, TrueType + TTFontFile(TTFontEngine *engineA, char *fontFileName, + Gushort *cidToGIDA, int cidToGIDLenA); + GBool isOk() { return ok; } virtual ~TTFontFile(); @@ -59,7 +79,11 @@ private: TTFontEngine *engine; TT_Face face; TT_CharMap charMap; + TTFontIndexMode mode; int charMapOffset; + Guchar *codeMap; + Gushort *cidToGID; + int cidToGIDLen; GBool ok; friend class TTFont; @@ -75,15 +99,16 @@ struct TTFontCacheTag { class TTFont: public SFont { public: - TTFont(TTFontFile *fontFile, double *m); + TTFont(TTFontFile *fontFileA, double *m); GBool isOk() { return ok; } virtual ~TTFont(); virtual GBool drawChar(Drawable d, int w, int h, GC gc, - int x, int y, int r, int g, int b, Gushort c); + int x, int y, int r, int g, int b, + CharCode c, Unicode u); private: - GBool getGlyphPixmap(Gushort c); + GBool getGlyphPixmap(CharCode c, Unicode u); TTFontFile *fontFile; TT_Instance instance; @@ -99,6 +124,6 @@ private: GBool ok; }; -#endif // HAVE_FREETYPE_FREETYPE_H | HAVE_FREETYPE_H +#endif // !FREETYPE2 && (HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H) #endif