diff options
author | Ali Alzyod <ali198724@gmail.com> | 2019-12-12 16:22:12 +0900 |
---|---|---|
committer | WooHyun Jung <wh0705.jung@samsung.com> | 2019-12-12 16:22:12 +0900 |
commit | 2d7622491884843ce15e2717675b128af1bdbefc (patch) | |
tree | badc8961affe622f541c3347e3b1b6d620bff898 /src/bin | |
parent | c62a7dae6316df60c6c47577743b62185ca56951 (diff) | |
download | efl-2d7622491884843ce15e2717675b128af1bdbefc.tar.gz |
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️⃣☪️AAA☪︎1234567️⃣");
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')
-rw-r--r-- | src/bin/elementary/test.c | 2 | ||||
-rw-r--r-- | src/bin/elementary/test_label.c | 24 |
2 files changed, 26 insertions, 0 deletions
diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c index 966d164c24..4150ab20ea 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); void test_label_ellipsis(void *data, Evas_Object *obj, void *event_info); void test_label_colors(void *data, Evas_Object *obj, void *event_info); void test_label_emoji(void *data, Evas_Object *obj, void *event_info); +void test_label_variation_sequence(void *data, Evas_Object *obj, void *event_info); void test_conformant(void *data, Evas_Object *obj, void *event_info); void test_conformant2(void *data, Evas_Object *obj, void *event_info); void test_conformant_indicator(void *data, Evas_Object *obj, void *event_info); @@ -1211,6 +1212,7 @@ add_tests: ADD_TEST(NULL, "Text", "Label Ellipsis", test_label_ellipsis); ADD_TEST(NULL, "Text", "Label Colors", test_label_colors); ADD_TEST(NULL, "Text", "Label Emoji", test_label_emoji); + ADD_TEST(NULL, "Text", "Label Variation Sequnece", test_label_variation_sequence); ADD_TEST_EO(NULL, "Text", "Efl.Ui.Textpath", test_ui_textpath); ADD_TEST_EO(NULL, "Text", "Efl.Canvas.Textblock style", test_canvas_textblock); diff --git a/src/bin/elementary/test_label.c b/src/bin/elementary/test_label.c index 929d06b1d5..5b3e5e8265 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 evas_object_show(win); } +/*** Label variation sequence **************************************************************/ +void +test_label_variation_sequence(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + Evas_Object *win, *lb; + + win = elm_win_util_standard_add("label-variation sequence", "Label variation sequnece"); + elm_win_autodel_set(win, EINA_TRUE); + + lb = elm_label_add(win); + elm_object_text_set(lb, + "You need to have at least on font contains variation sequence<br>" + "Three different 8 glyphs : <br>" + "8<tab>8️<tab>8️⃣<br>" + "line with 3 variation glyphs : <br>" + "8️⃣☪️AAA☪︎1234567️⃣" + ); + evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_win_resize_object_add(win, lb); + evas_object_show(lb); + + evas_object_show(win); +} + /*** Label Emoji *************************************************************/ static char * _fontlist_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED) |