[Fontconfig] about <match> tag

Behdad Esfahbod behdad at behdad.org
Tue Dec 11 11:48:51 PST 2007


On Tue, 2007-12-11 at 17:30 +0800, Deephay wrote:
> Greetings all,
> 
> After reading the manual, I still not very much understand what is the
> difference of the following two match tags.
> 
> <match target="pattern">
> <match target="font">
> 
> Could anyone give me a example? thanks very much!

Applications typically work like this:

  - Convert user's font request to a fontconfig pattern,

  - Apply fontconfig configuration on it using target="pattern",

  - Get a sorted list of fonts matching that pattern from fontconfig.
The list is returned as a set of fontconfig patterns itself,

  - Choose the font to use (typically the first one having the requested
character),

  - Apply fontconfig configuration on the font pattern using
target="font".


So, what it means is that for example if you want to turn off
antialiasing on Bitstream Vera Sans for sizes less than 7.5, you should
do that using target="font".  If you do it with target="pattern", it
will turn off aa for all fonts if the request is Bitstream Vera Sans,
regardless of whether you have that font installed or not.

If you want to write fallback rules such that DejaVu Sans be substituted
for Bitstream Vera Sans, that's done with target="pattern", because you
want to modify the request.


Hope that helps,

> Cheers,
> Deephay

-- 
behdad
http://behdad.org/

...very few phenomena can pull someone out of Deep Hack Mode, with two
noted exceptions: being struck by lightning, or worse, your *computer*
being struck by lightning.  -- Matt Welsh



More information about the Fontconfig mailing list