summaryrefslogtreecommitdiff
path: root/src/lib/evas/common/evas_font_query.c
diff options
context:
space:
mode:
authorAli Alzyod <ali198724@gmail.com>2020-01-23 16:21:22 +0900
committerWooHyun Jung <wh0705.jung@samsung.com>2020-01-23 16:21:22 +0900
commit8143b81dd6b4e72a9018c9d900d69870dc898c6a (patch)
treebfe85155d4e0032b1a620accd807da12909d8b03 /src/lib/evas/common/evas_font_query.c
parent3d2f99af9eca265e0b166a2b9f2686e6ba3e9f83 (diff)
evas_object_textblock: treat variation sequence as single run
Summary: Variation sequence treated as a single run, if we found one, we keep looking adding to the same run, but if it is not, then we need to start a new one. Before: {F3826735} After: {F3826736} Test Plan: ``` #include <stdio.h> #include <Elementary.h> /* gcc -o example test.c `pkg-config --cflags --libs elementary` */ EAPI_MAIN int elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED) { Evas_Object *win, *en; elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); win = elm_win_util_standard_add("emoji-example", "emoji-example"); elm_win_autodel_set(win, EINA_TRUE); en = elm_entry_add(win); elm_entry_scrollable_set(en, EINA_TRUE); evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_object_text_set(en, "<font_size=25>&#x262a;&#x262a;&#xfe0f;&#x262a;가</font_size>"); evas_object_show(en); elm_object_content_set(win, en); evas_object_resize(win, 400, 200); evas_object_show(win); elm_run(); return 0; } ELM_MAIN() ``` Reviewers: woohyun, bowonryu Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8542 Differential Revision: https://phab.enlightenment.org/D11096
Diffstat (limited to '')
-rw-r--r--src/lib/evas/common/evas_font_query.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/evas/common/evas_font_query.c b/src/lib/evas/common/evas_font_query.c
index bab7376621..640fc65b4c 100644
--- a/src/lib/evas/common/evas_font_query.c
+++ b/src/lib/evas/common/evas_font_query.c
@@ -68,6 +68,7 @@ get_top_font:
68 68
69 /* Find the longest run of the same font starting from the start position 69 /* Find the longest run of the same font starting from the start position
70 * and update cur_fi accordingly. */ 70 * and update cur_fi accordingly. */
71 Eina_Unicode variation_sequence = 0;
71 itr = text; 72 itr = text;
72 while (itr < run_end) 73 while (itr < run_end)
73 { 74 {
@@ -85,7 +86,17 @@ get_top_font:
85 if (evas_common_language_char_script_get(*itr) == EVAS_SCRIPT_INHERITED) 86 if (evas_common_language_char_script_get(*itr) == EVAS_SCRIPT_INHERITED)
86 continue; 87 continue;
87 88
88 Eina_Unicode variation_sequence = VAR_SEQ_SAFE(itr+1); 89 if (!variation_sequence)
90 {
91 variation_sequence = VAR_SEQ_SAFE(itr+1);
92 }
93 else
94 {
95 /* Variation sequence treated as single run, if we found one, we keep looking adding to same
96 * run, but if it is not, then we need to start a new one */
97 if (variation_sequence != VAR_SEQ_SAFE(itr+1))
98 break;
99 }
89 100
90 /* Break if either it's not in the font, or if it is in the 101 /* Break if either it's not in the font, or if it is in the
91 * script's font. */ 102 * script's font. */