summaryrefslogtreecommitdiff
path: root/src/bin
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/bin
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/bin')
-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 8259ed8..bcdb484 100644
--- a/src/bin/elementary/test.c
+++ b/src/bin/elementary/test.c
@@ -243,6 +243,7 @@ void test_label_wrap(void *data, Evas_Object *obj, void *event_info);
243void test_label_ellipsis(void *data, Evas_Object *obj, void *event_info); 243void test_label_ellipsis(void *data, Evas_Object *obj, void *event_info);
244void test_label_colors(void *data, Evas_Object *obj, void *event_info); 244void test_label_colors(void *data, Evas_Object *obj, void *event_info);
245void test_label_emoji(void *data, Evas_Object *obj, void *event_info); 245void test_label_emoji(void *data, Evas_Object *obj, void *event_info);
246void test_label_variation_sequence(void *data, Evas_Object *obj, void *event_info);
246void test_conformant(void *data, Evas_Object *obj, void *event_info); 247void test_conformant(void *data, Evas_Object *obj, void *event_info);
247void test_conformant2(void *data, Evas_Object *obj, void *event_info); 248void test_conformant2(void *data, Evas_Object *obj, void *event_info);
248void test_conformant_indicator(void *data, Evas_Object *obj, void *event_info); 249void test_conformant_indicator(void *data, Evas_Object *obj, void *event_info);
@@ -1210,6 +1211,7 @@ add_tests:
1210 ADD_TEST(NULL, "Text", "Label Ellipsis", test_label_ellipsis); 1211 ADD_TEST(NULL, "Text", "Label Ellipsis", test_label_ellipsis);
1211 ADD_TEST(NULL, "Text", "Label Colors", test_label_colors); 1212 ADD_TEST(NULL, "Text", "Label Colors", test_label_colors);
1212 ADD_TEST(NULL, "Text", "Label Emoji", test_label_emoji); 1213 ADD_TEST(NULL, "Text", "Label Emoji", test_label_emoji);
1214 ADD_TEST(NULL, "Text", "Label Variation Sequnece", test_label_variation_sequence);
1213 ADD_TEST_EO(NULL, "Text", "Efl.Ui.Textpath", test_ui_textpath); 1215 ADD_TEST_EO(NULL, "Text", "Efl.Ui.Textpath", test_ui_textpath);
1214 1216
1215 //------------------------------// 1217 //------------------------------//
diff --git a/src/bin/elementary/test_label.c b/src/bin/elementary/test_label.c
index 233ce01..72cb2ae 100644
--- a/src/bin/elementary/test_label.c
+++ b/src/bin/elementary/test_label.c
@@ -403,6 +403,30 @@ test_label_colors(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev
403 evas_object_show(win); 403 evas_object_show(win);
404} 404}
405 405
406/*** Label variation sequence **************************************************************/
407void
408test_label_variation_sequence(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
409{
410 Evas_Object *win, *lb;
411
412 win = elm_win_util_standard_add("label-variation sequence", "Label variation sequnece");
413 elm_win_autodel_set(win, EINA_TRUE);
414
415 lb = elm_label_add(win);
416 elm_object_text_set(lb,
417 "You need to have at least on font contains variation sequence<br>"
418 "Three different 8 glyphs : <br>"
419 "8<tab>8&#xfe0f;<tab>8&#xfe0f;&#x20E3;<br>"
420 "line with 3 variation glyphs : <br>"
421 "8&#xfe0f;&#x20E3;&#x262a;&#xfe0f;AAA&#x262a;&#xfe0E;1234567&#xfe0f;&#x20E3;"
422 );
423 evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
424 elm_win_resize_object_add(win, lb);
425 evas_object_show(lb);
426
427 evas_object_show(win);
428}
429
406/*** Label Emoji *************************************************************/ 430/*** Label Emoji *************************************************************/
407static char * 431static char *
408_fontlist_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED) 432_fontlist_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED)