Evas font-engine: Fix glyphs not being drawn.
authorTom Hacohen <tom@stosb.com>
Tue, 3 May 2011 14:36:47 +0000 (14:36 +0000)
committerTom Hacohen <tom@stosb.com>
Tue, 3 May 2011 14:36:47 +0000 (14:36 +0000)
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
legacy/evas/src/lib/engines/common/evas_font_draw.c
legacy/evas/src/lib/engines/common/evas_text_utils.c

index 7f18075..06d105b 100644 (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 */
index f6c07ef..fc49f2e 100644 (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)
index 7a90b97..f49eb9a 100644 (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