bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#59347: 29.0.50; `:family` face setting ignored


From: Gregory Heytings
Subject: bug#59347: 29.0.50; `:family` face setting ignored
Date: Mon, 21 Nov 2022 14:48:59 +0000


Also, AFAIU, a font whose weight == spec_prop[weight] is in principle preferred to a font whose weight != spec_prop[weight]. However, a font whose weight != spec_prop[weight] could in practice be preferred to a font whose weight == spec_prop[weight] when it is a better match according to the other sorting criteria (size and width, and possibly type and slant). How could (and why should) this be changed to make sure that the scoring will not sometimes prefer the medium weight when the regular weight exists?

I thought the answer to your question would be "adjust the scoring such that what we don't want to happen, doesn't".

One way of doing that is by boosting the score when there's an exact match in attributes which we consider "more equal than others". I guess weight is one of them, and perhaps the only one.


Hmmm... AFAIU that's already the case: when there's an exact match (e.g. we're expecting a medium font and the font is medium) the weight field for that font is 0, and when there's an inexact match (e.g. we're expecting a medium font and the font is regular) we store the difference between the two weights (which is 20 in this case) in the weight field.

It does not seem possible (at least not without adding a lot of complexity) inside font_score to know that the font only has a medium variant and that if we're expecting a regular font, we should therefore consider that the font is an exact (or "less inexact than if the font had a regular variant") match. And, even if we don't do that, in that case and similar ones a medium variant will be better scored than a semi-bold or semi-light one.

All in all, it seems to me that we should not change font_score now.


Btw, another conceptual issue I have with your patch is that it treats 'medium' and 'regular' asymmetrically (AFAIU): if we see 'medium', we also consider 'normal', but not vice versa. Why the asymmetry? why not always consider the other when we see the one?


That's correct, indeed. The reason (which is perhaps not convincing enough?) is that fonts with an explicit 'medium' variant are less common than fonts with an explicit 'normal' variant. So if we're trying to find a 'normal' font, the likelihood that a 'medium' font would be a better match than a 'normal' font is low.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]