summaryrefslogtreecommitdiff
path: root/src/tests/evas
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-04-18 17:36:25 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-04-18 17:36:25 +0100
commit3283a11a881e42f1bfef95834451a4e551713391 (patch)
treedcd726aae7d60752aa2ae4975bc5068b0b589733 /src/tests/evas
parentc58f8db1325de3685abb8e64fde88e9538fadf5b (diff)
evas_textblock/evas_text/evas_textgrid: pick textrun fonts
Summary: Picking font on textrun, will now give priority into font picked by the user, regardless of script type. picking font due script can cause many inconvenient results Example of wrong results: (User font is **NotoColorEmoji**) {F3847118} -> add 'a' at the end (notice how text render is wrong) {F3847119} -> add tab before 'a' (text rendering now is right) {F3847120} After Change results: (User font is **NotoColorEmoji**) {F3847118} -> add 'a' at the end -> {F3847122}-> add tab before 'a' -> {F3847123} Also now the following lines will be shown exactly the same, regardless of characters order ``` "가123A321" "A321가123" "123가A321" "A가123321" ``` Test Plan: ``` #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("", ""); 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_entry_text_style_user_push(en,"DEFAULT='font=NotoColorEmoji font_size=30 color=red'"); elm_object_text_set(en, "&#x262a;123456a"); 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, tasn, raster, cedric Reviewed By: tasn Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8556 Differential Revision: https://phab.enlightenment.org/D11302
Diffstat (limited to 'src/tests/evas')
-rw-r--r--src/tests/evas/evas_test_textblock.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c
index acf21186c7..d26b8fc7b9 100644
--- a/src/tests/evas/evas_test_textblock.c
+++ b/src/tests/evas/evas_test_textblock.c
@@ -4184,6 +4184,27 @@ EFL_START_TEST(evas_textblock_fit)
4184} 4184}
4185EFL_END_TEST; 4185EFL_END_TEST;
4186 4186
4187EFL_START_TEST(evas_textblock_textrun_font)
4188{
4189 START_TB_TEST();
4190 int w1, h1, w2, h2;
4191
4192 evas_object_resize(tb, 300, 300);
4193 evas_object_textblock_text_markup_set(tb, "가123A321");
4194 evas_object_textblock_size_native_get(tb, &w1, &h1);
4195 evas_object_textblock_text_markup_set(tb, "A321가123");
4196 evas_object_textblock_size_native_get(tb, &w2, &h2);
4197 ck_assert(w1==w2 && h1==h2);
4198 evas_object_textblock_text_markup_set(tb, "123가A321");
4199 evas_object_textblock_size_native_get(tb, &w2, &h2);
4200 ck_assert(w1==w2 && h1==h2);
4201 evas_object_textblock_text_markup_set(tb, "A가123321");
4202 evas_object_textblock_size_native_get(tb, &w2, &h2);
4203 ck_assert(w1==w2 && h1==h2);
4204 END_TB_TEST();
4205}
4206EFL_END_TEST;
4207
4187#ifdef HAVE_HYPHEN 4208#ifdef HAVE_HYPHEN
4188static void 4209static void
4189_hyphenation_width_stress(Evas_Object *tb, Evas_Textblock_Cursor *cur) 4210_hyphenation_width_stress(Evas_Object *tb, Evas_Textblock_Cursor *cur)
@@ -5055,6 +5076,7 @@ void evas_test_textblock(TCase *tc)
5055 tcase_add_test(tc, evas_textblock_delete); 5076 tcase_add_test(tc, evas_textblock_delete);
5056 tcase_add_test(tc, evas_textblock_obstacle); 5077 tcase_add_test(tc, evas_textblock_obstacle);
5057 tcase_add_test(tc, evas_textblock_fit); 5078 tcase_add_test(tc, evas_textblock_fit);
5079 tcase_add_test(tc, evas_textblock_textrun_font);
5058#ifdef HAVE_HYPHEN 5080#ifdef HAVE_HYPHEN
5059 tcase_add_test(tc, evas_textblock_hyphenation); 5081 tcase_add_test(tc, evas_textblock_hyphenation);
5060#endif 5082#endif