From 2e71b5ab90a423f86ce80ca784f3b45c4fb9d6f4 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 3 May 2011 14:36:47 +0000 Subject: [PATCH] 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 --- legacy/evas/src/lib/engines/common/evas_font.h | 1 + legacy/evas/src/lib/engines/common/evas_font_draw.c | 6 +++--- legacy/evas/src/lib/engines/common/evas_text_utils.c | 8 +++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/legacy/evas/src/lib/engines/common/evas_font.h b/legacy/evas/src/lib/engines/common/evas_font.h index 7f18075904..06d105b057 100644 --- a/legacy/evas/src/lib/engines/common/evas_font.h +++ b/legacy/evas/src/lib/engines/common/evas_font.h @@ -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 */ diff --git a/legacy/evas/src/lib/engines/common/evas_font_draw.c b/legacy/evas/src/lib/engines/common/evas_font_draw.c index f6c07ef55c..fc49f2e353 100644 --- a/legacy/evas/src/lib/engines/common/evas_font_draw.c +++ b/legacy/evas/src/lib/engines/common/evas_font_draw.c @@ -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) diff --git a/legacy/evas/src/lib/engines/common/evas_text_utils.c b/legacy/evas/src/lib/engines/common/evas_text_utils.c index 7a90b973bb..f49eb9a1a4 100644 --- a/legacy/evas/src/lib/engines/common/evas_text_utils.c +++ b/legacy/evas/src/lib/engines/common/evas_text_utils.c @@ -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