texture_font_load_glyphs 'loading glyphes already loaded' problem resolved

parent 60580f5e
......@@ -406,7 +406,7 @@ size_t
texture_font_load_glyphs( texture_font_t * self,
const wchar_t * charcodes )
{
size_t i, x, y, width, height, depth, w, h;
size_t i, j, x, y, width, height, depth, w, h;
FT_Library library;
FT_Error error;
FT_Face face;
......@@ -427,12 +427,28 @@ texture_font_load_glyphs( texture_font_t * self,
height = self->atlas->height;
depth = self->atlas->depth;
char pass;
if (!texture_font_get_face(self, &library, &face))
return wcslen(charcodes);
/* Load each glyph */
for( i=0; i<wcslen(charcodes); ++i )
{
pass = 0;
/* Check if charcode has been already loaded */
for(j = 0; j < self->glyphs->size; ++j )
{
glyph = *(texture_glyph_t **) vector_get( self->glyphs, j );
// If charcode is -1, we don't care about outline type or thickness
if( (glyph->charcode == charcodes[i]))
{
pass = 1;
}
}
if(pass)
continue; // don't add the item
FT_Int32 flags = 0;
int ft_glyph_top = 0;
int ft_glyph_left = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment