From: tasn Date: Wed, 13 Apr 2011 08:36:46 +0000 (+0000) Subject: Evas font-engine: *text_props_script_set add parameter len. X-Git-Tag: submit/trunk/20120815.174732~1704 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cf997436329ec0803fb5d25ccad4abd7c353cf89;p=profile%2Fivi%2Fevas.git Evas font-engine: *text_props_script_set add parameter len. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@58616 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/canvas/evas_object_text.c b/src/lib/canvas/evas_object_text.c index 1a6a433..fe75108 100644 --- a/src/lib/canvas/evas_object_text.c +++ b/src/lib/canvas/evas_object_text.c @@ -475,7 +475,7 @@ _evas_object_text_item_new(Evas_Object *obj, Evas_Object_Text *o, eina_unicode_strncpy(it->text, str + pos, len); evas_common_text_props_bidi_set(&it->text_props, o->bidi_par_props, it->text_pos); - evas_common_text_props_script_set(&it->text_props, it->text); + evas_common_text_props_script_set(&it->text_props, it->text, len); if (o->engine_data) { ENFN->font_text_props_info_create(ENDT, diff --git a/src/lib/canvas/evas_object_textblock.c b/src/lib/canvas/evas_object_textblock.c index b29ec4f..5c5cd36 100644 --- a/src/lib/canvas/evas_object_textblock.c +++ b/src/lib/canvas/evas_object_textblock.c @@ -2779,7 +2779,7 @@ skip: evas_common_text_props_bidi_set(&ti->text_props, ti->parent.text_node->bidi_props, ti->parent.text_pos); evas_common_text_props_script_set (&ti->text_props, - ti->text); + ti->text, tmp_len); if (ti->parent.format->font.font) { c->ENFN->font_text_props_info_create(c->ENDT, @@ -3224,7 +3224,7 @@ _layout_ellipsis_item_new(Ctxt *c, const Evas_Object_Textblock_Item *cur_it) evas_common_text_props_bidi_set(&ellip_ti->text_props, ellip_ti->parent.text_node->bidi_props, ellip_ti->parent.text_pos); evas_common_text_props_script_set (&ellip_ti->text_props, - ellip_ti->text); + ellip_ti->text, len); c->ENFN->font_text_props_info_create(c->ENDT, ellip_ti->parent.format->font.font, ellip_ti->text, &ellip_ti->text_props, diff --git a/src/lib/engines/common/evas_text_utils.c b/src/lib/engines/common/evas_text_utils.c index 23e32f6..261024b 100644 --- a/src/lib/engines/common/evas_text_utils.c +++ b/src/lib/engines/common/evas_text_utils.c @@ -26,9 +26,9 @@ evas_common_text_props_bidi_set(Evas_Text_Props *props, void evas_common_text_props_script_set(Evas_Text_Props *props, - const Eina_Unicode *str) + const Eina_Unicode *str, size_t len) { - props->script = evas_common_language_script_type_get(str); + props->script = evas_common_language_script_type_get(str, len); } void diff --git a/src/lib/engines/common/evas_text_utils.h b/src/lib/engines/common/evas_text_utils.h index d29d3eb..1cddb95 100644 --- a/src/lib/engines/common/evas_text_utils.h +++ b/src/lib/engines/common/evas_text_utils.h @@ -51,7 +51,7 @@ evas_common_text_props_bidi_set(Evas_Text_Props *props, void evas_common_text_props_script_set(Evas_Text_Props *props, - const Eina_Unicode *str); + const Eina_Unicode *str, size_t len); EAPI Eina_Bool evas_common_text_props_content_create(void *_fn, const Eina_Unicode *text, diff --git a/src/lib/engines/common/language/evas_language_utils.c b/src/lib/engines/common/language/evas_language_utils.c index 2bdd53e..f4a636a 100644 --- a/src/lib/engines/common/language/evas_language_utils.c +++ b/src/lib/engines/common/language/evas_language_utils.c @@ -101,11 +101,12 @@ evas_common_language_script_end_of_run_get(const Eina_Unicode *str, } Evas_Script_Type -evas_common_language_script_type_get(const Eina_Unicode *str) +evas_common_language_script_type_get(const Eina_Unicode *str, size_t len) { Evas_Script_Type script = EVAS_SCRIPT_COMMON; + const Eina_Unicode *end = str + len; /* Arabic is the first script in the array that's not a common/inherited */ - for ( ; *str && ((script = evas_common_language_char_script_get(*str)) < EVAS_SCRIPT_ARABIC) ; str++) + for ( ; str < end && ((script = evas_common_language_char_script_get(*str)) < EVAS_SCRIPT_ARABIC) ; str++) ; return script; } diff --git a/src/lib/engines/common/language/evas_language_utils.h b/src/lib/engines/common/language/evas_language_utils.h index 0993fd6..10e5a76 100644 --- a/src/lib/engines/common/language/evas_language_utils.h +++ b/src/lib/engines/common/language/evas_language_utils.h @@ -117,7 +117,7 @@ int evas_common_language_script_end_of_run_get(const Eina_Unicode *str, const Evas_BiDi_Paragraph_Props *bidi_props, size_t start, int len); Evas_Script_Type -evas_common_language_script_type_get(const Eina_Unicode *str); +evas_common_language_script_type_get(const Eina_Unicode *str, size_t len); Evas_Script_Type evas_common_language_char_script_get(Eina_Unicode unicode);