Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New check: STAT tables in static fonts #4149

Closed
1 task done
simoncozens opened this issue May 26, 2023 · 2 comments
Closed
1 task done

New check: STAT tables in static fonts #4149

simoncozens opened this issue May 26, 2023 · 2 comments
Assignees
Labels
New check proposal We expect new check proposals to include a detailed rationale description and a suggested check-id
Milestone

Comments

@simoncozens
Copy link
Collaborator

What needs to be checked?

Static instances need different stuff in their STAT tables to variable fonts. Fontbakery should tell us if a "variable" STAT table has ended up in a static instance.

Detailed description of the problem

Adobe feature syntax allows for the definition of a STAT table. Fonts built with a hand-coded STAT table in feature syntax may be built either as static or variable, but will end up with the same STAT table. This is a problem, because a STAT table which works on variable fonts will not be appropriate for static instances. The examples in the OT spec of non-variable fonts with a STAT table show that the table entries must be restricted to those entries which refer to the static font's position in the designspace. i.e. a Regular weight static should only have the following entry for the weight axis:

        <AxisIndex value="0"/>
        <Flags value="2"/>  <!-- ElidableAxisValueName -->
        <ValueNameID value="265"/>  <!-- Regular -->
        <Value value="400.0"/>

However, if the STAT table intended for a variable font is compiled into a static, it will have many entries for this axis. In this case, Windows will read the first entry only, causing all instances to report themselves as "Thin Condensed".

Optional fix

Just drop the STAT table from the static.

Resources and exact process needed to replicate

notofonts/latin-greek-cyrillic#429

Expected Profile

  • Universal (broadly accepted best practices on the type design community)

This'll mess you up on Windows if you get it wrong.

Expected Result

Fontbakery should:

  • WARN if a non-variable font has a STAT table at all, since they're a pretty rare thing and you're almost certainly better off without them (just rely on WWS/style linking).
  • FAIL if a non-variable font has more than one AxisValue per axis.

Severity assessment

4

@simoncozens simoncozens added the New check proposal We expect new check proposals to include a detailed rationale description and a suggested check-id label May 26, 2023
@felipesanches felipesanches self-assigned this May 26, 2023
@felipesanches felipesanches added this to the 0.8.12 milestone May 26, 2023
@felipesanches
Copy link
Collaborator

I'm starting to work on this one now.

felipesanches added a commit to felipesanches/fontbakery that referenced this issue May 26, 2023
Added to the Universal Profile
com.google.fonts/check/STAT_in_statics
Static fonts with more than a single entry per design axis cause trouble on Windows
(issue fonttools#4149)
felipesanches added a commit to felipesanches/fontbakery that referenced this issue May 26, 2023
Added to the Universal Profile
com.google.fonts/check/STAT_in_statics
Static fonts with more than a single entry per design axis cause trouble on Windows
(issue fonttools#4149)
felipesanches added a commit to felipesanches/fontbakery that referenced this issue May 26, 2023
Added to the Universal Profile
com.google.fonts/check/STAT_in_statics
Static fonts with more than a single entry per design axis cause trouble on Windows
(issue fonttools#4149)
felipesanches added a commit that referenced this issue May 26, 2023
Added to the Universal Profile
com.google.fonts/check/STAT_in_statics
Static fonts with more than a single entry per design axis cause trouble on Windows
(issue #4149)
@felipesanches
Copy link
Collaborator

The new check was implemented at PR #4151 not including the suggested WARN on the mere presence of a STAT table on static fonts because @Lorp suggested in a conversation that having the STAT table would actually be desirable. Also @twardoch presented some ideas about this topic on a private conversation.

I am closing this issue, and encourage others to open a separate one in case further changes (like the proprosed WARN) are still needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New check proposal We expect new check proposals to include a detailed rationale description and a suggested check-id
Projects
None yet
Development

No branches or pull requests

2 participants