summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAkira TAGOH <akira@tagoh.org>2018-02-05 13:31:00 +0900
committerAkira TAGOH <akira@tagoh.org>2018-02-05 13:31:00 +0900
commit0394cb7829d16a902e2eebdcc4f00db3774916b8 (patch)
tree9678fcea1fc688296632988d2601c8cc43a9cfad /src
parent34b5c949d51fcc8eafe2301ca8f539f735e31522 (diff)
Ensure the user config dir is available in the list of config dirs on the fallback config
Diffstat (limited to 'src')
-rw-r--r--src/fcinit.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/fcinit.c b/src/fcinit.c
index 30646dc1..5831a196 100644
--- a/src/fcinit.c
+++ b/src/fcinit.c
@@ -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: