[Fontconfig] FcConfigNormalizeFontDir considered harmful

James Cloos cloos at jhcloos.com
Mon Aug 28 06:28:13 PDT 2006

>>>>> "Keith" == Keith Packard <keithp at keithp.com> writes:

Keith> That's just for directory names that come from the user though,
Keith> and there aren't very many places where we have those aside
Keith> from fc-cache.

Don't forget fc-cat.

Another issue since the change from cache files in the same dirs as
the fonts to a central cache dir is that fc-cache could not (I've not
yet tested fc-2_4-keithp) cache dirs that were neither in fonts.conf
<dir/> entries nor subdirectories thereof.

Ie, you couldn't preemptively cache directories.

As a concrete example, I keep several poorer-quality collections under
/usr/local/share/fonts, and add one or two at a time whenever I want
to use fonts from them.  I used to just run:

| fc-cache -fv /usr/local/share/fonts

to ensure the cache files were up to date.  But when I upgraded to a
version that used /var/cache/fontconfig I had to add /usr/local/share/fonts
to fonts.conf to run fc-cache on it, just to remove it again afterwords.

(On a box like my laptop -- harware limited to a half gig of ram, and
quite slow pata drives -- it is important not to speculatively have
every possible font dir in fonts.conf; even with mmap(2)ed cache files
it takes up too much ram.)

It would also be useful for package management code to be able to
generate the cache files when a font directory is installed, even
if that directory is not yet referenced in fonts.conf.


P.S.  I presume master is matches CVS HEAD?  And so fc-2_4_branch
      and fc-2_4-keithp are the interesting branches?

James Cloos <cloos at jhcloos.com>         OpenPGP: 0xED7DAEA6

More information about the Fontconfig mailing list