Evas font-engine: Fix glyphs not being drawn.

Thanks to Brian Wang for the report.

This happened because we were querying for the index of the wrong fi,
this became especially visible after we started caching fi.

SVN revision: 59152
This commit is contained in:
Tom Hacohen 2011-05-03 14:36:47 +00:00
parent fdb32980b5
commit 2e71b5ab90
3 changed files with 7 additions and 8 deletions

View File

@ -20,6 +20,7 @@ EAPI int evas_common_font_get_line_advance (RGBA_Font *fn);
EAPI void evas_common_font_draw (RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font *fn, int x, int y, const Evas_Text_Props *intl_props);
EAPI int evas_common_font_glyph_search (RGBA_Font *fn, RGBA_Font_Int **fi_ret, int gl);
EAPI RGBA_Font_Glyph *evas_common_font_int_cache_glyph_get (RGBA_Font_Int *fi, FT_UInt index);
EAPI FT_UInt evas_common_get_char_index (RGBA_Font_Int* fi, int gl);
EAPI void evas_common_font_draw_init (void);
/* load */

View File

@ -290,8 +290,8 @@ struct _Font_Char_Index
int gl;
};
static FT_UInt
_evas_common_get_char_index(RGBA_Font_Int* fi, int gl)
EAPI FT_UInt
evas_common_get_char_index(RGBA_Font_Int* fi, int gl)
{
Font_Char_Index result;
//FT_UInt ret;
@ -379,7 +379,7 @@ evas_common_font_glyph_search(RGBA_Font *fn, RGBA_Font_Int **fi_ret, int gl)
}
if (fi->src->ft.face)
{
index = _evas_common_get_char_index(fi, gl);
index = evas_common_get_char_index(fi, gl);
if (index != 0)
{
if (!fi->ft.size)

View File

@ -233,9 +233,7 @@ evas_common_text_props_content_create(void *_fn, const Eina_Unicode *text,
/* If we got a malformed index, show the replacement char instead */
if (gl_itr->index == 0)
{
/* FIXME: search inside the same fi. */
gl_itr->index =
evas_common_font_glyph_search(fn, &fi, REPLACEMENT_CHAR);
gl_itr->index = evas_common_get_char_index(fi, REPLACEMENT_CHAR);
is_replacement = EINA_TRUE;
}
index = gl_itr->index;
@ -328,10 +326,10 @@ evas_common_text_props_content_create(void *_fn, const Eina_Unicode *text,
_gl = *text;
if (_gl == 0) break;
index = evas_common_font_glyph_search(fn, &fi, _gl);
index = evas_common_get_char_index(fi, _gl);
if (index == 0)
{
index = evas_common_font_glyph_search(fn, &fi, REPLACEMENT_CHAR);
index = evas_common_get_char_index(fi, REPLACEMENT_CHAR);
}
/* Should we really set the size per fi? This fixes a bug for Korean