Changeset 398 for trunk/src/gfx/texture_font.cc
- Timestamp:
- 06/13/15 11:20:22 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gfx/texture_font.cc
r395 r398 94 94 bool texture_font::load_glyphs( string_ref codes ) 95 95 { 96 FT_Face face 97 size_t depth 98 glm::ivec2 asize= m_atlas->get_size();96 FT_Face face = (FT_Face)(m_rface); 97 size_t depth = m_atlas->get_depth(); 98 ivec2 asize = m_atlas->get_size(); 99 99 FT_Int32 flags = 0; 100 100 flags |= FT_LOAD_RENDER; … … 137 137 int reg_width = ft_bitmap_width / (depth > 3 ? 3 : (int)depth); 138 138 139 glm::ivec2 gsize( reg_width + 1, ft_bitmap_rows + 1 );139 ivec2 gsize( reg_width + 1, ft_bitmap_rows + 1 ); 140 140 region r = m_atlas->get_region( gsize ); 141 141 if ( r.pos.x < 0 ) … … 164 164 g->charcode = c; 165 165 g->size = gsize; 166 g->offset = glm::ivec2( ft_glyph_left, ft_glyph_top );167 g->tl = glm::vec2( r.pos.x/(float)asize.x, r.pos.y/(float)asize.y );168 g->br = glm::vec2( ( r.pos.x + gsize.x )/(float)asize.x, (r.pos.y + gsize.y )/(float)asize.y );166 g->offset = ivec2( ft_glyph_left, ft_glyph_top ); 167 g->tl = vec2( r.pos.x/(float)asize.x, r.pos.y/(float)asize.y ); 168 g->br = vec2( ( r.pos.x + gsize.x )/(float)asize.x, (r.pos.y + gsize.y )/(float)asize.y ); 169 169 170 170 // Discard hinting to get advance 171 171 FT_Load_Glyph( face, glyph_index, FT_LOAD_RENDER | FT_LOAD_NO_HINTING); 172 172 slot = face->glyph; 173 g->advance = glm::ivec2( slot->advance.x/64.0, slot->advance.y/64.0 );173 g->advance = ivec2( slot->advance.x/64.0, slot->advance.y/64.0 ); 174 174 } 175 175 generate_kerning();
Note: See TracChangeset
for help on using the changeset viewer.