[Fontconfig] Further details on font ranking

Kévin Le Gouguec kevin.legouguec at gmail.com
Fri Jan 14 17:46:58 UTC 2022


Akira TAGOH <akira at tagoh.org> writes:

>> (3) Given two files that define the same font, say
>>
>>     - /usr/share/fonts/truetype/foo.ttf: installed by the distro,
>>       lagging wrt its upstream developer,
>>
>>     - ~/.local/share/fonts/foo.ttf: installed by the user, latest
>>       version from upstream,
>>
>>     how will FcFontMatch, FcFontSort and FcFontList sort these files?
>>     Empirically, it seems that FcFontMatch and FcFontSort rank the
>>     user's file higher than the distro's, but I have no idea whether
>>     that's due to (a) the directory order in fonts.conf, (b) the font's
>>     :version attribute, (c) the font's coverage, (d) another
>>     well-defined quality of the font, or (e) sheer dumb luck.
>
> The latest one has a priority. It is measured by FC_FONTVERSION.  If
> both are the same, it is up to the order of <dir> elements. the first
> one has a priority.

Good to know!  Is this by design (and did I miss the design document),
or is this a corner case that Fontconfig might decide to handle
differently someday?

> Hope that helps,

Tremendously so; thanks!


More information about the Fontconfig mailing list