edje: Dont append font source if fonts are not embedded in edje
authorSubodhKumar <s7158.kumar@samsung.com>
Mon, 16 Apr 2018 18:23:21 +0000 (11:23 -0700)
committerWonki Kim <wonki_.kim@samsung.com>
Tue, 29 May 2018 04:06:50 +0000 (13:06 +0900)
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 <cedric@osg.samsung.com>
src/lib/edje/edje_textblock_styles.c

index b6a4073..ad5a138 100644 (file)
@@ -415,7 +415,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)
@@ -451,9 +452,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))
           {
@@ -917,7 +921,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)
@@ -949,9 +954,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)
                {