googlefonts / fontmake

Compile fonts from sources (UFO, Glyphs) to binary (OpenType, TrueType).
Apache License 2.0
757 stars 94 forks source link

FontMake seems to be rounding axis locations for width axis, when 'Axis Location' params are used in Glyphs sources #1107

Open arrowtype opened 1 month ago

arrowtype commented 1 month ago

I have a weight & width family with Glyphs sources, and I’m building variable fonts with FontMake.

I am using Axis Location custom parameters in Masters and Exports, which is the recommended way to set up axis mapping in exported variable fonts. It usually works great!

I have instances like "SemiCondensed Bold" that have a Width value of 87.5.

If I export directly from GlyphsApp, these floating-point width values make it into the output font’s fvar table.

However, if I build with fontmake, these width values get rounded down, e.g. to 87.

What’s more, I am adding a STAT table with a secondary process, and that accurately inserts 87.5 for my SemiCondensed instances, which means that the STAT and fvar tables are mismatched.

But, I’d rather find/fix the problem, rather than just change my STAT table to suit the unexpected/unintended values in fvar.

I can’t share the immediate font sources, but I can make a reproduction case, if that is vital here. Let me know.

Or, please let me know if this kind of issue is something that might be better reported in another repo. Or, if this seems like it really is just a problem in my sources, I’m definitely open to that possibility, and would be happy to learn how to improve in this regard.

As always, thank you so much for any insights here!

arrowtype commented 1 month ago

In case it helps narrow things down, outputting -o ufo yields a designspace with the following map:

  <axis tag="wdth" name="Width" minimum="50" maximum="100" default="100">
      <map input="50" output="50"/>
      <map input="62" output="63"/>
      <map input="75" output="75"/>
      <map input="87" output="88"/>
      <map input="100" output="100"/>
    </axis>

Ideally, I would want the inputs to be 62.5 and 87.5.