Evas font: allow ":fallbacks" keyword when Evas parses font keyword
authorYoungbok Shin <youngb.shin@samsung.com>
Wed, 17 Feb 2016 09:23:06 +0000 (09:23 +0000)
committerTom Hacohen <tom@stosb.com>
Wed, 17 Feb 2016 09:23:06 +0000 (09:23 +0000)
Summary:
Developers could use fallback fonts using only font_fallbacks keyword.
The keyword is only allowed for Evas Textblock. It has to be common
feature for other text type objects.
Applying this patch, Text and Textgrid can add fallback fonts.
@feature

Test Plan:
Set font like the following example to Textblock, Text, Textgrid.
Sans:fallbacks=Inconsolata

Reviewers: tasn, herdsman, woohyun

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3704

src/lib/evas/canvas/evas_font_dir.c

index 3e544de..bfab21f 100644 (file)
@@ -533,6 +533,11 @@ evas_font_name_parse(Evas_Font_Description *fdesc, const char *name)
              eina_stringshare_replace_length(&(fdesc->lang), tmp, tend - tmp);
              eina_stringshare_replace(&(fdesc->lang), evas_font_lang_normalize(fdesc->lang));
           }
+        else if (!strncmp(name, ":fallbacks=", 11))
+          {
+             const char *tmp = name + 11;
+             eina_stringshare_replace_length(&(fdesc->fallbacks), tmp, tend - tmp);
+          }
      }
 }