From 2ff9b53ce755be183ef9274f7dd3f9ac537173f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Tue, 4 Nov 2014 12:24:25 +0100 Subject: [PATCH] add check for /etc/fonts/@configVersion@/fonts.conf It's checked between FONTCONFIG_FILE and the in-package etc/fonts/fonts.conf. The latter is used so that on non-NixOS distributions, fontconfig works at least with upstream defaults, even when the global config is incompatible. Co-Authored-By: Jan Tojnar --- src/fccfg.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/fccfg.c b/src/fccfg.c index 342c996..98a1324 100644 --- a/src/fccfg.c +++ b/src/fccfg.c @@ -2391,8 +2391,13 @@ FcConfigGetFilename (FcConfig *config, if (!url || !*url) { url = (FcChar8 *) getenv ("FONTCONFIG_FILE"); + if (!url) { + static const FcChar8 *cfPath = "/etc/fonts/@configVersion@/fonts.conf"; + if (access (cfPath, R_OK) == 0) + url = cfPath; + } if (!url) - url = (FcChar8 *) FONTCONFIG_FILE; + url = (FcChar8 *) FONTCONFIG_PATH "/" FONTCONFIG_FILE; } file = 0; -- 2.26.2