tasn pushed a commit to branch efl-1.8. http://git.enlightenment.org/core/efl.git/commit/?id=69e47a5407600b034731cb0bfa46895acfea65b6
commit 69e47a5407600b034731cb0bfa46895acfea65b6 Author: Tom Hacohen <t...@stosb.com> Date: Wed Feb 19 12:01:08 2014 +0000 Evas text utils: Fixed walking compound clusters. In some scripts, like Devanagari, clusters can be split across more than just one glyph. This is now fixed. Thanks to YoungBok Shin for reporting. --- src/lib/evas/common/evas_text_utils.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/lib/evas/common/evas_text_utils.c b/src/lib/evas/common/evas_text_utils.c index fe17101..d7aa3ad 100644 --- a/src/lib/evas/common/evas_text_utils.c +++ b/src/lib/evas/common/evas_text_utils.c @@ -117,8 +117,16 @@ _evas_common_text_props_cluster_move(const Evas_Text_Props *props, int pos, if (!right && (prop_pos > 0)) { #ifdef OT_SUPPORT - return props->info->ot[props->start + prop_pos - 1].source_cluster - - props->text_offset; + int base_cluster = props->info->ot[props->start + prop_pos].source_cluster; + prop_pos--; + for ( ; prop_pos >= 0 ; prop_pos--) + { + int cur_cluster = props->info->ot[props->start + prop_pos].source_cluster; + if (cur_cluster != base_cluster) + { + return cur_cluster - props->text_offset; + } + } #else return props->start + prop_pos - 1 - props->text_offset; #endif @@ -126,8 +134,16 @@ _evas_common_text_props_cluster_move(const Evas_Text_Props *props, int pos, else if (right && (prop_pos < (int) (props->len - 1))) { #ifdef OT_SUPPORT - return props->info->ot[props->start + prop_pos + 1].source_cluster - - props->text_offset; + int base_cluster = props->info->ot[props->start + prop_pos].source_cluster; + prop_pos++; + for ( ; prop_pos < (int) props->len ; prop_pos++) + { + int cur_cluster = props->info->ot[props->start + prop_pos].source_cluster; + if (cur_cluster != base_cluster) + { + return cur_cluster - props->text_offset; + } + } #else return props->start + prop_pos + 1 - props->text_offset; #endif --