googlefonts / googlefonts/ufo2ft
Cannot produce variable font from Cantarell glyphs source
- Dominant language
- Python
- Stars
- 176
- Forks
- 49
- PR merge metrics
- No merged PRs in 30d
Description
(Not sure if this is a ufo2ft bug or something else.)
1. wget https://github.com/madig/cantarell-fonts/raw/master/src/Cantarell.glyphs
2. fontmake -g Cantarell.glyphs -o variable
```
INFO:fontmake.font_project:Building master UFOs and designspace from Glyphs source
INFO:glyphsLib.parser:Parsing .glyphs file
INFO:glyphsLib:Loading to UFOs
INFO:glyphsLib.util:Writing master_ufo/Cantarell-Light.ufo
INFO:glyphsLib.util:Writing master_ufo/Cantarell-Regular.ufo
INFO:glyphsLib.util:Writing master_ufo/Cantarell-Bold.ufo
INFO:fontmake.font_project:Building interpolation-compatible TTFs
INFO:fontmake.font_project:Converting curves compatibly
INFO:cu2qu.ufo:New spline lengths: 1: 14, 2: 722, 3: 338, 4: 20, 5: 14, 6: 11, 7: 13
INFO:fontmake.font_project:Saving TTF for Cantarell-Light
Traceback (most recent call last):
File "/home/nikolaus/.local/bin/fontmake", line 11, in
sys.exit(main())
File "/home/nikolaus/.local/lib/python3.6/site-packages/fontmake/__main__.py", line 186, in main
project.run_from_glyphs(glyphs_path, **args)
File "/home/nikolaus/.local/lib/python3.6/site-packages/fontmake/font_project.py", line 369, in run_from_glyphs
designspace_path, instance_data=instance_data, **kwargs)
File "/home/nikolaus/.local/lib/python3.6/site-packages/fontmake/font_project.py", line 437, in run_from_designspace
interpolate_layout_from=interpolate_layout_from, **kwargs)
File "/home/nikolaus/.local/lib/python3.6/site-packages/fontmake/font_project.py", line 491, in run_from_ufos
ufos, reverse_direction, conversion_error, **kwargs)
File "/home/nikolaus/.local/lib/python3.6/site-packages/fontmake/font_project.py", line 199, in build_interpolatable_ttfs
self.save_otfs(ufos, ttf=True, interpolatable=True, **kwargs)
File "/home/nikolaus/.local/lib/python3.6/site-packages/fontTools/misc/loggingTools.py", line 372, in wrapper
return func(*args, **kwds)
File "/home/nikolaus/.local/lib/python3.6/site-packages/fontmake/font_project.py", line 284, in save_otfs
font = compileTTF(ufo, convertCubics=False, **compiler_options)
File "/home/nikolaus/.local/lib/python3.6/site-packages/ufo2ft/__init__.py", line 116, in compileTTF
postProcessor = PostProcessor(otf, ufo)
File "/home/nikolaus/.local/lib/python3.6/site-packages/ufo2ft/postProcessor.py", line 18, in __init__
otf.save(stream)
File "/home/nikolaus/.local/lib/python3.6/site-packages/fontTools/ttLib/ttFont.py", line 165, in save
writer_reordersTables = self._save(tmp)
File "/home/nikolaus/.local/lib/python3.6/site-packages/fontTools/ttLib/ttFont.py", line 204, in _save
self._writeTable(tag, writer, done, tableCache)
File "/home/nikolaus/.local/lib/python3.6/site-packages/fontTools/ttLib/ttFont.py", line 615, in _writeTable
self._writeTable(masterTable, writer, done, tableCache)
File "/home/nikolaus/.local/lib/python3.6/site-packages/fontTools/ttLib/ttFont.py", line 615, in _writeTable
self._writeTable(masterTable, writer, done, tableCache)
File "/home/nikolaus/.local/lib/python3.6/site-packages/fontTools/ttLib/ttFont.py", line 619, in _writeTable
tabledata = self.getTableData(tag)
File "/home/nikolaus/.local/lib/python3.6/site-packages/fontTools/ttLib/ttFont.py", line 637, in getTableData
return self.tables[tag].compile(self)
File "/home/nikolaus/.local/lib/python3.6/site-packages/fontTools/ttLib/tables/_g_l_y_f.py", line 84, in compile
glyphData = glyph.compile(self, recalcBBoxes)
File "/home/nikolaus/.local/lib/python3.6/site-packages/fontTools/ttLib/tables/_g_l_y_f.py", line 350, in compile
data = data + self.compileComponents(glyfTable)
File "/home/nikolaus/.local/lib/python3.6/site-packages/fontTools/ttLib/tables/_g_l_y_f.py", line 573, in compileComponents
data = data + compo.compile(more, haveInstructions, glyfTable)
File "/home/nikolaus/.local/lib/python3.6/site-packages/fontTools/ttLib/tables/_g_l_y_f.py", line 1095, in compile
transform[0][0], transform[1][1])
struct.error: 'h' format requires -32768 <= number <= 32767
```
Producing non-variable interpolated fonts works.
```
fontMath==0.4.4
fonttools==3.22.0
glyphsLib==2.2.1
MutatorMath==2.1.0
ufo2ft==1.1.0
ufoLib==2.1.1
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the failure with the Cantarell.glyphs download and `fontmake -g Cantarell.glyphs -o variable` using the listed dependency versions. Start at the `font_project.py` `build_interpolatable_ttfs`/`save_otfs` path and the `ufo2ft` `compileTTF` call shown in the traceback; done means variable-font generation completes without the `struct.error`.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100