From b650325b88235be6de2c3490b6a338dac03498c8 Mon Sep 17 00:00:00 2001 From: SubodhKumar Date: Mon, 16 Apr 2018 11:23:21 -0700 Subject: [PATCH] edje: Dont append font source if fonts are not embedded in edje Summary: If font source is not embedded in edje, it should not be appended in font source to skip the lookup in edj file while loading font. @fix Test Plan: NA Reviewers: cedric Reviewed By: cedric Subscribers: shilpasingh Differential Revision: https://phab.enlightenment.org/D5909 Reviewed-by: Cedric BAIL --- src/lib/edje/edje_textblock_styles.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/lib/edje/edje_textblock_styles.c b/src/lib/edje/edje_textblock_styles.c index 24cf2e1f0f..6585034292 100644 --- a/src/lib/edje/edje_textblock_styles.c +++ b/src/lib/edje/edje_textblock_styles.c @@ -191,7 +191,8 @@ _edje_textblock_style_update(Edje *ed, Edje_Style *stl, Eina_Bool force) if (_edje_fontset_append) fontset = eina_str_escape(_edje_fontset_append); - fontsource = eina_str_escape(ed->file->path); + if (ed->file->fonts) + fontsource = eina_str_escape(ed->file->path); /* Build the style from each tag */ EINA_LIST_FOREACH(stl->tags, l, tag) @@ -216,9 +217,12 @@ _edje_textblock_style_update(Edje *ed, Edje_Style *stl, Eina_Bool force) eina_strbuf_append(txt, "font_fallbacks="); eina_strbuf_append(txt, fontset); } - eina_strbuf_append(txt, " "); - eina_strbuf_append(txt, "font_source="); - eina_strbuf_append(txt, fontsource); + if (fontsource) + { + eina_strbuf_append(txt, " "); + eina_strbuf_append(txt, "font_source="); + eina_strbuf_append(txt, fontsource); + } } if (!EINA_DBL_EQ(tag->font_size, 0)) { @@ -466,7 +470,8 @@ _edje_textblock_style_parse_and_fix(Edje_File *edf) if (_edje_fontset_append) fontset = eina_str_escape(_edje_fontset_append); - fontsource = eina_str_escape(edf->path); + if (edf->fonts) + fontsource = eina_str_escape(edf->path); /* Build the style from each tag */ EINA_LIST_FOREACH(stl->tags, ll, tag) @@ -498,9 +503,12 @@ _edje_textblock_style_parse_and_fix(Edje_File *edf) eina_strbuf_append(txt, "font_fallbacks="); eina_strbuf_append(txt, fontset); } - eina_strbuf_append(txt, " "); - eina_strbuf_append(txt, "font_source="); - eina_strbuf_append(txt, fontsource); + if (fontsource) + { + eina_strbuf_append(txt, " "); + eina_strbuf_append(txt, "font_source="); + eina_strbuf_append(txt, fontsource); + } } if (tag->font_size > 0) {