Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect opsz range in Designspace file generated from Glyphs project #1002

Closed
clauseggers opened this issue May 31, 2023 · 11 comments
Closed

Comments

@clauseggers
Copy link

When I try to generate a VF from a Glyphs project, I get the following error on the Italic Glyphs file:

<axes>
  <axis tag="opsz" name="Optical size" minimum="5" maximum="120" default="120">
    <map input="5" output="5"/>
    <map input="8" output="40"/>
    <map input="12" output="60"/>
    <map input="24" output="75"/>
    <map input="42" output="90"/>
    <map input="62" output="100"/>
    <map input="88" output="110"/>
    <map input="120" output="120"/>
  </axis>
  <axis tag="wdth" name="Width" minimum="50" maximum="150" default="50"/>
  <axis tag="wght" name="Weight" minimum="400" maximum="900" default="400"/>
  <axis tag="ital" name="Italic" minimum="1" maximum="1" default="1"/>
</axes>

The opsz is given as 5–120 when it is in fact 5–1200 in the Glyphs file. I can’t find this 120 value anywhere in the Glyphs file. The Roman is set up just like the Italic, and that one does not show this error. The axes table in the Roman Designspace file is:

<axes>
  <axis tag="opsz" name="Optical size" minimum="5" maximum="1200" default="1200">
    <map input="5" output="5"/>
    <map input="6" output="200"/>
    <map input="7" output="325"/>
    <map input="8" output="400"/>
    <map input="12" output="550"/>
    <map input="16" output="640"/>
    <map input="21" output="700"/>
    <map input="32" output="800"/>
    <map input="72" output="980"/>
    <map input="96" output="1020"/>
    <map input="1200" output="1200"/>
  </axis>
  <axis tag="wdth" name="Width" minimum="50" maximum="150" default="50"/>
  <axis tag="wght" name="Weight" minimum="300" maximum="900" default="300">
    <map input="300" output="360"/>
    <map input="900" output="900"/>
  </axis>
</axes>

I can also see that the wght axis has a minimum value of 400 in the Italic and 300 in the Roman.

As far as I can see, the Roman and Italic Glyphs files are identically set up, except from the Italic having a hidden Italic axis set to 1.

If you want to see the files then they are here: https://github.com/clauseggers/Playfair/tree/master/sources

@anthrotype
Copy link
Member

It looks like you have both "Axis Mappings" custom parameter on the Font, and "Axis Location" custom parameters on the masters and instances. The two approaches are mutually exclusive, I would recommend to use the latter unless you need to add mappings for locations that are neither masters nor instances.

Ah! it looks like you did disable the "Axis Mappings" parameter, but somehow fontmake (actually glyphsLib) is still reading that.. I think that's a bug. For now, can you please just delete the disabled "Axis Mappings" and see if that works?

@clauseggers
Copy link
Author

Ah! it looks like you did disable the "Axis Mappings" parameter, but somehow fontmake (actually glyphsLib) is still reading that.. I think that's a bug. For now, can you please just delete the disabled "Axis Mappings" and see if that works?

I got further this time. A bit strange why the Roman – which has the same disabled parameter – didn’t bail out.

Anyway, now I got to Generating fonts from Designspace failed: Tried to end an empty contour. Which might be the same glyph as the Roman. Gonna try fixing it.

@anthrotype
Copy link
Member

Tried to end an empty contour.

I merged fonttools/fonttools#3145, try installing fonttools from github it should work around that

@clauseggers
Copy link
Author

If I install by way of pip install fonttools will I then get the right Github version?

@anthrotype
Copy link
Member

no, that way you get the stable release from PyPI.
temporarily use this, until the next fonttools release is out:

$ pip install -e git+https://github.com/fonttools/fonttools.git#egg=FontTools

@clauseggers
Copy link
Author

Sorry, but I am getting the same error, also with the fresh fonttools from github:

fontmake: Error: In 'Playfair-2_1-Italic.glyphs' -> 'master_ufo/Playfair.designspace': Generating fonts from Designspace failed: Tried to end an empty contour.

@anthrotype
Copy link
Member

anthrotype commented May 31, 2023

Try again, maybe pip uninstall fonttools and then install again, make sure you are installing it in the same environment where fontmake itself is

@clauseggers
Copy link
Author

Both fontmake and fonttools are in each their own VirtualEnv, then linked to ~/.local/bin which is in my path. I’m gonna try restarting the Mac.

@anthrotype
Copy link
Member

fontmake and fonttools are in each their own VirtualEnv

no that's not how it's supposed to work, you want to install fonttools (library) in the same virtual environment where fontmake (application) is installed, such that fontmake can import that.
It's good you wish to keep distinct applications each in their own virtual environments, but for this to work you want to not keep them distinct.

@anthrotype
Copy link
Member

basically, you need to activate the venv where fontmake is installed and use that venv's pip command to install the fonttools from github

@clauseggers
Copy link
Author

Success. Thank you for your speedy fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants