1 #ifndef FT2_PRIVATE_H__
2 #define FT2_PRIVATE_H__
4 // anything should work, but I recommend multiples of 8
5 // since the texture size should be a power of 2
6 #define FONT_CHARS_PER_LINE 16
7 #define FONT_CHAR_LINES 16
8 #define FONT_CHARS_PER_MAP (FONT_CHARS_PER_LINE * FONT_CHAR_LINES)
10 // map.start value for incremental maps to hold a place
11 #define INCMAP_START 0x110000
13 typedef struct glyph_slot_s
16 // we keep the quad coords here only currently
17 // if you need other info, make Font_LoadMapForIndex fill it into this slot
18 float txmin; // texture coordinate in [0,1]
35 // the actual size used in the freetype code
36 // by convention, the requested size is the height of the font's bounding box.
43 glyph_slot_t glyphs[FONT_CHARS_PER_MAP];
44 Uchar glyphchars[FONT_CHARS_PER_MAP];
46 // saves us the trouble of calculating these over and over again
49 // note: float width_of[256] was moved to `struct dp_font_s` as width_of_ft2
51 // these may only present in a startmap
52 // contains the kerning information for the first 256 characters
53 // for the other characters, we will lookup the kerning information
54 ft2_kerning_t *kerning;
55 // for accessing incremental maps for bigblock glyphs
56 font_incmap_t *incmap;
61 // associated fontmap; startmap of incmaps
62 struct ft2_font_map_s *fontmap;
66 // two rounds of merge will take place, keep those data until then
67 unsigned char *data_tier1[FONT_CHARS_PER_LINE];
68 unsigned char *data_tier2[FONT_CHAR_LINES];
70 // count of merged maps
71 int tier1_merged, tier2_merged;
74 struct ft2_attachment_s
76 const unsigned char *data;
80 //qbool Font_LoadMapForIndex(ft2_font_t *font, Uchar _ch, ft2_font_map_t **outmap);
81 qbool Font_LoadMapForIndex(ft2_font_t *font, int map_index, Uchar _ch, ft2_font_map_t **outmap);
83 void font_start(void);
84 void font_shutdown(void);
85 void font_newmap(void);
87 #endif // FT2_PRIVATE_H__