From eb7e89c885089d9f65d9f6e40e056f4a20a853c6 Mon Sep 17 00:00:00 2001 From: tasn Date: Sun, 30 Jan 2011 10:39:35 +0000 Subject: [PATCH] Evas font: fixed calling of bidi_end_of_run_get and exposed a new function to get the script of a single char. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@56483 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/engines/common/language/evas_language_utils.c | 13 ++++++------- src/lib/engines/common/language/evas_language_utils.h | 3 +++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/lib/engines/common/language/evas_language_utils.c b/src/lib/engines/common/language/evas_language_utils.c index 3af42b4..59d9fbc 100644 --- a/src/lib/engines/common/language/evas_language_utils.c +++ b/src/lib/engines/common/language/evas_language_utils.c @@ -36,8 +36,8 @@ evas_common_language_unicode_funcs_get(void) return NULL; } -static Evas_Script_Type -_get_script(Eina_Unicode unicode) +Evas_Script_Type +evas_common_language_char_script_get(Eina_Unicode unicode) { #ifdef USE_HARFBUZZ static hb_unicode_funcs_t *funcs; @@ -62,7 +62,7 @@ evas_common_language_script_end_of_run_get(const Eina_Unicode *str, for (i = 0 ; i < len ; i++, str++) { Evas_Script_Type tmp; - tmp = _get_script(*str); + tmp = evas_common_language_char_script_get(*str); /* Arabic is the first script in the array that's not * common/inherited. */ if ((first == EVAS_SCRIPT_UNKNOWN) && (tmp >= EVAS_SCRIPT_ARABIC)) @@ -78,8 +78,7 @@ evas_common_language_script_end_of_run_get(const Eina_Unicode *str, #ifdef BIDI_SUPPORT { int bidi_end; - bidi_end = evas_bidi_end_of_run_get(bidi_props, start, - start + len); + bidi_end = evas_bidi_end_of_run_get(bidi_props, start, len); if (bidi_end > 0) { i = (i < bidi_end) ? i : bidi_end; @@ -94,7 +93,7 @@ evas_common_language_script_end_of_run_get(const Eina_Unicode *str, else { #ifdef BIDI_SUPPORT - return evas_bidi_end_of_run_get(bidi_props, start, start + len); + return evas_bidi_end_of_run_get(bidi_props, start, len); #endif } return 0; @@ -105,7 +104,7 @@ evas_common_language_script_type_get(const Eina_Unicode *str) { Evas_Script_Type script = EVAS_SCRIPT_COMMON; /* Arabic is the first script in the array that's not a common/inherited */ - for ( ; *str && ((script = _get_script(*str)) < EVAS_SCRIPT_ARABIC) ; str++) + for ( ; *str && ((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 e4958c6..0993fd6 100644 --- a/src/lib/engines/common/language/evas_language_utils.h +++ b/src/lib/engines/common/language/evas_language_utils.h @@ -119,6 +119,9 @@ evas_common_language_script_end_of_run_get(const Eina_Unicode *str, const Evas_B Evas_Script_Type evas_common_language_script_type_get(const Eina_Unicode *str); +Evas_Script_Type +evas_common_language_char_script_get(Eina_Unicode unicode); + const char * evas_common_language_from_locale_get(void); -- 2.7.4