googlefonts / googlefonts/glyphsLib
in 6.0.1, fontmake seems to work but glyphs2ufo doesn't
- Dominant language
- Python
- Stars
- 201
- Forks
- 56
- Avg merge
- 17m
- Merged PRs (30d)
- 1
Description
I'm having an issue trying to use glyphs2ufo on a Glyphs 3 file — I'm not sure what's causing the issue exactly, I was surprised to see that fontmake can handle the file but glyphs2ufo can't. (could it be a config issue on my end? I tried removing existing glyphsLib and re-installing from this repo as well as pip).
I tried removing hinting, brace layers, features, and a following a few other suspicions with no luck. deleting all glyphs except the letter `A` did work, so I don't think it's a structural problem with the file itself. unfortunately I can't share the file, so I know this is an annoyingly non-reproducible issue to open, but I'm happy to keep trying to diagnose if anyone has any hunches about what I should try first, short of deleting all 1500 glyphs one at a time 😅
```
Traceback (most recent call last):
File "/usr/local/Cellar/python@3.9/3.9.8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/local/Cellar/python@3.9/3.9.8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.9/site-packages/glyphsLib/__main__.py", line 22, in
sys.exit(glyphsLib.cli.main())
File "/usr/local/lib/python3.9/site-packages/glyphsLib/cli.py", line 205, in main
return options.func(options)
File "/usr/local/lib/python3.9/site-packages/glyphsLib/cli.py", line 224, in glyphs2ufo
glyphsLib.build_masters(
File "/usr/local/lib/python3.9/site-packages/glyphsLib/__init__.py", line 120, in build_masters
designspace = to_designspace(
File "/usr/local/lib/python3.9/site-packages/glyphsLib/builder/__init__.py", line 123, in to_designspace
return builder.designspace
File "/usr/local/lib/python3.9/site-packages/glyphsLib/builder/builders.py", line 345, in designspace
list(self.masters) # Make sure that the UFOs are built
File "/usr/local/lib/python3.9/site-packages/glyphsLib/builder/builders.py", line 227, in masters
self.to_ufo_layers()
File "/usr/local/lib/python3.9/site-packages/glyphsLib/builder/builders.py", line 291, in to_ufo_layers
self.to_ufo_glyph(ufo_glyph, layer, glyph)
File "/usr/local/lib/python3.9/site-packages/glyphsLib/builder/glyph.py", line 279, in to_ufo_glyph
self.to_ufo_hints(ufo_glyph, layer)
File "/usr/local/lib/python3.9/site-packages/glyphsLib/builder/hints.py", line 37, in to_ufo_hints
elif val is not None and not any(v is None for v in val):
File "/usr/local/lib/python3.9/site-packages/glyphsLib/builder/hints.py", line 37, in
elif val is not None and not any(v is None for v in val):
File "/usr/local/lib/python3.9/site-packages/glyphsLib/types.py", line 106, in __getitem__
assert isinstance(self.value, list) and len(self.value) == self.dimension
AssertionError
```
Contributor guide
Research direction
Start at glyphsLib/cli.py's glyphs2ufo entry point and follow the traceback through builder/hints.py, builder/glyph.py, builders.py, and types.py. Reproduce the AssertionError with a shareable or minimized Glyphs 3 file if possible, then confirm that glyphs2ufo handles the offending hint data without failing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100