1 #ifndef _Draw_FontInt_h_ 2 #define _Draw_FontInt_h_ 3 4 // Implementation header 5 6 struct FaceInfo : Moveable<FaceInfo> { 7 String name; 8 dword info; 9 }; 10 11 struct CommonFontInfo { 12 int ascent; 13 int descent; 14 int external; 15 int internal; 16 int overhang; 17 int avewidth; 18 int maxwidth; 19 int firstchar; 20 int charcount; 21 int default_char; 22 int spacebefore; 23 int spaceafter; 24 bool fixedpitch; 25 bool scaleable; 26 bool ttf; 27 int aux; 28 29 char path[256]; // optional 30 }; 31 32 class Font; 33 34 struct GlyphInfo { 35 int16 width; 36 int16 lspc; 37 int16 rspc; 38 word glyphi; // optional, not available in Win32 39 IsNormalGlyphInfo40 bool IsNormal() const { return (word)width != 0x8000; } IsComposedGlyphInfo41 bool IsComposed() const { return !IsNormal() && (lspc == -1 || lspc == -11); } IsComposedLMGlyphInfo42 bool IsComposedLM() const { return !IsNormal() && lspc == -11; } IsReplacedGlyphInfo43 bool IsReplaced() const { return !IsNormal() && lspc >= 0; } IsMissingGlyphInfo44 bool IsMissing() const { return !IsNormal() && lspc == -2; } 45 }; 46 47 void Std(Font& font); 48 GlyphInfo GetGlyphInfo(Font font, int chr); 49 const CommonFontInfo& GetFontInfo(Font font); 50 bool IsNormal(Font font, int chr); 51 void GlyphMetrics(GlyphInfo& f, Font font, int chr); 52 53 void InvalidateFontList(); 54 55 // Platform specific font interface 56 57 CommonFontInfo GetFontInfoSys(Font font); 58 GlyphInfo GetGlyphInfoSys(Font font, int chr); 59 Vector<FaceInfo> GetAllFacesSys(); 60 String GetFontDataSys(Font font); 61 62 void RenderCharacterSys(FontGlyphConsumer& sw, double x, double y, int ch, Font fnt); 63 64 #endif 65