summaryrefslogtreecommitdiff
path: root/src/lib/evas
diff options
context:
space:
mode:
authorAbdullehGhujeh <abdullahhasan10@gmail.com>2020-09-01 19:33:51 +0900
committerWooHyun Jung <wh0705.jung@samsung.com>2020-09-01 19:33:52 +0900
commit1ab71284db89dcc37da12dd56796e892bc50ae0a (patch)
tree98a2b1dec47fb513166d27a01ec987ee441d3dd3 /src/lib/evas
parentba3b082d06b4ddea834e08d1c79d291ac6c3df0e (diff)
evas_textblock: rainbow flag emoji treated as two clusters(update unibreak to version 4.2)
Summary: if we have rainbow flag emoji (&#x1f3f3;&#xfe0f;&#x200d;&#x1f308;) we can use mouse/keyboard to move cursor inside it because we break it into two clusters, we break on 1F308, This is wrong as we should treat emoji as a single cluster (based on rules mentioned in Unicode segmentation standard “Do not break within emoji modifier sequences or emoji ZWJ sequences” (https://unicode.org/reports/tr29/#GB11 )). this issue happens because we don’t give 1F308 its correct grapheme break property value, I think this is a bug in the unibreak library as this Unicode 1F308 should have word break class value equals to Glue_After_ZWJ (based on https://www.unicode.org/reports/tr29/tr29-31.html#Glue_After_Zwj_WB and http://unicode.org/Public/emoji/5.0/emoji-zwj-sequences.txt) which will not make it break and we will get a single cluster. I noticed that the current unibreak lib used in EFL seems to implement Unicode 9 (latest is Unicode 13) which uses obsolete and unused grapheme break property, such as E_Modifier & Glue_After_ZWJ, so if a new emoji introduced (rainbow flag was introduced after Unicode 9) and based on Unicode 9 it should use property E_Modifier or Glue_After_ZWJ we will have issue with it. So I have updated unibreak lib using latest released version of unibreak (4.2) which implement Unicode 12. I needed to remove **BREAK_AFTER(i)** to pass the tests in D1140 as spaces do not break on latest update (also related to T995). {F3868712} this should fix T8665 & T8688 Reviewers: ali.alzyod, woohyun, bowonryu, zmike, segfaultxavi, bu5hm4n Reviewed By: ali.alzyod Subscribers: segfaultxavi, cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8665 Differential Revision: https://phab.enlightenment.org/D11743
Diffstat (limited to 'src/lib/evas')
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c
index d50592cc5d..1a46ea614c 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -10297,7 +10297,7 @@ evas_textblock_cursor_word_start(Efl_Text_Cursor_Handle *cur)
10297 if ((cur->pos > 0) && (cur->pos == len)) 10297 if ((cur->pos > 0) && (cur->pos == len))
10298 cur->pos--; 10298 cur->pos--;
10299 10299
10300 for (i = cur->pos ; _is_white(text[i]) && BREAK_AFTER(i) ; i--) 10300 for (i = cur->pos ; _is_white(text[i]) ; i--)
10301 { 10301 {
10302 if (i == 0) 10302 if (i == 0)
10303 { 10303 {
@@ -10364,7 +10364,7 @@ evas_textblock_cursor_word_end(Efl_Text_Cursor_Handle *cur)
10364 set_wordbreaks_utf32((const utf32_t *) text, len, lang, breaks); 10364 set_wordbreaks_utf32((const utf32_t *) text, len, lang, breaks);
10365 } 10365 }
10366 10366
10367 for (i = cur->pos; text[i] && _is_white(text[i]) && (BREAK_AFTER(i)) ; i++); 10367 for (i = cur->pos; text[i] && _is_white(text[i]) ; i++);
10368 if (i == len) 10368 if (i == len)
10369 { 10369 {
10370 Evas_Object_Textblock_Node_Text *nnode; 10370 Evas_Object_Textblock_Node_Text *nnode;