-
- /// the number of the first character that is represented in the font
- uint32_t first_char;
- /// the number of the last character that is represented in the font
- uint32_t char_count;
+
+ struct Glyph {
+ /** How many pixels should the cursor advance after printing the
+ glyph */
+ float advance;
+
+ /** Offset that is used when drawing the glyph */
+ Vector offset;
+
+ /** index of containing surface */
+ int surface_idx;
+
+ /** Position of the glyph inside the surface */
+ Rect rect;
+ };
+
+ /** 65536 of glyphs */
+ std::vector<Glyph> glyphs;
+
+ void loadFontFile(const std::string &filename);
+ void loadFontSurface(const std::string &glyphimage,
+ const std::string &shadowimage,
+ const std::vector<std::string> &chars,
+ GlyphWidth glyph_width,
+ int char_width);