summaryrefslogtreecommitdiff
path: root/src/bin/elementary
diff options
context:
space:
mode:
authorAli Alzyod <ali198724@gmail.com>2019-12-12 16:22:12 +0900
committerWooHyun Jung <wh0705.jung@samsung.com>2019-12-12 16:22:12 +0900
commit2d7622491884843ce15e2717675b128af1bdbefc (patch)
treebadc8961affe622f541c3347e3b1b6d620bff898 /src/bin/elementary
parentc62a7dae6316df60c6c47577743b62185ca56951 (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: raster, bu5hm4n, subodh6129, herdsman, segfaultxavi, zmike, cedric, #committers, #reviewers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9053
Diffstat (limited to 'src/bin/elementary')
-rw-r--r--src/bin/elementary/test.c2
-rw-r--r--src/bin/elementary/test_label.c24
2 files changed, 26 insertions, 0 deletions
diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c
index 966d164..4150ab2 100644
--- a/src/bin/elementary/test.c
+++ b/src/bin/elementary/test.c
@@ -244,6 +244,7 @@ void test_textblock_fit(void *data, Evas_Object *obj, void *event_info);
244void test_label_ellipsis(void *data, Evas_Object *obj, void *event_info); 244void test_label_ellipsis(void *data, Evas_Object *obj, void *event_info);
245void test_label_colors(void *data, Evas_Object *obj, void *event_info); 245void test_label_colors(void *data, Evas_Object *obj, void *event_info);
246void test_label_emoji(void *data, Evas_Object *obj, void *event_info); 246void test_label_emoji(void *data, Evas_Object *obj, void *event_info);
247void test_label_variation_sequence(void *data, Evas_Object *obj, void *event_info);
247void test_conformant(void *data, Evas_Object *obj, void *event_info); 248void test_conformant(void *data, Evas_Object *obj, void *event_info);
248void test_conformant2(void *data, Evas_Object *obj, void *event_info); 249void test_conformant2(void *data, Evas_Object *obj, void *event_info);
249void test_conformant_indicator(void *data, Evas_Object *obj, void *event_info); 250void test_conformant_indicator(void *data, Evas_Object *obj, void *event_info);
@@ -1211,6 +1212,7 @@ add_tests:
1211 ADD_TEST(NULL, "Text", "Label Ellipsis", test_label_ellipsis); 1212 ADD_TEST(NULL, "Text", "Label Ellipsis", test_label_ellipsis);
1212 ADD_TEST(NULL, "Text", "Label Colors", test_label_colors); 1213 ADD_TEST(NULL, "Text", "Label Colors", test_label_colors);
1213 ADD_TEST(NULL, "Text", "Label Emoji", test_label_emoji); 1214 ADD_TEST(NULL, "Text", "Label Emoji", test_label_emoji);
1215 ADD_TEST(NULL, "Text", "Label Variation Sequnece", test_label_variation_sequence);
1214 ADD_TEST_EO(NULL, "Text", "Efl.Ui.Textpath", test_ui_textpath); 1216 ADD_TEST_EO(NULL, "Text", "Efl.Ui.Textpath", test_ui_textpath);
1215 ADD_TEST_EO(NULL, "Text", "Efl.Canvas.Textblock style", test_canvas_textblock); 1217 ADD_TEST_EO(NULL, "Text", "Efl.Canvas.Textblock style", test_canvas_textblock);
1216 1218
diff --git a/src/bin/elementary/test_label.c b/src/bin/elementary/test_label.c
index 929d06b..5b3e5e8 100644
--- a/src/bin/elementary/test_label.c
+++ b/src/bin/elementary/test_label.c
@@ -635,6 +635,30 @@ test_label_colors(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev
635 evas_object_show(win); 635 evas_object_show(win);
636} 636}
637 637
638/*** Label variation sequence **************************************************************/
639void
640test_label_variation_sequence(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
641{
642 Evas_Object *win, *lb;
643
644 win = elm_win_util_standard_add("label-variation sequence", "Label variation sequnece");
645 elm_win_autodel_set(win, EINA_TRUE);
646
647 lb = elm_label_add(win);
648 elm_object_text_set(lb,
649 "You need to have at least on font contains variation sequence<br>"
650 "Three different 8 glyphs : <br>"
651 "8<tab>8&#xfe0f;<tab>8&#xfe0f;&#x20E3;<br>"
652 "line with 3 variation glyphs : <br>"
653 "8&#xfe0f;&#x20E3;&#x262a;&#xfe0f;AAA&#x262a;&#xfe0E;1234567&#xfe0f;&#x20E3;"
654 );
655 evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
656 elm_win_resize_object_add(win, lb);
657 evas_object_show(lb);
658
659 evas_object_show(win);
660}
661
638/*** Label Emoji *************************************************************/ 662/*** Label Emoji *************************************************************/
639static char * 663static char *
640_fontlist_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED) 664_fontlist_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED)