[Fontconfig] Include directories once only
behdad at cs.toronto.edu
Wed Nov 30 14:06:53 PST 2005
On Wed, 30 Nov 2005, Patrick Lam wrote:
> Behdad Esfahbod wrote:
> > Hi,
> > There's a but report for Pango here:
> > http://bugzilla.gnome.org/show_bug.cgi?id=89946
> > that while being a user problem, can be fixed by fontconfig doing
> > these:
> > 1) Not to include a config file more than once,
> > 2) Not to scan a directory more than once.
> > Is it possible/easy to do that?
> Please send me a patch to FcConfigAddFontDir and FcConfigAddConfigFile
> in fccfg.c that ensure that no font dir or config file is added more
> than once. Keeping them in sorted order is one way to do that, a hash
> table is another way.
Seems like directories are not a problem, since they are added to
an FcSet (which is a real set) and processed later. For config
files, the attached patch simply returns true if the config file
has been added already. Patch is against branch.
"Commandment Three says Do Not Kill, Amendment Two says Blood Will Spill"
-- Dan Bern, "New American Language"
-------------- next part --------------
RCS file: /cvs/fontconfig/fontconfig/src/fcxml.c,v
retrieving revision 184.108.40.206
diff -u -p -r220.127.116.11 fcxml.c
--- src/fcxml.c 18 Nov 2005 20:32:30 -0000 18.104.22.168
+++ src/fcxml.c 30 Nov 2005 22:06:29 -0000
@@ -2368,6 +2368,12 @@ FcConfigParseAndLoad (FcConfig *conf
+ if (FcStrSetMember (config->configFiles, filename))
+ FcStrFree (filename);
+ return FcTrue;
if (!FcStrSetAdd (config->configFiles, filename))
More information about the Fontconfig