[Fontconfig] separate cache file from directories?

Han-Wen Nienhuys hanwen at xs4all.nl
Fri Jun 17 09:17:46 EST 2005

hi there,

I've hit on a nasty problem with fontconfig within the MacOS X port of 
LilyPond. This program is delivered as a app-bundle, and can be 
installed by ordinary users, simply by drag & dropping the bundle 

The problem is that MacOS ships with a bunch of fonts in 
/System/Library/Fonts. Whenever our application starts
it scans this directory. This takes several minutes due to the oriental 
fonts. fc-cache cannot cache this directory, since it is not writable by 
ordinary users.

I hope I'm missing an obvious solution, but a cursory glace at the FC 
sources indicate that cache files are always written in the font 
directory itself.

Of course, I can kludge around this,

  - mirror /System/Library/Fonts with symlinks in a writable directory
    (I will probably use this kludge.)
  - ask the user for their password, and run fc-cache with sudo
  - write an installer that runs fc-cache.

however, none of these strike me as elegant. It would be better if the 
cache could be stored separately from the directory, under control of 
the process-owner. This also makes more sense if -for some reason- 
applications decide to add system-wide read-only font directories that 
are normally not part of a fontconfig installation 
(/usr/share/texmf/fonts/type1 springs to mind).

  Han-Wen Nienhuys - hanwen at xs4all.nl - http://www.xs4all.nl/~hanwen

More information about the Fontconfig mailing list