[Fontconfig] Creating cachedir

Patrick Lam plam at MIT.EDU
Mon Dec 12 05:45:20 PST 2005


Keith Packard wrote:
> On Sat, 2005-12-10 at 02:21 -0500, Behdad Esfahbod wrote:
> 
>>Humm, and seems like a slash is missing somewhere:

I've added the slash and committed the Makefile.am patch.  Thanks!

>>BTW, how are different users handled exactly?  Isn't it possible
>>to harm other users?

To answer Behdad's original question, fc-cache generates a cache for 
each font directory.  If you run it as root, it'll generate caches for 
all font directories on the system, while if you run it as a user, it'll 
fail to generate caches for systemwide font directories.  In principle, 
it should then generate caches for user-installed fonts (e.g. in 
~/.fonts).  Then fontconfig creates a 'global' cache which contains any 
fonts which weren't in a per-directory cache.  This is slower.

> Rats. We need to keep the 'truely global' cache directory separate from
> per-user cache directories. That's annoying.
> 
> /var/cache/fontconfig should be root writable, per-user caches should
> live 'elsewhere'. I don't really want to create another per-user
> directory in their home directory, so perhaps we can stuff it in
> ~/.fonts/fontconfig ?

How about just: if you can't create the cache file in 
/var/cache/fontconfig, then create it in its original location?  Then 
when we try to open a cache file, we obviously need to try the original 
location first.  This is not quite as good as separating per-user and 
root caches, but it may be good enough.  Comments?

pat


More information about the Fontconfig mailing list