googlefonts / gftools

Misc tools for working with the Google Fonts library
Apache License 2.0
242 stars 71 forks source link

[builder] Duplicate ital axis in STAT after new splitter #976

Closed yanone closed 3 months ago

yanone commented 3 months ago

Please see my fork of Mona Sans which has an updated config.yaml (saves to /googlefonts, ital axis instead of slnt).

The new ital splitter works great, in some ways better than plain varlib.instancer in how it handles the fvar instances.

But Mona Sans now shows two ital axes in STAT, which I assume is a bug.

Both Italic and Roman show a similar behaviour, except that the Italic says Italic in the first screenshot instead of (Roman)

Bildschirmfoto 2024-06-06 um 16 10 06 Bildschirmfoto 2024-06-06 um 16 10 01

simoncozens commented 3 months ago

OK, it looks like gftools-gen-stat is adding the second STAT ital axis.

$ ttx -o - -t STAT googlefonts/variable/MonaSans-Italic\[wdth,wght\].ttf | grep Italic | grep Axis
Dumping "googlefonts/variable/MonaSans-Italic[wdth,wght].ttf" to "<stdout>"...
Dumping 'STAT' table...
        <AxisNameID value="265"/>  <!-- Italic -->

OK so far, but then...

$ gftools-gen-stat --src stat.yml googlefonts/variable/*ttf
Saving font to googlefonts/variable/MonaSans-Italic[wdth,wght].ttf.fix
Saving font to googlefonts/variable/MonaSans[wdth,wght].ttf.fix
$ noglob ttx -o - -t STAT googlefonts/variable/MonaSans-Italic[wdth,wght].ttf.fix | grep Italic | grep Axis
Dumping "googlefonts/variable/MonaSans-Italic[wdth,wght].ttf.fix" to "<stdout>"...
Dumping 'STAT' table...
        <AxisNameID value="268"/>  <!-- Italic -->
        <AxisNameID value="268"/>  <!-- Italic -->
simoncozens commented 3 months ago

I'll fix the problem in gftools, but the fix will be to make it exit with an error ital axis should not appear in stat config. So please remove the ital axis from your config. :-)

yanone commented 3 months ago

Removing works indeed. Thank you.