googlefonts / googlefonts/glyphsLib
Designspace 5 "uservalue" field not recognized in <instance> <location> element
- Dominant language
- Python
- Stars
- 201
- Forks
- 56
- Avg merge
- 17m
- Merged PRs (30d)
- 1
Description
A designspace v5 that contains `` definitions that use `uservalue` instead of `xvalue` in `` will cause an error with `ufo2glyphs`:
```
Traceback (most recent call last):
File "/Users/just/code/git/BlackFoundry/Grtsk/venv/bin/ufo2glyphs", line 8, in
sys.exit(_ufo2glyphs_entry_point())
File "/Users/just/code/git/BlackFoundry/Grtsk/venv/lib/python3.11/site-packages/glyphsLib/cli.py", line 342, in _ufo2glyphs_entry_point
return main(args)
File "/Users/just/code/git/BlackFoundry/Grtsk/venv/lib/python3.11/site-packages/glyphsLib/cli.py", line 234, in main
return options.func(options)
File "/Users/just/code/git/BlackFoundry/Grtsk/venv/lib/python3.11/site-packages/glyphsLib/cli.py", line 314, in ufo2glyphs
font = glyphsLib.to_glyphs(
File "/Users/just/code/git/BlackFoundry/Grtsk/venv/lib/python3.11/site-packages/glyphsLib/builder/__init__.py", line 167, in to_glyphs
return builder.font
File "/Users/just/code/git/BlackFoundry/Grtsk/venv/lib/python3.11/site-packages/glyphsLib/builder/builders.py", line 581, in font
self.to_glyphs_instances()
File "/Users/just/code/git/BlackFoundry/Grtsk/venv/lib/python3.11/site-packages/glyphsLib/builder/instances.py", line 211, in to_glyphs_instances
user_loc = piecewiseLinearMap(design_loc, reverse_mapping)
File "/Users/just/code/git/BlackFoundry/Grtsk/venv/lib/python3.11/site-packages/fontTools/varLib/models.py", line 509, in piecewiseLinearMap
if v < k:
TypeError: '<' not supported between instances of 'NoneType' and 'float'
```
Contributor guide
Research direction
Start with glyphsLib/builder/instances.py, especially to_glyphs_instances, and trace the conversion from designspace instance locations to Glyphs values. Reproduce the failure with a designspace v5 using uservalue in an instance location, then verify that ufo2glyphs completes without the NoneType comparison error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100