2020-05-26 19:35:25 -07:00
|
|
|
From 2ff9b53ce755be183ef9274f7dd3f9ac537173f6 Mon Sep 17 00:00:00 2001
|
|
|
|
From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= <vcunat@gmail.com>
|
|
|
|
Date: Tue, 4 Nov 2014 12:24:25 +0100
|
|
|
|
Subject: [PATCH] add check for /etc/fonts/@configVersion@/fonts.conf
|
2014-11-04 04:49:22 -08:00
|
|
|
|
2020-05-26 19:35:25 -07:00
|
|
|
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 <jtojnar@gmail.com>
|
|
|
|
---
|
|
|
|
src/fccfg.c | 7 ++++++-
|
|
|
|
1 file changed, 6 insertions(+), 1 deletion(-)
|
2014-11-04 04:49:22 -08:00
|
|
|
|
|
|
|
diff --git a/src/fccfg.c b/src/fccfg.c
|
2020-05-26 19:35:25 -07:00
|
|
|
index 342c996..98a1324 100644
|
2014-11-04 04:49:22 -08:00
|
|
|
--- a/src/fccfg.c
|
|
|
|
+++ b/src/fccfg.c
|
2020-05-26 19:35:25 -07:00
|
|
|
@@ -2391,8 +2391,13 @@ FcConfigGetFilename (FcConfig *config,
|
2014-11-04 04:49:22 -08:00
|
|
|
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;
|
2020-05-26 19:35:25 -07:00
|
|
|
+ url = (FcChar8 *) FONTCONFIG_PATH "/" FONTCONFIG_FILE;
|
2014-11-04 04:49:22 -08:00
|
|
|
}
|
|
|
|
file = 0;
|
|
|
|
|
2020-05-26 19:35:25 -07:00
|
|
|
--
|
|
|
|
2.26.2
|
|
|
|
|