Around 22 o'clock on Sep 6, Ken Deeter wrote:

> I am concerned that without doing something like this, adding a font
> directory would require modifying two files instead of one (the
> fonts.conf to add the <dir> and the font mapping table file)

Adding a font directory almost never involves modifying any files at all 
-- you just stick the directory underneath one of the existing directory 
entries in the config file.  Fontconfig automatically discovers the new 
fonts and makes them available to applications.  You can stick fonts in 
~/.fonts and they are automatically available as fontconfig includes that
path in the default set of heirarchies.

To add a new directory heirarchy to the set of available fonts, all you 
have to do is edit the font configuration file and add a <dir> element.

Of course, in both cases, you're encouraged to run 'fc-cache' before using
the fonts so that the shared font cache file can be built.  Certainly any
relocation of that cache file would be automatically mananged by the
library, insisting that adminstrators and users keep two disparate files
synchronized is a really bad idea.

> I think a better solution would be to think of some kind of automatic
> mapping generation, that requires nothing from a user except to specify
> an extra directory in the fonts.conf

Only permitting a single extra directory makes it difficult for different 
users to have different sets of font heirarchies, in particular, 
caches for per-user fonts cannot live in /var/cache/fonts as that's 
probably not writable by each user.  Hence the idea of multiple mappings 
which match the directory prefix and replace that with a different prefix.

If no mapping prefix matches the font directory, the cache file would be 
placed within the directory itself just as is done today, so it's really 
only necessary to add these entries for system-wide read-only font 
directories.

Adding a property to the <dir> element would be very easy to understand, 
and I don't think that would tremendously burden users with too much 
configuration; most systems have only two or three font heirarchies 
present.

> I'm not sure what happens when the cache needs to be rebuilt, (i.e. how
> fontconfig knows when whats in the directory doesn't match whats in the
> cache, but i'm assuming this is already dealt with since it is a problem
> regardless of where the cache files are put)

Fontconfig keeps track of directory and file modification times in the 
cache and invalidates entries which are outdated.  It stat's every 
directory in the heirarchy at startup to detect changes, so it's somewhat 
important that the heirarchies be focused on fonts and not just '/'.

_______________________________________________
Fonts mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/fonts

Reply via email to