Commit 0394cb78 authored by Akira TAGOH's avatar Akira TAGOH

Ensure the user config dir is available in the list of config dirs on the fallback config

parent 34b5c949
......@@ -39,15 +39,23 @@ static FcConfig *
FcInitFallbackConfig (const FcChar8 *sysroot)
{
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 ();
if (!config)
goto bail0;
FcConfigSetSysRoot (config, sysroot);
if (!FcConfigAddFontDir (config, (FcChar8 *) FC_DEFAULT_FONTS))
goto bail1;
if (!FcConfigAddCacheDir (config, (FcChar8 *) FC_CACHEDIR))
if (!FcConfigParseAndLoadFromMemory (config, fallback, FcFalse))
goto bail1;
return config;
bail1:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment