googlefonts / googlefonts/glyphsLib
KeyError: 'name' on designspace to glyphs
- Dominant language
- Python
- Stars
- 202
- Forks
- 57
- Avg merge
- 17m
- Merged PRs (30d)
- 1
Description
```
File "/usr/local/lib/python3.10/site-packages/glyphsLib/builder/__init__.py", line 167, in to_glyphs
return builder.font
File "/usr/local/lib/python3.10/site-packages/glyphsLib/builder/builders.py", line 556, in font
self.to_glyphs_glyph(glyph, layer, master)
File "/usr/local/lib/python3.10/site-packages/glyphsLib/builder/glyph.py", line 478, in to_glyphs_glyph
self.to_glyphs_hints(ufo_glyph, layer)
File "/usr/local/lib/python3.10/site-packages/glyphsLib/builder/hints.py", line 51, in to_glyphs_hints
setattr(hint, name, source[name])
KeyError: 'name'
```
Also if I add on 51 line in hints.py `if name in source:`, it converts, almost right, but with many component errors, such as
```
Glyph ushort-cy, layer Regular: The ComponentInfo at index 0 says the component at index 1 is named 'cyrbreve', but it is actually named 'breve-cy'. Skipping, component properties will be lost.
```
Also there are some issues in these glyphs in Glyphs, but ufos seems to be fine.
It seems to be related to renaming glyphs, but a full-text search of the project folder holding ufos cannot find anything like these names
Contributor guide
Research direction
Reproduce the designspace-to-Glyphs conversion from the reported traceback, then inspect glyphsLib/builder/hints.py around line 51 and the callers in builder/glyph.py and builder/builders.py. Compare the reported renamed glyph and component warnings with the source UFOs; done means the conversion no longer raises KeyError and does not lose component properties.
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
- 30/100