[Fontconfig] Why does family under `Best score` differ from that under the preceding `Match Pattern`?
kynnjo at gmail.com
Mon Mar 7 02:22:09 UTC 2016
On Sun, Mar 6, 2016 at 6:52 PM, Raimund Steger <rs at mytum.de> wrote:
> On Sun, 6 Mar 2016 17:58:04 -0500
> Kynn Jones <kynnjo at gmail.com> wrote:
>> Nevertheless, for some applications, like VirtualBox and VLC, instead
>> of Terminus, what I get is TeX Gyre Chorus, everywhere. (It's a bug
>> with a sense of humor.)
>> I tried running, e.g. VirtualBox, with `FC_EDIT=1`. I include the
>> debugging output at the end of this post, but, in a nutshell, what I
>> see in this output are `Match Pattern` sections where the family is
>> listed as `Terminus` followed by `Best score` sections where the
>> family is listed as `TeX Gyre Chorus`.
> If you run with FC_DEBUG=3, you get the scores for all candidates, not just the best one. Then you can figure out where in the score vector is Terminus worse than TeX Gyre Chorus and find out the corresponding fontconfig property by looking at _FcMatcherPriority in fcmatch.c.
> But maybe that's not even necessary. Only the following properties have higher priority than strong family: file, fontformat, scalable, color, foundry, charset. Of these, only 'scalable' occurs in the pattern in your case as far as I can tell so it should be a good candidate. (Some people might wonder why 'scalable' has higher priority than strong family as the latter normally indicates a deliberate user preference, but let's keep that aside :-P)
> To find out whether that's added to your pattern by a config rule or not, you could try FC_DEBUG=4 which traces all config rule applications. If it's not set by a config rule that is in a file after position 50, you can just set it to "false" in your user config.
Thank you for your comments and suggestions.
I'm stymied by my inability to interpret most of the debugging output
(so the probability that what I write below is wrong is quite high).
*As far as I can tell*, these are the scores for Terminus and TeX Gyre
Chorus (I've added whitespace to make the vector components more
TeX Gyre Chorus 0 0 0 1 0 0 1001 0 1 1002 0 0 0 0 1 1 1 1 0 0
Terminus 0 0 0 1001 0 0 1 0 1 1002 0 0 1 0 1 100001 1 1 0 0
Supposedly the score for `TeX Gyre Chorus` is the better one, but I
cannot tell why. Nor can I tell what the various components
correspond to. I have not been able to find any documentation about
any of this.
Both score vectors ave have 22 components, AFAICT `_FcMatcherPriority`
has 25 components:
Be that as it may, out of desperation, I tried changing my
`fonts.conf` to this (based on one of your suggestions):
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<edit name="family" mode="assign" binding="strong">
<edit name="scalable" mode="assign" binding="strong">
Lo and behold! It worked!
I have *absolutely no idea* why.
Thank you all the same!
More information about the Fontconfig