googlefonts / glyphsLib

A bridge from Glyphs source files (.glyphs) to UFOs
Apache License 2.0
182 stars 52 forks source link

Why mappings are added for wdth? #836

Open guidoferreyra opened 1 year ago

guidoferreyra commented 1 year ago

I have a font with wdth axis from 55 to 100. When converting the glyphs file to ufo + designspace it maps the min from 55 to 62.5 why is this?

from the resulting dspace

<axis tag="wdth" name="Width" minimum="62.5" maximum="100" default="62.5">
      <map input="62.5" output="55"/>
      <map input="75" output="70"/>
      <map input="87.5" output="85"/>
      <map input="100" output="100"/>
</axis>

Plase find a test glyhph attached wdthTest.glyphs.zip

Thanks!

HugoJourdan commented 1 year ago

I think it used usWidthClass. https://learn.microsoft.com/en-us/typography/opentype/otspec183/os2#uswidthclass

Input values in your seems to follow OpenType spec.

guidoferreyra commented 1 year ago

Hi Hugo, thanks, you're right! I'm not entirely sure if it's correct for glyphsLIb to do these assignments by default, since the width axis specification doesn't specify fixed values for the instances and also building the same file from Glyphs App doesn’t do it either. I’m curious to know more about the reason for this.

schriftgestalt commented 1 year ago

I don’t like this very much. There is a proper way to define axis mappings. And the algorithm depends on a very specific instance setup (you need an instance on each masters location). That seems fragile even for me (it fails with several of my files) as someone who likes a good shortcut here and there.