summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoungbok Shin <youngb.shin@samsung.com>2017-01-21 19:00:46 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-01-21 19:00:46 +0900
commit65be73c58f91a768c7f7228e3e83863e90a92ade (patch)
tree99060b69e70c17006ebaecbc76f46eaa98133449
parent9a7d6e610791892fbabdfdc9b8fcdf74a1e7ed5e (diff)
evas font: revise evas_font_init/reinit functions
Summary: The static flag in evas_font_init() was not useful. It could be replaced by checking address of "fc_config". FcInitReinitialize() function was not necessary to reload configure and font files in Evas. It would be meaningful when only Evas use Fontconfig's function without own "fc_config". To reload "fc_config", calling FcInitLoadConfigAndFonts() is enough. And there is no need to load "fc_config" from evas_font_reinit() when "fc_config" is not prepared. Test Plan: N/A Reviewers: herdsman, raster, tasn, cedric, woohyun Subscribers: jpeg Differential Revision: https://phab.enlightenment.org/D4612
-rw-r--r--src/lib/evas/canvas/evas_font_dir.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/lib/evas/canvas/evas_font_dir.c b/src/lib/evas/canvas/evas_font_dir.c
index 8d36049445..682f80ff46 100644
--- a/src/lib/evas/canvas/evas_font_dir.c
+++ b/src/lib/evas/canvas/evas_font_dir.c
@@ -59,12 +59,9 @@ static FcConfig *fc_config = NULL;
59static void 59static void
60evas_font_init(void) 60evas_font_init(void)
61{ 61{
62 static Eina_Bool fc_init = EINA_FALSE;
63 if (fc_init)
64 return;
65 fc_init = EINA_TRUE;
66#ifdef HAVE_FONTCONFIG 62#ifdef HAVE_FONTCONFIG
67 fc_config = FcInitLoadConfigAndFonts(); 63 if (!fc_config)
64 fc_config = FcInitLoadConfigAndFonts();
68#endif 65#endif
69} 66}
70 67
@@ -1531,12 +1528,13 @@ evas_font_reinit(void)
1531 Eina_List *l; 1528 Eina_List *l;
1532 char *path; 1529 char *path;
1533 1530
1534 if (fc_config) FcConfigDestroy(fc_config); 1531 if (fc_config)
1535 1532 {
1536 FcInitReinitialize(); 1533 FcConfigDestroy(fc_config);
1537 fc_config = FcInitLoadConfigAndFonts(); 1534 fc_config = FcInitLoadConfigAndFonts();
1538 1535
1539 EINA_LIST_FOREACH(global_font_path, l, path) 1536 EINA_LIST_FOREACH(global_font_path, l, path)
1540 FcConfigAppFontAddDir(fc_config, (const FcChar8 *) path); 1537 FcConfigAppFontAddDir(fc_config, (const FcChar8 *) path);
1538 }
1541#endif 1539#endif
1542} 1540}