From 902d94afb9497d03e9b6631e15b4aa009b8a8e10 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Thu, 21 Apr 2011 15:34:44 +0000 Subject: [PATCH] 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). SVN revision: 58806 --- .../evas/src/lib/canvas/evas_object_textblock.c | 3 ++- .../evas/src/lib/engines/common/evas_font_draw.c | 16 ++++++++++++---- .../src/lib/engines/common/evas_text_utils.h | 4 ++++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/legacy/evas/src/lib/canvas/evas_object_textblock.c b/legacy/evas/src/lib/canvas/evas_object_textblock.c index 86925984f0..ce3ad5dea6 100644 --- a/legacy/evas/src/lib/canvas/evas_object_textblock.c +++ b/legacy/evas/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/legacy/evas/src/lib/engines/common/evas_font_draw.c b/legacy/evas/src/lib/engines/common/evas_font_draw.c index 5d1efb6d4d..5ea57ec10c 100644 --- a/legacy/evas/src/lib/engines/common/evas_font_draw.c +++ b/legacy/evas/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/legacy/evas/src/lib/engines/common/evas_text_utils.h b/legacy/evas/src/lib/engines/common/evas_text_utils.h index 21f8f3864e..687827a70d 100644 --- a/legacy/evas/src/lib/engines/common/evas_text_utils.h +++ b/legacy/evas/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