[Fontconfig] Excluding fonts

Keith Packard keithp at keithp.com
Wed Mar 5 07:29:25 EST 2003

Around 14 o'clock on Mar 4, Owen Taylor wrote:

> While this patch is more like 1), I do actually know the full pathnames
> to these fonts, so 2) would work as well, if it is perhaps a little
> less robust. (They are from the ghostscript distribution and don't
> render properly with FreeType.)

So, do you want to blacklist by filename or the contents of the file?

A filename match will be significantly faster than matching the values.
It would also let you skip fonts which freetype can't even manage to get 
values for.  This seems appropriate for skipping fonts which aren't 
compatible with the libraries as you have here.  Using a full pathname 
glob would let you exclude certain files wherever they occur in the system:


would get rid of all compressed bitmap fonts while


would eliminate the entire misc directory.  I'd do the matching on 
directory names before scanning which would short-circuit scanning them at 
startup time, reducing memory usage and speeding up application loading.
Managing ~/.fonts.cache might be complicated in this case, but I think we 
could manage even that.

Pattern matching would be quite straightforward, and as the pattern 
includes the filename, it would be a strict superset of the above 
functionality.  It would be quite a bit slower at startup time as
patterns would have to be computed and then discarded.  Again, ~/
.fonts.cache management would be complicated but probably managable.


More information about the Fontconfig mailing list