Evas textblock: Added a temp fix for repch until implemented nicely.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 21 Apr 2011 15:34:44 +0000 (15:34 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 21 Apr 2011 15:34:44 +0000 (15:34 +0000)
This fix is just until we finally split to scripts and cache fi all
the time, i.e in all the possible paths (regular, fribidi and harfbuzz).

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@58806 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/canvas/evas_object_textblock.c
src/lib/engines/common/evas_font_draw.c
src/lib/engines/common/evas_text_utils.h

index 8692598..ce3ad5d 100644 (file)
@@ -2735,6 +2735,7 @@ _layout_text_append(Ctxt *c, Evas_Object_Textblock_Format *fmt, Evas_Object_Text
    const Eina_Unicode *tbase;
    Evas_Object_Textblock_Text_Item *ti;
    size_t cur_len = 0;
+   Eina_Unicode urepch = 0;
 
    /* prepare a working copy of the string, either filled by the repch or
     * filled with the true values */
@@ -2771,7 +2772,6 @@ _layout_text_append(Ctxt *c, Evas_Object_Textblock_Format *fmt, Evas_Object_Text
           {
              int i, ind;
              Eina_Unicode *ptr;
-             Eina_Unicode urepch;
 
              tbase = str = ptr = alloca((off + 1) * sizeof(Eina_Unicode));
              ind = 0;
@@ -2824,6 +2824,7 @@ skip:
                         c->par->bidi_props, ti->parent.text_pos, tmp_len);
                }
           }
+        ti->text_props.repch = urepch;
         str += tmp_len;
         cur_len -= tmp_len;
 
index 5d1efb6..5ea57ec 100644 (file)
@@ -551,8 +551,12 @@ evas_common_font_draw_internal(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font
 #else
         /* FIXME: Should be removed once we split according to script without
          * the use of harfbuzz */
-        index =
-           evas_common_font_glyph_search(fn, &fi, text[EVAS_FONT_WALK_POS]);
+        if (text_props->repch)
+           index =
+              evas_common_font_glyph_search(fn, &fi, text_props->repch);
+        else
+           index =
+              evas_common_font_glyph_search(fn, &fi, text[EVAS_FONT_WALK_POS]);
 
         if (index == 0)
           {
@@ -877,8 +881,12 @@ evas_font_word_prerender(RGBA_Draw_Context *dc, const Eina_Unicode *in_text, con
 #else
         /* FIXME: Should be removed once we split according to script without
          * the use of harfbuzz */
-        index =
-           evas_common_font_glyph_search(fn, &fi, text[EVAS_FONT_WALK_POS]);
+        if (text_props->repch)
+           index =
+              evas_common_font_glyph_search(fn, &fi, text_props->repch);
+        else
+           index =
+              evas_common_font_glyph_search(fn, &fi, text[EVAS_FONT_WALK_POS]);
 
         if (fi->src->current_size != fi->size)
           {
index 21f8f38..687827a 100644 (file)
@@ -23,6 +23,10 @@ struct _Evas_Text_Props
    Evas_BiDi_Props bidi;
    Evas_Script_Type script;
    Evas_Text_Props_Info *info;
+
+   /* FIXME: just a hack in the meanwhile, remove when I can finally cache
+    * fi and split to scripts without harfbuzz */
+   Eina_Unicode repch;
 };
 
 struct _Evas_Text_Props_Info