Ensure the user config dir is available in the list of config dirs on the fallback config
This commit is contained in:
parent
34b5c949d5
commit
0394cb7829
14
src/fcinit.c
14
src/fcinit.c
|
@ -39,15 +39,23 @@ static FcConfig *
|
||||||
FcInitFallbackConfig (const FcChar8 *sysroot)
|
FcInitFallbackConfig (const FcChar8 *sysroot)
|
||||||
{
|
{
|
||||||
FcConfig *config;
|
FcConfig *config;
|
||||||
|
const FcChar8 *fallback = (const FcChar8 *) "" \
|
||||||
|
"<fontconfig>" \
|
||||||
|
" <dir>" FC_DEFAULT_FONTS "</dir>" \
|
||||||
|
" <dir prefix=\"xdg\">fonts</dir>" \
|
||||||
|
" <cachedir>" FC_CACHEDIR "</cachedir>" \
|
||||||
|
" <cachedir prefix=\"xdg\">fontconfig</cachedir>" \
|
||||||
|
" <include ignore_missing=\"yes\" prefix=\"xdg\">fontconfig/conf.d</include>" \
|
||||||
|
" <include ignore_missing=\"yes\" prefix=\"xdg\">fontconfig/fonts.conf</include>" \
|
||||||
|
"</fontconfig>";
|
||||||
|
|
||||||
config = FcConfigCreate ();
|
config = FcConfigCreate ();
|
||||||
if (!config)
|
if (!config)
|
||||||
goto bail0;
|
goto bail0;
|
||||||
FcConfigSetSysRoot (config, sysroot);
|
FcConfigSetSysRoot (config, sysroot);
|
||||||
if (!FcConfigAddFontDir (config, (FcChar8 *) FC_DEFAULT_FONTS))
|
if (!FcConfigParseAndLoadFromMemory (config, fallback, FcFalse))
|
||||||
goto bail1;
|
|
||||||
if (!FcConfigAddCacheDir (config, (FcChar8 *) FC_CACHEDIR))
|
|
||||||
goto bail1;
|
goto bail1;
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
|
|
||||||
bail1:
|
bail1:
|
||||||
|
|
Loading…
Reference in New Issue