- Timestamp:
- 05/20/13 22:22:36 (12 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv/gl/texture_font.hh
r24 r28 19 19 struct texture_glyph 20 20 { 21 21 uint16 charcode; 22 22 glm::ivec2 size; 23 24 25 26 23 glm::ivec2 offset; 24 glm::vec2 advance; 25 glm::vec2 tl; 26 glm::vec2 br; 27 27 std::unordered_map< uint16, float > kerning; 28 28 … … 33 33 class texture_font 34 34 { 35 public:36 texture_font( texture_atlas* atlas, const char * filename, float size );37 const texture_glyph* get_glyph( uint16 charcode ) const;38 bool load_glyphs( const std::string& codes );39 ~texture_font();40 private:41 void generate_kerning();42 private:43 std::unordered_map< uint16, texture_glyph > m_glyphs;44 texture_atlas* m_atlas;45 std::string m_filename;46 float m_size;47 48 49 50 51 bool m_hinting;52 bool m_filtering;53 uint8 m_lcd_weights[5];54 void* m_rlibrary;55 void* m_rface;35 public: 36 texture_font( texture_atlas* atlas, const char * filename, float size ); 37 const texture_glyph* get_glyph( uint16 charcode ) const; 38 bool load_glyphs( const std::string& codes ); 39 ~texture_font(); 40 private: 41 void generate_kerning(); 42 private: 43 std::unordered_map< uint16, texture_glyph > m_glyphs; 44 texture_atlas* m_atlas; 45 std::string m_filename; 46 float m_size; 47 float m_height; 48 float m_linegap; 49 float m_ascender; 50 float m_descender; 51 bool m_hinting; 52 bool m_filtering; 53 uint8 m_lcd_weights[5]; 54 void* m_rlibrary; 55 void* m_rface; 56 56 }; 57 57 } 58 58 59 59 #endif // NV_GL_TEXTURE_FONT_HH 60 -
trunk/src/gl/texture_atlas.cc
r27 r28 8 8 9 9 #include "nv/logging.hh" 10 #include <iostream> 10 11 11 12 using namespace nv; … … 25 26 int best_index = -1; 26 27 int best_width = INT_MAX; 28 std::cout << "The size is: " << m_nodes.size() << std::endl; 27 29 for( size_t i=0; i < m_nodes.size(); ++i ) 28 30 { -
trunk/src/gl/texture_font.cc
r25 r28 26 26 : m_atlas( atlas ), m_filename(filename), m_size( size ), 27 27 m_height(0), m_linegap(0), m_ascender(0), m_descender(0), 28 m_ rlibrary( nullptr ), m_rface( nullptr ), m_hinting( true ), m_filtering( true)28 m_hinting( true ), m_filtering( true ), m_rlibrary( nullptr ), m_rface( nullptr ) 29 29 { 30 30 size_t hres = 64;
Note: See TracChangeset
for help on using the changeset viewer.