googlefonts / googlefonts/glyphsLib
Partial transcoding of corner components
- Dominant language
- Python
- Stars
- 201
- Forks
- 56
- Avg merge
- 17m
- Merged PRs (30d)
- 1
Description
If I run glyphs2ufo on a font that includes corner components, say [Inconsolata](https://github.com/googlefonts/Inconsolata/blob/118fac929245c210192be8b1be695a6a65340e97/sources/Inconsolata.glyphs) (that's a link to current master, not the VF branch I'm currently working on), then corner components are not translated properly to UFO.
Here's the relevant extract from the glyphs file (glyph /h, this is line 20440 of the linked file):
```
hints = (
{
origin = "{0, 17}";
type = Corner;
name = _corner.rightSpur;
}
);
```
And here's the relevant excerpt from the h.glif file:
```xml
com.schriftgestaltung.hints
horizontal
options
0
origin
0
17
stem
-2
type
Corner
```
The `name` field is gone, which is of course critical, and there are spurious additional fields for `horizontal`, `options`, and `stem`.
It's not too hard to figure out what's going on here. Very likely Glyphs has chosen a hacky way to represent corner components, overloading its "hint" key, and the relevant [glyphslib code](https://github.com/googlefonts/glyphsLib/blob/master/Lib/glyphsLib/builder/hints.py) is doing its best to transcode a hint. The code needs to be adapted to switch on the `type` field and handle it differently in the case of corners.
Contributor guide
Assessment
This issue has not been assessed yet.