forked from enlightenment/efl
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
This commit is contained in:
parent
9a7d6e6107
commit
65be73c58f
|
@ -59,12 +59,9 @@ static FcConfig *fc_config = NULL;
|
||||||
static void
|
static void
|
||||||
evas_font_init(void)
|
evas_font_init(void)
|
||||||
{
|
{
|
||||||
static Eina_Bool fc_init = EINA_FALSE;
|
|
||||||
if (fc_init)
|
|
||||||
return;
|
|
||||||
fc_init = EINA_TRUE;
|
|
||||||
#ifdef HAVE_FONTCONFIG
|
#ifdef HAVE_FONTCONFIG
|
||||||
fc_config = FcInitLoadConfigAndFonts();
|
if (!fc_config)
|
||||||
|
fc_config = FcInitLoadConfigAndFonts();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1531,12 +1528,13 @@ evas_font_reinit(void)
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
char *path;
|
char *path;
|
||||||
|
|
||||||
if (fc_config) FcConfigDestroy(fc_config);
|
if (fc_config)
|
||||||
|
{
|
||||||
|
FcConfigDestroy(fc_config);
|
||||||
|
fc_config = FcInitLoadConfigAndFonts();
|
||||||
|
|
||||||
FcInitReinitialize();
|
EINA_LIST_FOREACH(global_font_path, l, path)
|
||||||
fc_config = FcInitLoadConfigAndFonts();
|
FcConfigAppFontAddDir(fc_config, (const FcChar8 *) path);
|
||||||
|
}
|
||||||
EINA_LIST_FOREACH(global_font_path, l, path)
|
|
||||||
FcConfigAppFontAddDir(fc_config, (const FcChar8 *) path);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue