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.

Update varLib to current designspace spec

See original GitHub issue

@behdad, does varLib need to be updated to implement the current designspace spec? When building a variable font for Noto Sans Cherokee with fontmake, varLib crashes like this:

  File "/home/sascha/src/fontmake/Lib/fontmake/font_project.py", line 200, in build_variable_font
    font, _, _ = varLib.build(designspace_path, finder)
  File "/home/sascha/src/fontmake/env/src/fonttools/Lib/fontTools/varLib/__init__.py", line 380, in build
    model = models.VariationModel(master_locs)
  File "/home/sascha/src/fontmake/env/src/fonttools/Lib/fontTools/varLib/models.py", line 137, in __init__
    keyFunc = self.getMasterLocationsSortKeyFunc(locations, axisOrder=axisOrder)
  File "/home/sascha/src/fontmake/env/src/fonttools/Lib/fontTools/varLib/models.py", line 148, in getMasterLocationsSortKeyFunc
    assert {} in locations, "Base master not found."
AssertionError: Base master not found.

When compiling NotoSansCherokee, the locations variable has the value [{u'wght': -1.0}, {u'wght': -1.0}, {u'wght': -0.7}], which seems a bit surprising given the generated designspace:

<?xml version='1.0' encoding='utf-8'?>
<designspace format="3">
    <axes>
        <axis default="400" maximum="900.0" minimum="100.0" name="weight" tag="wght">
            <map input="100.0" output="26" />
            <map input="200.0" output="39" />
            <map input="300.0" output="58" />
            <map input="400.0" output="90" />
            <map input="500.0" output="108" />
            <map input="600.0" output="128" />
            <map input="700.0" output="151" />
            <map input="800.0" output="169" />
            <map input="900.0" output="190" />
            <labelname xml:lang="en">Weight</labelname>
        </axis>
    </axes>
    <sources>
        <source familyname="Noto Sans Cherokee" filename="NotoSansCherokee-Light.ufo" name="Noto Sans Cherokee Light" stylename="Light">
            <location>
                <dimension name="weight" xvalue="26.000000" />
            </location>
        </source>
        <source familyname="Noto Sans Cherokee" filename="NotoSansCherokee-Regular.ufo" name="Noto Sans Cherokee Regular" stylename="Regular">
            <lib copy="1" />
            <groups copy="1" />
            <features copy="1" />
            <info copy="1" />
            <location>
                <dimension name="weight" xvalue="90.000000" />
            </location>
        </source>
        <source familyname="Noto Sans Cherokee" filename="NotoSansCherokee-Bold.ufo" name="Noto Sans Cherokee Bold" stylename="Bold">
            <location>
                <dimension name="weight" xvalue="190.000000" />
            </location>
        </source>
    </sources>
    <instances>
        <instance familyname="Noto Sans Cherokee" filename="../instance_ufo/NotoSansCherokee-Thin.ufo" name="Noto Sans Cherokee Thin" stylename="Thin">
            <location>
                <dimension name="weight" xvalue="26.000000" />
            </location>
            <info />
            <kerning />
        </instance>
        <instance familyname="Noto Sans Cherokee" filename="../instance_ufo/NotoSansCherokee-ExtraLight.ufo" name="Noto Sans Cherokee ExtraLight" stylename="ExtraLight">
            <location>
                <dimension name="weight" xvalue="39.000000" />
            </location>
            <info />
            <kerning />
        </instance>
        <instance familyname="Noto Sans Cherokee" filename="../instance_ufo/NotoSansCherokee-Light.ufo" name="Noto Sans Cherokee Light" stylename="Light">
            <location>
                <dimension name="weight" xvalue="58.000000" />
            </location>
            <info />
            <kerning />
        </instance>
        <instance familyname="Noto Sans Cherokee" filename="../instance_ufo/NotoSansCherokee-Regular.ufo" name="Noto Sans Cherokee Regular" stylename="Regular">
            <location>
                <dimension name="weight" xvalue="90.000000" />
            </location>
            <info />
            <kerning />
        </instance>
        <instance familyname="Noto Sans Cherokee" filename="../instance_ufo/NotoSansCherokee-Medium.ufo" name="Noto Sans Cherokee Medium" stylename="Medium">
            <location>
                <dimension name="weight" xvalue="108.000000" />
            </location>
            <info />
            <kerning />
        </instance>
        <instance familyname="Noto Sans Cherokee" filename="../instance_ufo/NotoSansCherokee-SemiBold.ufo" name="Noto Sans Cherokee SemiBold" stylename="SemiBold">
            <location>
                <dimension name="weight" xvalue="128.000000" />
            </location>
            <info />
            <kerning />
        </instance>
        <instance familyname="Noto Sans Cherokee" filename="../instance_ufo/NotoSansCherokee-Bold.ufo" name="Noto Sans Cherokee Bold" stylename="Bold">
            <location>
                <dimension name="weight" xvalue="151.000000" />
            </location>
            <info />
            <kerning />
        </instance>
        <instance familyname="Noto Sans Cherokee" filename="../instance_ufo/NotoSansCherokee-ExtraBold.ufo" name="Noto Sans Cherokee ExtraBold" stylename="ExtraBold">
            <location>
                <dimension name="weight" xvalue="169.000000" />
            </location>
            <info />
            <kerning />
        </instance>
        <instance familyname="Noto Sans Cherokee" filename="../instance_ufo/NotoSansCherokee-Black.ufo" name="Noto Sans Cherokee Black" stylename="Black">
            <location>
                <dimension name="weight" xvalue="190.000000" />
            </location>
            <info />
            <kerning />
        </instance>
    </instances>
</designspace>

I won’t be able to fix this during the coming days (need to prepare for a Google committee; then a full day of committee meetings; then there’s the Easter holiday in Switzerland). So it would be great if @behdad or somebody else could look into this.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:37 (23 by maintainers)

github_iconTop GitHub Comments

4reactions
LettErrorcommented, Apr 13, 2017

To be honest, I find this requirement the weakest part of the specification. Looking at https://github.com/googlei18n/fontmake/issues/167, @brawer summarizes: For example, Light must be at wght=300, Regular at wght=400, Black at wght=900. — this is going to be very difficult to enforce.

  • Whether or not a typeface can map to these numbers this depends on its design. In order for the font not to be on spec it would be enough for someone could have to look and say “that’s not regular at all”.
  • What if the designspace only has a thin and bold, the spec would then state that whatever is at 400 is the regular. This is not necessarily the right weight.
  • Weight progression is curved, even in linear interpolation between 2 masters.
  • Using avar to correct for this is unwanted: avar is to expose certain areas of an axis at a different rate, for instance, gulp, for sliders. It is not intended to correct for realities in a particular typeface and the expectation of the spec.
  • Regardless of what the spec says, there are going to be many different typefaces expressing many ideas about how weight grows, using the full range of this axis. We might as well start preparing for it.
  • As I understand, this requirement is motivated by a desire to have some interoperability between different fonts, so that if one is missing, another might have a reasonable replacement weight. As a typographer I have my reservations about how useful this is.
  • I think the bottom line is the OpenType spec should not make any normative statements on the design of typefaces. I recommend reconsidering this.
1reaction
behdadcommented, Apr 13, 2017

That normakuzation is just multiplication and addition applied to all coordinates the same way, per axis

Really, that’s exactly what my code does…

Read more comments on GitHub >

github_iconTop Results From Across the Web

designspaceLib: Read, write, and edit designspace files
Implements support for reading and manipulating designspace files. Allows the users to define axes, rules, sources, variable fonts and instances, and their ...
Read more >
How do I find the current version of Design Space?
You can find the steps for each platform through the steps below: Note: The actual version number will change regularly as updates are...
Read more >
Desktop Cricut Design Space Updates: October 2022
Cricut often makes changes and upgrades to the Cricut Design Space software. Here is a history of Cricut Design Space updates!
Read more >
Designspace Theory - Superpolator
It defines the dimensions in which the typeface developes, for instance “weight”, “width”, or other things. A designspace also stores information about the ......
Read more >
New Features in Cricut Design Space Update v7.5 ... - YouTube
Is the third time a charm for Design Space for Desktop Updates ? Version 7.5 was released on March 28. DId they get...
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