Changeset 24 for trunk/src/gl/texture_font.cc
- Timestamp:
- 05/18/13 10:55:38 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gl/texture_font.cc
r23 r24 12 12 using namespace nv; 13 13 14 texture_g ylph::texture_gylph()14 texture_glyph::texture_glyph() 15 15 : charcode(0), size(0,0), offset(0,0), advance(0.f,0.f), tl(0.f,0.f), br(0.f,0.f) 16 16 { 17 17 } 18 18 19 float texture_g ylph::get_kerning( const uint16 charcode )19 float texture_glyph::get_kerning( const uint16 charcode ) 20 20 { 21 21 auto i = kerning.find( charcode ); … … 61 61 } 62 62 63 const texture_g ylph* texture_font::get_gylph( uint16 charcode ) const63 const texture_glyph* texture_font::get_glyph( uint16 charcode ) const 64 64 { 65 auto i = m_g ylphs.find( charcode );66 if ( i == m_g ylphs.end() )65 auto i = m_glyphs.find( charcode ); 66 if ( i == m_glyphs.end() ) 67 67 { 68 68 return nullptr; … … 101 101 FT_UInt glyph_index = FT_Get_Char_Index( face, c ); 102 102 FT_Error error = FT_Load_Glyph( face, glyph_index, flags ); 103 if ( error ) throw std::runtime_error( "FT_Error while loading g ylphs" );103 if ( error ) throw std::runtime_error( "FT_Error while loading glyphs" ); 104 104 105 105 FT_GlyphSlot slot = face->glyph; … … 114 114 if ( r.pos.x < 0 ) 115 115 { 116 throw std::runtime_error( "Atlas full while loading g ylphs" );116 throw std::runtime_error( "Atlas full while loading glyphs" ); 117 117 } 118 118 r.size.x -= 1; … … 120 120 m_atlas->set_region( r, ft_bitmap.buffer, ft_bitmap.pitch ); 121 121 122 m_g ylphs[ c ] = texture_gylph();123 texture_g ylph* g = &(m_gylphs.find( c )->second);122 m_glyphs[ c ] = texture_glyph(); 123 texture_glyph* g = &(m_glyphs.find( c )->second); 124 124 125 125 g->charcode = c;
Note: See TracChangeset
for help on using the changeset viewer.