summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorAli Alzyod <ali198724@gmail.com>2019-10-19 14:01:36 +0900
committerWooHyun Jung <wh0705.jung@samsung.com>2019-10-19 14:01:36 +0900
commit46f2d8acdcda3f374c9e393ecb734ff9d00fef7d (patch)
tree6ed08f82acd5c87db6a08c76230def2b99de0bab /src/tests
parent20b592cef7f231378f67e0f78d5670144b4d3693 (diff)
evas_object_textblock: add support for variation sequences
Summary: update font processing to handle variation sequences unicodes to select proper glypg in respect to variation seqences Test Plan: ``` #define EFL_EO_API_SUPPORT 1 #define EFL_BETA_API_SUPPORT 1 #include <Eina.h> #include <Efl.h> #include <Elementary.h> EAPI_MAIN int elm_main(int argc, char **argv) { Evas_Object *win, *textblock; elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); win = elm_win_util_standard_add("Main", ""); elm_win_autodel_set(win, EINA_TRUE); textblock = evas_object_textblock_add(win); efl_canvas_text_style_set(textblock,NULL,"DEFAULT='font=DejaVuSans font_fallbacks=SamsungColorEmoji color=#000 font_size=20'"); evas_object_textblock_text_markup_set(textblock, "8&#xfe0f;&#x20E3;&#x262a;&#xfe0f;AAA&#x262a;&#xfe0E;1234567&#xfe0f;&#x20E3;"); evas_object_size_hint_weight_set(textblock, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(textblock, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(textblock); evas_object_move(textblock, 0, 0); evas_object_resize(textblock, 320, 320); evas_object_resize(win, 320, 320); evas_object_show(win); elm_run(); return 0; } ELM_MAIN() ``` Reviewers: woohyun, bowonryu, segfaultxavi, cedric, bu5hm4n Reviewed By: woohyun, cedric Subscribers: bu5hm4n, subodh6129, herdsman, segfaultxavi, zmike, cedric, #committers, #reviewers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9053
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/evas/evas_test_textblock.c20
-rw-r--r--src/tests/evas/fonts/NotoColorEmoji.ttfbin0 -> 7297112 bytes
-rw-r--r--src/tests/evas/fonts/NotoEmoji-Regular.ttfbin0 -> 418804 bytes
3 files changed, 19 insertions, 1 deletions
diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c
index f61574c..2db6888 100644
--- a/src/tests/evas/evas_test_textblock.c
+++ b/src/tests/evas/evas_test_textblock.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * TODO: 2 * TODO:
3 * * Test different font lodaing mechanisms. 3 * * Test different font loading mechanisms.
4 */ 4 */
5 5
6#ifdef HAVE_CONFIG_H 6#ifdef HAVE_CONFIG_H
@@ -4129,6 +4129,23 @@ EFL_START_TEST(evas_textblock_obstacle)
4129} 4129}
4130EFL_END_TEST; 4130EFL_END_TEST;
4131 4131
4132EFL_START_TEST(evas_textblock_variation_sequence)
4133{
4134 START_TB_TEST();
4135 evas_font_path_global_prepend("..");
4136 const char *str1 = "8&#xfe0f;&#x262a;&#xfe0f;";
4137 const char *str2 = "8&#xfe0e;&#x262a;&#xfe0e;";
4138 Evas_Coord fw, fh,fw_new, fh_new;
4139 evas_object_textblock_text_markup_set(tb, str1);
4140 evas_object_textblock_size_formatted_get(tb, &fw, &fh);
4141 evas_object_textblock_text_markup_set(tb, str2);
4142 evas_object_textblock_size_formatted_get(tb, &fw_new, &fh_new);
4143 fail_if(fw_new == fw && fh_new == fh);
4144
4145 END_TB_TEST();
4146}
4147EFL_END_TEST;
4148
4132#ifdef HAVE_HYPHEN 4149#ifdef HAVE_HYPHEN
4133static void 4150static void
4134_hyphenation_width_stress(Evas_Object *tb, Evas_Textblock_Cursor *cur) 4151_hyphenation_width_stress(Evas_Object *tb, Evas_Textblock_Cursor *cur)
@@ -4729,6 +4746,7 @@ void evas_test_textblock(TCase *tc)
4729 tcase_add_test(tc, evas_textblock_items); 4746 tcase_add_test(tc, evas_textblock_items);
4730 tcase_add_test(tc, evas_textblock_delete); 4747 tcase_add_test(tc, evas_textblock_delete);
4731 tcase_add_test(tc, evas_textblock_obstacle); 4748 tcase_add_test(tc, evas_textblock_obstacle);
4749 tcase_add_test(tc, evas_textblock_variation_sequence);
4732#ifdef HAVE_HYPHEN 4750#ifdef HAVE_HYPHEN
4733 tcase_add_test(tc, evas_textblock_hyphenation); 4751 tcase_add_test(tc, evas_textblock_hyphenation);
4734#endif 4752#endif
diff --git a/src/tests/evas/fonts/NotoColorEmoji.ttf b/src/tests/evas/fonts/NotoColorEmoji.ttf
new file mode 100644
index 0000000..69cf21a
--- /dev/null
+++ b/src/tests/evas/fonts/NotoColorEmoji.ttf
Binary files differ
diff --git a/src/tests/evas/fonts/NotoEmoji-Regular.ttf b/src/tests/evas/fonts/NotoEmoji-Regular.ttf
new file mode 100644
index 0000000..19b7bad
--- /dev/null
+++ b/src/tests/evas/fonts/NotoEmoji-Regular.ttf
Binary files differ