Closed jazzfool closed 4 years ago
So the problem here is that we follow the CSS Fonts 3 specification, even though it seems to be nonsensical. Here are the rules in question from step 4c:
- If the desired weight is 400, 500 is checked first and then the rule for desired weights less than 400 is used.
- If the desired weight is 500, 400 is checked first and then the rule for desired weights less than 400 is used.
This seems to indicate that a specified weight of 400 really maps to 500 and that a specified weight of 500 really maps to 400. But that causes the bug here, and it seems illogical to me.
@SimonSapin Any advice?
This comes after:
if the desired weight is available that face matches. Otherwise, a weight is chosen using the rules below:
So the rule you quoted only applies when there is no exact match for weight.
My reading is that with font-weight: 400
as the computed CSS values, faces with weights 400, 500, 399, 398, …, 2, 1, 401, 402, …, 499, 501, 502, … would be matched in that order of preference.
Oh yes, thanks.
When using
select_best_match
, fonts such as Roboto get matched to Roboto Medium, even whenProperties
explicitly requests for the normal (400) weight.I have Roboto Regular installed so it should be finding that instead. Browsers seem to be matching it correctly.
OS: Windows 10 x64