question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Empty name entry generated if elidable="true" in Designspace v5 <label>

See original GitHub issue

Context

I’m building a family that has two variable fonts: a roman and an italic, each with 5 weight instances.

I’m using Designspace version 5.0 to setup both subfamilies in one document, including STAT information. This is amazing, and FontMake is handling it wonderfully overall.

I have a labels element set up in my Weight axis, which is built into a STAT table that looks good. Here’s from my designspace:

  <axes>
    <axis tag="wght" name="Weight" minimum="300" maximum="700" default="300">
      <map input="300" output="0"/>
      <map input="400" output="230"/>
      <map input="500" output="420"/>
      <map input="600" output="543"/>
      <map input="700" output="668"/>
      <labels>
        <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" />
      </labels>
    </axis>
    <axis name="Italic" tag="ital" default="0" values="0 1">
        <labels>
            <label uservalue="0" name="Roman" elidable="true" />
            <label uservalue="1" name="Italic" />
        </labels>
    </axis>
  </axes>

This results in a STAT table that seems to look great, including this entry for the Regular weight instance:

    <AxisValue index="1" Format="3">
        <AxisIndex value="0"/>
        <Flags value="2"/>  <!-- ElidableAxisValueName -->
        <ValueNameID value="280"/>  <!-- Regular -->
        <Value value="400.0"/>
        <LinkedValue value="700.0"/>
      </AxisValue>

In my Designspace, I’m specifying two variable fonts:

  <variable-fonts>
    <variable-font name="Familyname-Variable">
        <axis-subsets>
            <axis-subset name="Weight"/>
            <axis-subset name="Italic" uservalue="0"/>
        </axis-subsets>
    </variable-font>
    <variable-font name="FamilynameItalic-Variable">
        <axis-subsets>
            <axis-subset name="Weight"/>
            <axis-subset name="Italic" uservalue="1"/>
        </axis-subsets>
    </variable-font>
  </variable-fonts>

However, I may have found one glitch.

Problem

If I include elidable="true" in the label element for the Regular instance at 400, an empty entry appears in the resulting font’s name table:

    <namerecord nameID="270" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Light
    </namerecord>
    <namerecord nameID="271" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Familyname-Light
    </namerecord>
    <namerecord nameID="272" platformID="1" platEncID="0" langID="0x0" unicode="True">
      
    </namerecord>
    <namerecord nameID="273" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Familyname-Regular
    </namerecord>
    <namerecord nameID="274" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Medium
    </namerecord>
    <namerecord nameID="275" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Familyname-Medium
    </namerecord>
    <namerecord nameID="276" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Semibold
    </namerecord>
    <namerecord nameID="277" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Familyname-Semibold
    </namerecord>
    <namerecord nameID="278" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Bold
    </namerecord>
    <namerecord nameID="279" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Familyname-Bold
    </namerecord>

Further, the fvar table looks like this (notice the missing <!-- Regular --> comment – this is copied directly from a ttx output):

  <fvar>

    <!-- Weight -->
    <Axis>
      <AxisTag>wght</AxisTag>
      <Flags>0x0</Flags>
      <MinValue>300.0</MinValue>
      <DefaultValue>300.0</DefaultValue>
      <MaxValue>700.0</MaxValue>
      <AxisNameID>269</AxisNameID>
    </Axis>

    <!-- Light -->
    <!-- PostScript: Familyname-Light -->
    <NamedInstance flags="0x0" postscriptNameID="271" subfamilyNameID="270">
      <coord axis="wght" value="300.0"/>
    </NamedInstance>
    <!-- PostScript: Familyname-Regular -->
    <NamedInstance flags="0x0" postscriptNameID="273" subfamilyNameID="272">
      <coord axis="wght" value="400.0"/>
    </NamedInstance>

    <!-- Medium -->
    <!-- PostScript: Familyname-Medium -->
    <NamedInstance flags="0x0" postscriptNameID="275" subfamilyNameID="274">
      <coord axis="wght" value="500.0"/>
    </NamedInstance>

    <!-- Semibold -->
    <!-- PostScript: Familyname-Semibold -->
    <NamedInstance flags="0x0" postscriptNameID="277" subfamilyNameID="276">
      <coord axis="wght" value="600.0"/>
    </NamedInstance>

    <!-- Bold -->
    <!-- PostScript: Familyname-Bold -->
    <NamedInstance flags="0x0" postscriptNameID="279" subfamilyNameID="278">
      <coord axis="wght" value="700.0"/>
    </NamedInstance>
  </fvar>

If I simply remove the elidable attribute from the Regular label, name 272 changes to Regular, and the fvar table outputs in an expected way.

    <!-- Regular -->
    <!-- PostScript: Familyname-Regular -->
    <NamedInstance flags="0x0" postscriptNameID="273" subfamilyNameID="272">
      <coord axis="wght" value="400.0"/>
    </NamedInstance>
    <namerecord nameID="272" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Regular
    </namerecord>
    <namerecord nameID="273" platformID="1" platEncID="0" langID="0x0" unicode="True">
      Familyname-Regular
    </namerecord>

In FontBakery, including elidable="true" in the designspace label triggers the following FAILs (these don’t happen without elidable="true"):

🔥 FAIL: Check name table for empty records. (com.adobe.fonts/check/name/empty_records)<div>

Check the name table for empty records, as this can cause problems in Adobe apps.

  • 🔥 FAIL “name” table record with key=(1, 0, 0, 272) is empty and should be removed. [code: empty-record]
  • 🔥 FAIL “name” table record with key=(3, 1, 1033, 272) is empty and should be removed. [code: empty-record]
</div>
🔥 FAIL: The variable font 'wght' (Weight) axis coordinate must be 400 on the 'Regular' instance. (com.google.fonts/check/varfont/regular_wght_coord)<div>

According to the Open-Type spec’s registered design-variation tag ‘wght’ available at https://docs.microsoft.com/en-gb/typography/opentype/spec/dvaraxistag_wght

If a variable font has a ‘wght’ (Weight) axis, then the coordinate of its ‘Regular’ instance is required to be 400.

  • 🔥 FAIL The “wght” axis coordinate of the “Regular” instance must be 400. Got None instead. [code: wght-not-400]
</div>

Expectation

As far as I understand it, the only change I should expect from including elidable="true" should be a flag in the AxisValue entry of the STAT table. Indeed, this does work well for the STAT table.

…but I doubt it should create the empty name table entry.

Perhaps making Regular elidable isn’t actually necessary, or expected on FontMake’s end? I don’t get FontBakery fails when I don’t set the elidable flag, even though I was under the impression that it was a good flag to set for the Regular instance. For now, I will skip it.

If I am doing something wrong, I will very much appreciate learning about it! Otherwise, hopefully this helps improve FontMake a little further.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
anthrotypecommented, Nov 1, 2022

a link would suffice, thank you

1reaction
anthrotypecommented, Nov 1, 2022

it does look like a bug in fonttools designspaceLib or varLib, we should move/file this over there, fontmake is simply handing off the designspace to varLib when making the STAT table.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Make labels with Cricut — Easy How-To Instructions with video
Make labels with Cricut! These easy DIY labels are a great way to organize your pantry, jars, home, and other parts of your...
Read more >
Cricut Cut Out Address Labels - Knitting House Square
Cricut Tutorial: How to Make Cut Out Address Labels ... Reformat each label so there is empty space on the left side of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found