From: tasn Date: Thu, 21 Apr 2011 15:34:44 +0000 (+0000) Subject: Evas textblock: Added a temp fix for repch until implemented nicely. X-Git-Tag: accepted/2.0/20130306.225542~242^2~752 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=61b4eaca52e2cdca55284b0c792a362a661e4e1c;p=profile%2Fivi%2Fevas.git Evas textblock: Added a temp fix for repch until implemented nicely. 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 --- diff --git a/src/lib/canvas/evas_object_textblock.c b/src/lib/canvas/evas_object_textblock.c index 8692598..ce3ad5d 100644 --- a/src/lib/canvas/evas_object_textblock.c +++ b/src/lib/canvas/evas_object_textblock.c @@ -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; diff --git a/src/lib/engines/common/evas_font_draw.c b/src/lib/engines/common/evas_font_draw.c index 5d1efb6..5ea57ec 100644 --- a/src/lib/engines/common/evas_font_draw.c +++ b/src/lib/engines/common/evas_font_draw.c @@ -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) { diff --git a/src/lib/engines/common/evas_text_utils.h b/src/lib/engines/common/evas_text_utils.h index 21f8f38..687827a 100644 --- a/src/lib/engines/common/evas_text_utils.h +++ b/src/lib/engines/common/evas_text_utils.h @@ -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