aboutsummaryrefslogtreecommitdiff
path: root/fontconfig/src/fccfg.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-03-06 08:39:27 +0100
committermarha <marha@users.sourceforge.net>2013-03-06 08:39:27 +0100
commitb5acb643ab1a86b31409900a7c03281fcc48c8e3 (patch)
tree85db12bb6d437f616b2f91d547426d0e2d3173e6 /fontconfig/src/fccfg.c
parent6ddd685990187ec5f5996a16951a3d780c820272 (diff)
parent84798668341b15890d625e3bffbbc2d19f434568 (diff)
downloadvcxsrv-b5acb643ab1a86b31409900a7c03281fcc48c8e3.tar.gz
vcxsrv-b5acb643ab1a86b31409900a7c03281fcc48c8e3.tar.bz2
vcxsrv-b5acb643ab1a86b31409900a7c03281fcc48c8e3.zip
Merge remote-tracking branch 'origin/released'
* origin/released: fontconfig libfontenc mesa xserver git update 6 Mar 2013
Diffstat (limited to 'fontconfig/src/fccfg.c')
-rw-r--r--fontconfig/src/fccfg.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/fontconfig/src/fccfg.c b/fontconfig/src/fccfg.c
index db878d5f4..b762376ae 100644
--- a/fontconfig/src/fccfg.c
+++ b/fontconfig/src/fccfg.c
@@ -123,6 +123,8 @@ FcConfigCreate (void)
config->expr_pool = NULL;
+ config->sysRoot = NULL;
+
FcRefInit (&config->ref, 1);
return config;
@@ -292,6 +294,8 @@ FcConfigDestroy (FcConfig *config)
free (page);
page = next;
}
+ if (config->sysRoot)
+ FcStrFree (config->sysRoot);
free (config);
}
@@ -2309,6 +2313,59 @@ FcConfigAcceptFont (FcConfig *config,
return FcFalse;
return FcTrue;
}
+
+const FcChar8 *
+FcConfigGetSysRoot (const FcConfig *config)
+{
+ if (!config)
+ {
+ config = FcConfigGetCurrent ();
+ if (!config)
+ return NULL;
+ }
+
+ return config->sysRoot;
+}
+
+void
+FcConfigSetSysRoot (FcConfig *config,
+ const FcChar8 *sysroot)
+{
+ FcChar8 *s;
+ FcBool init = FcFalse;
+
+ if (!config)
+ {
+ /* We can't use FcConfigGetCurrent() here to ensure
+ * the sysroot is set prior to initialize FcConfig,
+ * to avoid loading caches from non-sysroot dirs.
+ * So postpone the initialization later.
+ */
+ config = fc_atomic_ptr_get (&_fcConfig);
+ if (!config)
+ {
+ config = FcConfigCreate ();
+ if (!config)
+ return;
+ init = FcTrue;
+ }
+ }
+
+ s = FcStrCopyFilename (sysroot);
+ if (!s)
+ return;
+
+ if (config->sysRoot)
+ FcStrFree (config->sysRoot);
+
+ config->sysRoot = s;
+ if (init)
+ {
+ config = FcInitLoadOwnConfigAndFonts (config);
+ FcConfigSetCurrent (config);
+ }
+}
+
#define __fccfg__
#include "fcaliastail.h"
#undef __fccfg__