I’m trying to get a Variable font with PostScript outlines. I’ve successfully exported a Variable TTF (directly from Glyphs 3) but after days of removing all the kinks, the results are still disappointing in some of the instances because of the auto-added TT points (testing in Adobe CC). I’ve tried simplifying the outlines (removing points) but in a font with such contrasting styles from compressed to wide there’s only so much you can reduce.
Now I decided to try using fontmake to get the Variable font with CFF2 outlines, but I can’t get it to work. My coding knowledge is non-existent so most probably I’m doing something wrong. This is the message I’m getting from fontmake:
fontmake -g AllotropeItalic14-VAR.glyphs -o variable-cff2
INFO:fontmake.font_project:Building master UFOs and designspace from Glyphs source
INFO:glyphsLib.classes:Parsing "AllotropeItalic14-VAR.glyphs" file into <GSFont>
Traceback (most recent call last):
File "/usr/local/bin/fontmake", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.10/site-packages/fontmake/__main__.py", line 620, in main
project.run_from_glyphs(inputs.glyphs_path, **args)
File "/usr/local/lib/python3.10/site-packages/fontmake/font_project.py", line 775, in run_from_glyphs
designspace_path = self.build_master_ufos(
File "/usr/local/lib/python3.10/site-packages/fontTools/misc/loggingTools.py", line 372, in wrapper
return func(*args, **kwds)
File "/usr/local/lib/python3.10/site-packages/fontmake/font_project.py", line 191, in build_master_ufos
designspace = glyphsLib.to_designspace(
File "/usr/local/lib/python3.10/site-packages/glyphsLib/builder/__init__.py", line 123, in to_designspace
return builder.designspace
File "/usr/local/lib/python3.10/site-packages/glyphsLib/builder/builders.py", line 327, in designspace
self.to_designspace_sources() # .sources
File "/usr/local/lib/python3.10/site-packages/glyphsLib/builder/sources.py", line 40, in to_designspace_sources
_to_designspace_source_layer(self)
File "/usr/local/lib/python3.10/site-packages/glyphsLib/builder/sources.py", line 159, in _to_designspace_source_layer
key = (layer.name, tuple(layer._brace_coordinates()))
File "/usr/local/lib/python3.10/site-packages/glyphsLib/classes.py", line 3796, in _brace_coordinates
return [float(c) for c in coordinates.split(",")]
File "/usr/local/lib/python3.10/site-packages/glyphsLib/classes.py", line 3796, in <listcomp>
return [float(c) for c in coordinates.split(",")]
ValueError: could not convert string to float: ' 72 off'
I did manage to get some other font (single style) to export as TTF with fontmake so I guess I installed fontmake and Python right. What am I doing wrong?
I’m afraid someone with access to the font file will need to debug this. It looks like one of the brace layers has coordinates that glyphsLib does not know how to handle, namely this 72 off looks suspicious as there should be only numbers here (unless it is some extended syntax glyphsLib does not know about).
And that was correct. I found and deleted old brace layers that were deactivated e.g. {275, 72 OFF} but left among other layers. After that I managed to get .designspace and UFO files, but still no luck with the variable font file. Now I have a different error message:
fontmake: Error: In 'AllotropeItalic14-VF.glyphs' -> 'master_ufo/AllotropeItalic-Italic.designspace': Generating fonts from Designspace failed: Locations must be unique.
I found in a similar case that it helped to assign all brace layers to the same master via the Layers panel in the sidebar. I have even written a script that does this.