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.

[varLib] 2D designspace with 6 masters creates wrong var font

See original GitHub issue

The enclosed designspace contains two axes, “FOOO” and “BARR”. There are masters at all four corners, as well as intermediate masters in the middle of the “BARR” axis at both “FOOO” master positions.

At FOOO=0 all is well. At FOOO=1, the resulting shape at BARR=0.5 is wrong, and does not match the master at that position.

Below is the complete gvar.

What is curious is that the FOOO=0 BARR=1 delta location is given as:

        <coord axis="BARR" max="1.0" min="0.5" value="1.0"/>

yet the FOOO=1 BARR=1 delta location is given as:

        <coord axis="FOOO" value="1.0"/>
        <coord axis="BARR" value="1.0"/>

Note the missing (and therefore different) min and max values for “BARR”.

  <gvar>
    <version value="1"/>
    <reserved value="0"/>
    <glyphVariations glyph="uni0041">
      <tuple>
        <coord axis="FOOO" value="1.0"/>
        <delta pt="0" x="50" y="-233"/>
        <delta pt="1" x="-233" y="-50"/>
        <delta pt="2" x="-50" y="233"/>
        <delta pt="3" x="233" y="50"/>
        <delta pt="4" x="0" y="0"/>
        <delta pt="5" x="0" y="0"/>
        <delta pt="6" x="0" y="233"/>
        <delta pt="7" x="0" y="233"/>
      </tuple>
      <tuple>
        <coord axis="BARR" max="1.0" min="0.0" value="0.5"/>
        <delta pt="0" x="300" y="-21"/>
        <delta pt="1" x="229" y="-50"/>
        <delta pt="2" x="200" y="21"/>
        <delta pt="3" x="271" y="50"/>
        <delta pt="4" x="0" y="0"/>
        <delta pt="5" x="0" y="0"/>
        <delta pt="6" x="0" y="21"/>
        <delta pt="7" x="0" y="21"/>
      </tuple>
      <tuple>
        <coord axis="BARR" max="1.0" min="0.5" value="1.0"/>
        <delta pt="0" x="500" y="0"/>
      </tuple>
      <tuple>
        <coord axis="FOOO" value="1.0"/>
        <coord axis="BARR" max="1.0" min="0.0" value="0.5"/>
        <delta pt="0" x="190" y="64"/>
        <delta pt="1" x="64" y="-190"/>
        <delta pt="2" x="-190" y="-64"/>
        <delta pt="3" x="-64" y="190"/>
        <delta pt="4" x="0" y="0"/>
        <delta pt="5" x="0" y="0"/>
        <delta pt="6" x="0" y="-64"/>
        <delta pt="7" x="0" y="-64"/>
      </tuple>
      <tuple>
        <coord axis="FOOO" value="1.0"/>
        <coord axis="BARR" value="1.0"/>
        <delta pt="0" x="0" y="-125"/>
        <delta pt="1" x="-125" y="0"/>
        <delta pt="2" x="0" y="125"/>
        <delta pt="3" x="125" y="0"/>
        <delta pt="4" x="0" y="0"/>
        <delta pt="5" x="0" y="0"/>
        <delta pt="6" x="0" y="125"/>
        <delta pt="7" x="0" y="125"/>
      </tuple>
    </glyphVariations>
  </gvar>

If I manually edit the TTX so that last delta location contains min and max for BARR, to match the other BARR=1 delta location, and recompile, I get a font that works as expected.

fonttools-bug-report.zip

Cc. @thundernixon

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
behdadcommented, Jun 16, 2018

Ok, fixed. Sorry about that again.

0reactions
justvanrossumcommented, Jun 18, 2018

Yes, thanks, @behdad!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Common confusion: why can't a designspace set axis defaults ...
Here's my best guess: it's logical that the default of each axis must be in a source, because... Variable fonts work by adding...
Read more >
Error when exporting variable font's italic instances - Glyphs
That is normal. Masters are used to create the Designspace of VaribleFont. Actually with two masters you can only export a variable font...
Read more >
Designspace Theory - Superpolator
This text is an introduction to designspace construction. ... The FontTools / varlib interpreter will try to fold everything into a variable font....
Read more >
Visualizing design space in variable fonts - Alphabettes
We are creating two things at once: a tool for selecting the instances in our variable font, and a visual representation of the...
Read more >
Working with multiple masters - TypeDrawers
Importantly, variable fonts place few limitations on the placement of masters in the design space. However, due to the math of vector ...
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