summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBowon Ryu <bowon.ryu@samsung.com>2020-02-24 20:16:40 +0900
committerHermet Park <hermetpark@gmail.com>2020-02-24 20:16:41 +0900
commit9dfcd5f9ecc9f26c882c1314d2a30b1b5fe2d29e (patch)
tree47dec24920a92d479e98973539c69281f58654b7
parentc8f26d96919f22e1d76e60c29c9dd9aac963293c (diff)
edje/style: Fix a problem where embedded font does not load in edj
Summary: When edje_font_is_embedded the path of the font must be "font=edje/fonts/%s" The previous code is "font=%s" This causes the font to not load properly when edje_font_is_embedded. Test Plan: edje_cc test.edc edje_player test.edj collections { group { "main"; fonts { // Set any two fonts in your local path. font: "ANYFONT_1.TTF" "font_1"; font: "ANYFONT_2.TTF" "font_2"; } styles { style { name: "textblock_style_1"; base: "font=font_1 font_size=30 color=#ffffff"; } style { name: "textblock_style_2"; base: "font=font_2 font_size=30 color=#ffffff"; } } parts { spacer { "base"; scale; desc { "default"; min: 600 250; max: 600 250; } } rect { "bg"; scale; desc { "default"; rel.to: "base"; color: 5 5 5 255; } } textblock { "tb1"; scale; desc { "default"; rel.to: base; rel1.relative: 0 0; rel2.relative: 1 0.5; text.text: "THIS IS FONT 1"; text.style: "textblock_style_1"; } } textblock { "tb2"; scale; desc { "default"; rel.to: base; rel1.relative: 0 0.5; rel2.relative: 1 1; text.text: "THIS IS FONT 2"; text.style: "textblock_style_2"; } } } } } Reviewers: smohanty, CHAN, Hermet Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11401
-rw-r--r--src/lib/edje/edje_textblock_styles.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/edje/edje_textblock_styles.c b/src/lib/edje/edje_textblock_styles.c
index 0eec7bca80..340e77abbc 100644
--- a/src/lib/edje/edje_textblock_styles.c
+++ b/src/lib/edje/edje_textblock_styles.c
@@ -166,6 +166,10 @@ _edje_format_reparse(Edje_File *edf, const char *str, Edje_Style_Tag *tag_ret, E
166 char buffer[120]; 166 char buffer[120];
167 snprintf(buffer, sizeof(buffer), "edje/fonts/%s", val); 167 snprintf(buffer, sizeof(buffer), "edje/fonts/%s", val);
168 tag_ret->font = eina_stringshare_add(buffer); 168 tag_ret->font = eina_stringshare_add(buffer);
169 if (eina_strbuf_length_get(result)) eina_strbuf_append(result, " ");
170 eina_strbuf_append(result, "font=");
171 eina_strbuf_append(result, buffer);
172 continue;
169 } 173 }
170 else 174 else
171 { 175 {