evas font: append global font path when Evas initializes Fontconfig
authorYoungbok Shin <youngb.shin@samsung.com>
Tue, 11 Jul 2017 06:46:03 +0000 (15:46 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Tue, 11 Jul 2017 06:46:04 +0000 (15:46 +0900)
Summary:
If there are appended font pathes before initializing Fontconfig,
Evas must care the font pathes after initializing Fontconfig.
@fix

Test Plan:
1. Call evas_font_path_global_append() with a private font path
   before adding any Evas Object.
2. Add a Evas Textblock object which uses a font from the private font path.
3. See the font is not loaded properly without the patch.

Reviewers: raster, cedric, herdsman, jpeg, woohyun

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

src/lib/evas/canvas/evas_font_dir.c

index 2f4c859..361e0fd 100644 (file)
@@ -61,7 +61,15 @@ evas_font_init(void)
 {
 #ifdef HAVE_FONTCONFIG
    if (!fc_config)
-     fc_config = FcInitLoadConfigAndFonts();
+     {
+        Eina_List *l;
+        char *path;
+
+        fc_config = FcInitLoadConfigAndFonts();
+
+        EINA_LIST_FOREACH(global_font_path, l, path)
+           FcConfigAppFontAddDir(fc_config, (const FcChar8 *) path);
+     }
 #endif
 }