diff options
author | Seungwan Woo <s-w.woo@samsung.com> | 2020-03-24 16:04:44 +0900 |
---|---|---|
committer | Jongmin Lee <jm105.lee@samsung.com> | 2020-04-03 09:07:36 +0900 |
commit | 9d8a04fdf4c666169f062ec5a51c942edfea31bd (patch) | |
tree | 1a8db9e9baee47dfd45e9e53c9a3182e47f641cb | |
parent | afbffee55b451432f0aa3482adf7b0de0ace2313 (diff) | |
download | efl-config-tizen_6.0_hotfix.tar.gz efl-config-tizen_6.0_hotfix.tar.bz2 efl-config-tizen_6.0_hotfix.zip |
efl-config: update extension_font_overlay list for wearable profiletizen_8.0_m2_releasetizen_7.0_m2_releasetizen_6.5.m2_releasetizen_6.0.m2_releasesubmit/tizen_6.5/20211028.163101submit/tizen_6.0_hotfix/20201103.114805submit/tizen_6.0_hotfix/20201102.192505submit/tizen_6.0/20201029.205105submit/tizen/20200408.212617submit/tizen/20200407.212858submit/tizen/20200406.235844submit/tizen/20200405.220557accepted/tizen/unified/20200409.083720accepted/tizen/8.0/unified/20231005.094110accepted/tizen/7.0/unified/hotfix/20221116.110033accepted/tizen/7.0/unified/20221110.063719accepted/tizen/6.5/unified/20211028.115441accepted/tizen/6.0/unified/hotfix/20201103.002354accepted/tizen/6.0/unified/20201030.114142tizen_8.0tizen_7.0_hotfixtizen_7.0tizen_6.5tizen_6.0_hotfixtizen_6.0accepted/tizen_8.0_unifiedaccepted/tizen_7.0_unified_hotfixaccepted/tizen_7.0_unifiedaccepted/tizen_6.5_unifiedaccepted/tizen_6.0_unified_hotfixaccepted/tizen_6.0_unified
when system font is changed, extension_font_overlay of wearable profile also should be changed.
regarding font_size, only scalable fonts will be changed.
Change-Id: I0678694ca7c92c1b43323de3444e00792ca80f98
Signed-off-by: Seungwan Woo <s-w.woo@samsung.com>
-rw-r--r-- | src/efl_config.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/efl_config.c b/src/efl_config.c index 50fd3ca..6c4ec3b 100644 --- a/src/efl_config.c +++ b/src/efl_config.c @@ -164,6 +164,64 @@ _font_set(const char *font_name, int font_size) text_classes = NULL; elm_config_font_overlay_apply(); + + //TIZEN_ONLY(20200324): EXTENSION_THEME + tizen_profile_t prof = get_tizen_profile(); + if (prof != TIZEN_PROFILE_WEARABLE) + { + return; + } + + extern Eina_List* _elm_config_extension_font_overlay_get(const char* theme_name); + extern Eina_Bool _elm_config_extension_font_overlay_set(const Eina_List* list, const char* theme_name); + + static const char* scalable_text_classes[] = { + "T0211", "T0211D", "T0211P", "T0211S", "T071", "T092", "T097", NULL + }; + + Eina_List* ext_font_overlays = _elm_config_extension_font_overlay_get("default"); + if (ext_font_overlays) + { + static Eina_Hash *scalable_font_hash = NULL; + if (!scalable_font_hash) + { + scalable_font_hash = eina_hash_string_small_new(NULL); + for (int i = 0; scalable_text_classes[i]; ++i) + { + eina_hash_add(scalable_font_hash, scalable_text_classes[i], EINA_TRUE); + } + } + + char buf[128] = {0,}; + Eina_List *l = NULL; + Elm_Font_Overlay *efd = NULL; + EINA_LIST_FOREACH(ext_font_overlays, l, efd) + { + char *p = strchr(efd->font, ':'); + snprintf(buf, sizeof(buf), "%s%s", font_name, p); + eina_stringshare_replace(&efd->font, buf); + + if (eina_hash_find(scalable_font_hash, efd->text_class)) + { + efd->size = font_size; + } + } + if (scalable_font_hash) + eina_hash_free(scalable_font_hash); + scalable_font_hash = NULL; + + Eina_Bool res = _elm_config_extension_font_overlay_set(ext_font_overlays, "default"); + EINA_LOG_DBG("efl-config :: result of set font overlay [%d]", res); + + EINA_LIST_FREE(ext_font_overlays, efd) + { + eina_stringshare_del(efd->text_class); + eina_stringshare_del(efd->font); + free(efd); + } + ext_font_overlays = eina_list_free(ext_font_overlays); + } + // } static Eina_Bool |