feat(universal/fsselection_wws): check fsSelection bit for WWS is set correctly + unittest#578
feat(universal/fsselection_wws): check fsSelection bit for WWS is set correctly + unittest#578
Conversation
|
I'm not sure but I don't think this is the correct approach. The WWS bit should be set if the font only varies by weight, width and/or slope; it's not just a matter of checking for name IDs 21/22. A family with names:
and without the WWS bit should pass this test - it is not "consistent with a weight/width/slope family", so the bit should not be set; in your implementation it will fail. I think we need to inspect the names themselves, and that gets complicated - possibly too complicated to implement. "Bold" would be OK but also so would "Fett". |
|
You're right, but I would like to argue, that almost all fonts from today fit into the specifications and therefore should have set the WWS bit. Only the non-standard fonts (your example with 'Family Leaded') should not have set this bit. So, in most of the cases this test would help people. Even though it's not 100% precise, it handles most common cases. Quote fom OT Spec: |
|
OK, then we'll put it in the universal profile since it's not strictly following the OT spec. |
Good idea. I'll take care if it. |
|
@simoncozens I made it a new check "universal/fsselection_wws". |
968f45b to
18a5295
Compare
… correctly + unittest
18a5295 to
6517469
Compare
|
I guess I now understand the issue. There are a couple fontbakery tests failing, because they always expect only one specific bit to be set, but fsSelection can have multiple bits set. If this is the case the unittests do not work properly anymore, am I right? So, this WWS check requires a rework of multiple unittests :( |
Description
Relates to issue #577
Checks if the fsSelection bit for WWS is set correctly, according to OpenType spec:
https://learn.microsoft.com/en-us/typography/opentype/spec/os2#fsselection
If no NID 21 and 22, WWS bit should be set.
I have set it to warning, because I think it's not critical.
Checklist
CHANGELOG.md