forked from enlightenment/efl
Evas/cserve2: Reduce error logs on invalid glyph load
Change message level from ERR to WRN, when a glyph is not loadable because FT fails to load it or it contains 0 pixel. cserve2 used to complain about invalid glyph 3, on a few fonts
This commit is contained in:
parent
6a4c84a6a4
commit
038f4b4fcf
|
@ -329,6 +329,7 @@ _font_slave_glyph_render(Font_Info *fi, Slave_Msg_Font_Glyphs_Loaded *response,
|
||||||
FT_BitmapGlyph bglyph;
|
FT_BitmapGlyph bglyph;
|
||||||
char *data;
|
char *data;
|
||||||
int buffer_id = 0;
|
int buffer_id = 0;
|
||||||
|
Eina_Bool valid = EINA_FALSE;
|
||||||
void *buf;
|
void *buf;
|
||||||
|
|
||||||
FT_Get_Glyph(fsi->face->glyph, &glyph);
|
FT_Get_Glyph(fsi->face->glyph, &glyph);
|
||||||
|
@ -342,6 +343,7 @@ _font_slave_glyph_render(Font_Info *fi, Slave_Msg_Font_Glyphs_Loaded *response,
|
||||||
}
|
}
|
||||||
glyphsize = bglyph->bitmap.pitch * bglyph->bitmap.rows;
|
glyphsize = bglyph->bitmap.pitch * bglyph->bitmap.rows;
|
||||||
|
|
||||||
|
valid = EINA_TRUE;
|
||||||
buf = evas_common_font_glyph_compress(bglyph->bitmap.buffer,
|
buf = evas_common_font_glyph_compress(bglyph->bitmap.buffer,
|
||||||
bglyph->bitmap.num_grays,
|
bglyph->bitmap.num_grays,
|
||||||
bglyph->bitmap.pixel_mode,
|
bglyph->bitmap.pixel_mode,
|
||||||
|
@ -384,7 +386,10 @@ _font_slave_glyph_render(Font_Info *fi, Slave_Msg_Font_Glyphs_Loaded *response,
|
||||||
on_error:
|
on_error:
|
||||||
// Create invalid entry for this index. There will be an empty slot in
|
// Create invalid entry for this index. There will be an empty slot in
|
||||||
// the mempool (usually 8 bytes) because we need the Glyph_Data index entry.
|
// the mempool (usually 8 bytes) because we need the Glyph_Data index entry.
|
||||||
ERR("Could not load glyph %d. Creating empty invalid entry.", idx);
|
if (valid)
|
||||||
|
ERR("Failed to load glyph %d. Running out of memory?", idx);
|
||||||
|
else
|
||||||
|
WRN("Could not load glyph %d. Creating empty invalid entry.", idx);
|
||||||
memset(&response->glyphs[response->nglyphs], 0, sizeof(Slave_Msg_Glyph));
|
memset(&response->glyphs[response->nglyphs], 0, sizeof(Slave_Msg_Glyph));
|
||||||
if (buffer_id > 0)
|
if (buffer_id > 0)
|
||||||
cserve2_shared_mempool_buffer_del(response->mempool, buffer_id);
|
cserve2_shared_mempool_buffer_del(response->mempool, buffer_id);
|
||||||
|
|
Loading…
Reference in New Issue