25 struct FT_LibraryRec_;
27 struct FT_CharMapRec_;
31 typedef struct FT_LibraryRec_* FT_Library;
32 typedef struct FT_FaceRec_* FT_Face;
33 typedef struct FT_CharMapRec_* FT_CharMap;
34 typedef struct FT_GlyphRec_* FT_Glyph;
35 typedef struct FT_Matrix_ FT_Matrix;
36 typedef struct FT_Bitmap_ FT_Bitmap;
37 typedef signed long FT_Pos;
39 struct FT_Vector_ { FT_Pos x, y; };
40 struct FT_BBox_ { FT_Pos xMin, yMin, xMax, yMax; };
42 typedef struct FT_Vector_ FT_Vector;
43 typedef struct FT_BBox_ FT_BBox;
50 class TMathTextRenderer;
55 friend class TGX11TTF;
57 friend class TMathTextRenderer;
73 enum { kTTMaxFonts = 32, kMaxGlyphs = 1024 };
75 static Int_t fgAscent;
76 static FT_BBox fgCBox;
77 static FT_CharMap fgCharMap[kTTMaxFonts];
78 static Int_t fgCurFontIdx;
79 static Int_t fgSymbItaFontIdx;
80 static Int_t fgFontCount;
81 static char *fgFontName[kTTMaxFonts];
82 static FT_Face fgFace[kTTMaxFonts];
83 static TTF::TTGlyph fgGlyphs[kMaxGlyphs];
84 static Bool_t fgHinting;
86 static Bool_t fgKerning;
87 static FT_Library fgLibrary;
88 static Int_t fgNumGlyphs;
89 static FT_Matrix *fgRotMatrix;
90 static Bool_t fgSmoothing;
91 static Int_t fgTBlankW;
95 static Short_t CharToUnicode(UInt_t code);
96 static void LayoutGlyphs();
97 static void PrepareString(
const char *
string);
98 static void PrepareString(
const wchar_t *
string);
99 static void SetRotationMatrix(Float_t angle);
106 static void Cleanup();
107 static Int_t GetAscent();
108 static const FT_BBox &GetBox();
109 static TTGlyph *GetGlyphs();
110 static Bool_t GetHinting();
111 static Bool_t GetKerning();
112 static Int_t GetNumGlyphs();
113 static FT_Matrix *GetRotMatrix();
114 static Bool_t GetSmoothing();
115 static Int_t GetWidth();
116 static void SetHinting(Bool_t state);
117 static void SetKerning(Bool_t state);
118 static void SetSmoothing(Bool_t state);
119 static void GetTextExtent(UInt_t &w, UInt_t &h,
char *text);
120 static void GetTextExtent(UInt_t &w, UInt_t &h,
wchar_t *text);
121 static void GetTextAdvance(UInt_t &a,
char *text);
122 static void SetTextFont(Font_t fontnumber);
123 static Int_t SetTextFont(
const char *fontname, Int_t italic=0);
124 static void SetTextSize(Float_t textsize);
125 static Bool_t IsInitialized();
126 static void Version(Int_t &major, Int_t &minor, Int_t &patch);