[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Google
  Web www.spinics.net

Re: What metric does fontconfig use to select a font



Hi,

> On Mon, Sep 5, 2011 at 7:29 PM, Cyker Way <cykerway@xxxxxxxxx> wrote:
> [...]
>> BTW, how does fontconfig sort the precedence of fonts according to the
>> application request? If this question is not fully answered, maybe other
>> problems will arise in the future. Do you have any idea on that?

You could say that the "order" of the fonts is that of their distance from
the application-provided pattern.

It is detailed on

  http://www.freedesktop.org/software/fontconfig/fontconfig-user.html#AEN25

In short:
Your application specifies a pattern with a number of properties, like
family, pixelsize, etc. (Example: "Bitstream Vera Sans:pixelsize=13")
This pattern is modified through the <match target="pattern"> rules in
your config files.
(Every element in the pattern can in fact be a list ordered from good
candidate to not-so-good candidate.)
The modified pattern is then compared to all fonts that have been scanned,
using a predefined order of properties -- see the above link.
Properties like foundry and family weigh more than say, outline. Others
like file or fontformat are not used at all, so you cannot select a font
based on its filename.
It should also be noted that some applications have their own fallback
scheme on top of what fontconfig provides, e. g. based on CSS.

> [...]
> you may get more information from the debugging log by setting the env var
> like FC_DEBUG=4.

This is also a very good idea (be prepared for some output).

Raimund



-- 
R.Steger Tel. +49-179-2981632 icq 16845346

_______________________________________________
Fontconfig mailing list
Fontconfig@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/fontconfig


[Fedora Users]     [Fedora Cloud]     [Kernel]     [Fedora Legacy]     [Fedora Packaging]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Red Hat 9]     [Gimp]     [Yosemite News]

  Powered by Linux