Changeset 110 for trunk/nv/gfx/texture_font.hh
- Timestamp:
- 06/07/13 09:25:32 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv/gfx/texture_font.hh
r96 r110 18 18 struct texture_glyph 19 19 { 20 uint16 charcode; 21 glm::ivec2 size; 22 glm::ivec2 offset; 23 glm::vec2 advance; 24 glm::vec2 tl; 25 glm::vec2 br; 26 std::unordered_map< uint16, float > kerning; 20 uint16 charcode; ///< Character code value. 21 glm::ivec2 size; ///< Width and height of the glyph. 22 glm::ivec2 offset; ///< Offset of the glyph's position from the base line. 23 glm::vec2 advance; ///< Cursor advance distance. 24 glm::vec2 tl; ///< Top-left of the glyph's bounding box. 25 glm::vec2 br; ///< Bottom-right of the glyph's bounding box. 26 std::unordered_map< uint16, float > kerning; ///< Kerning space between other characters. 27 27 28 /** 29 *Creates a new texture_glyph. 30 */ 28 31 texture_glyph(); 29 float get_kerning( const uint16 charcode ); 32 33 /** 34 *Gets the kerning space between this character and the requested character. 35 * 36 *@param charcode The character to get the spacing for. 37 *@returns The amount of space for kerning. 38 */ 39 float get_kerning( const uint16 charcode ); 30 40 }; 31 41 … … 40 50 void generate_kerning(); 41 51 private: 42 std::unordered_map< uint16, texture_glyph > m_glyphs; 43 texture_atlas* m_atlas; 44 std::string m_filename; 45 float m_size; 46 float m_height; 47 float m_linegap; 48 float m_ascender; 49 float m_descender; 50 bool m_hinting; 51 bool m_filtering; 52 uint8 m_lcd_weights[5]; 53 void* m_rlibrary; 54 void* m_rface; 52 std::unordered_map< uint16, texture_glyph > m_glyphs; ///< Hash table of glyphs for this font. 53 texture_atlas* m_atlas; ///< Atlas Image object for this font. 54 std::string m_filename; ///< Name of the file. 55 float m_size; ///< Font size. 56 float m_height; ///< Height of the font. (x-height?) 57 float m_linegap; ///< Amount of space between lines. 58 float m_ascender; ///< Height of ascender lines (lines extending above the glyph's x-height). 59 float m_descender; ///< Height of descender lines (lines extending below the glyph's x-height). 60 bool m_hinting; ///< Whether or not glyph hints are used. 61 bool m_filtering; ///< Whether or not glyphs are color filtered for LCD displays. 62 uint8 m_lcd_weights[5]; ///< Color filtering weights. 63 void* m_rlibrary; ///< Pointer to the library. 64 void* m_rface; ///< Pointer to the font face. 55 65 }; 56 66 }
Note: See TracChangeset
for help on using the changeset viewer.