fonttools / fontbakery

🧁 A font quality assurance tool for everyone
https://fontbakery.readthedocs.io
Apache License 2.0
534 stars 99 forks source link

[com.google.fonts/check/fsselection] Not suitable for OpenType profile #4349

Open khaledhosny opened 7 months ago

khaledhosny commented 7 months ago

Observed behaviour

Font style is mis-detected because of “uncanonical” file names, then the checks starts FAIL’ing perfectly valid fonts:

Foo-Bold-Italic.ttf

    🔥 FAIL

    OS/2 fsSelection ITALIC bit should be unset. [code: bad-ITALIC]

Expected behaviour

Fonts should not FAIL because they have specific file names. I think any check that depends on file names (which is the case for any checks that uses style conditions, since it depends on a specific file naming scheme) should not be part of OpenType profile.

felipesanches commented 7 months ago

I think any checks that depends on file names (which is the case for any checks that uses style conditions, since it depends on a specific file naming scheme) should not be part of OpenType profile.

I agree. I'll review the codebase to see which other checks may have a similar problem. I'll try to address this for our next release.

khaledhosny commented 7 months ago

Additional checks that have the same issue:

felipesanches commented 7 months ago

This is a "source of truth" problem.

On the Google Fonts profile, the filename is the source of truth. The choice was made because the filename is one of the most explicitly evident pieces of information to a font user (no need to inspect font binary internals).

That's an arbitrary choice, though. And I agree that for a generic profile like the OpenType one (or Universal), this should not be enforced. But we need a substitute source of truth in that case. Where is the ideal source of fontstyle information that all checks will use as a reference and compare to?

khaledhosny commented 7 months ago

Ultimately it doesn't matter because the check should be checking that all relevant info agrees, and the file name is the least important (if relevant at all).

I’d go with the style name as the source of truth, since it is the most visible so less likely to be wrong. The message can be worded also to be more neutral, something like:

style name is Bold but BOLD bit it unset and ITALIC bit is set

This shows the mismatch without suggesting which piece of information is right or wrong.