googlefonts / fontmake

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

Error when building Designspace 5 file with a discrete axis, 2 fonts (roman and italic) #1112

Open guidoferreyra opened 1 month ago

guidoferreyra commented 1 month ago

When I try to build the designspace file I get the following:

INFO:fontTools.varLib:Merging OpenType Layout tables
fontmake: Error: In 'MyFont.designspace': Generating fonts from Designspace failed: 

Couldn't merge the fonts, because the glyph order was inconsistent between
masters. This happened while performing the following operation:
GPOS.table.LookupList.Lookup[0]

Both fonts, roman and italic builds correctly when doing it separately, is it required that both set of sources have the same glyphorder?

This is how it looks the Dspace file, any idea what I’m doing wrong?

<?xml version='1.0' encoding='UTF-8'?>
<designspace format="5.0">
  <axes elidedfallbackname="Regular">
    <axis tag="wght" name="Weight" minimum="100" maximum="800" default="100">
      <map input="100" output="1"/>
      <map input="200" output="125"/>
      <map input="300" output="303"/>
      <map input="400" output="490"/>
      <map input="500" output="643"/>
      <map input="600" output="725"/>
      <map input="700" output="833"/>
      <map input="800" output="1000"/>
      <labels>
        <label uservalue="100" name="Thin"/>
        <label uservalue="200" name="Extralight"/>
        <label uservalue="300" name="Light"/>
        <label uservalue="400" name="Regular" linkeduservalue="700" elidable="true"/>
        <label uservalue="500" name="Medium"/>
        <label uservalue="600" name="Semibold"/>
        <label uservalue="700" name="Bold"/>
        <label uservalue="800" name="ExtraBold"/>
      </labels>
    </axis>
    <axis tag="ital" name="Italic" values="0 1" default="0">
      <labels ordering="2">
        <label uservalue="0" name="Roman" elidable="true"  linkeduservalue="1"/>
        <label uservalue="1" name="Italic"/>
      </labels>
    </axis>
  </axes>
  <sources>
    <source filename="MyFont-Thin.ufo" familyname="My Font" stylename="Thin">
      <location>
        <dimension name="Weight" xvalue="1"/>
        <dimension name="Italic" xvalue="0"/>
      </location>
    </source>
    <source filename="MyFont-Medium.ufo" familyname="My Font" stylename="Medium">
      <location>
        <dimension name="Weight" xvalue="643"/>
        <dimension name="Italic" xvalue="0"/>
      </location>
    </source>
    <source filename="MyFont-Extrabold.ufo" familyname="My Font" stylename="Extrabold">
      <location>
        <dimension name="Weight" xvalue="1000"/>
        <dimension name="Italic" xvalue="0"/>
      </location>
    </source>

    <source filename="MyFont-ThinItalic.ufo" familyname="My Font" stylename="Thin Italic">
      <location>
        <dimension name="Weight" xvalue="1"/>
        <dimension name="Italic" xvalue="1"/>
      </location>
    </source>
    <source filename="MyFont-MediumItalic.ufo" familyname="My Font" stylename="Medium Italic">
      <location>
        <dimension name="Weight" xvalue="643"/>
        <dimension name="Italic" xvalue="1"/>
      </location>
    </source>
    <source filename="MyFont-ExtraboldItalic.ufo" familyname="My Font" stylename="Extrabold Italic">
      <location>
        <dimension name="Weight" xvalue="1000"/>
        <dimension name="Italic" xvalue="1"/>
      </location>
    </source>
  </sources>

  <variable-fonts>
    <variable-font name="MyFontVariable-Roman">
      <axis-subsets>
        <axis-subset name="Weight"/>
        <axis-subset name="Italic" uservalue="0"/>
      </axis-subsets>
    </variable-font>
    <variable-font name="MyFontVariable-Italic">
      <axis-subsets>
        <axis-subset name="Weight"/>
        <axis-subset name="Italic" uservalue="1"/>
      </axis-subsets>
    </variable-font>
  </variable-fonts>
</designspace>
guidoferreyra commented 1 month ago

cc @belluzj (sorry for @ you) :)

belluzj commented 1 month ago

Would you be able to send the font (privately if needed) so I can run the debugger?

guidoferreyra commented 1 month ago

Yes, could you please give me your email address?