googlefonts / googlefonts/glyphsLib
Write non-default axis values to font info
- Dominant language
- Python
- Stars
- 202
- Forks
- 57
- Avg merge
- 17m
- Merged PRs (30d)
- 1
Description
During compilation of a variable font, `varLib` sets the OS/2 `usWeightClass` value [based on the default in the fvar table](https://github.com/fonttools/fonttools/blob/a6f59a4f87a011106070271fd3971b51ed0558ff/Lib/fontTools/varLib/__init__.py#L1020) but it appears that during postprocessing, `ufo2ft` is [overwriting this with a value from fontinfo.plist](https://github.com/googlefonts/ufo2ft/blob/16ed156bd6a8b9bc035d0aa8045a1271ef79a52e/Lib/ufo2ft/postProcessor.py#L353).
- Maybe this is a glyphsLib bug, and it should be setting the lib key correctly?
- or maybe ufo2ft should be more judicious in what values it uses from the fontinfo?
To reproduce, compile `Cormorant-Italic.gylphs` from the https://github.com/CatharsisFonts/Cormorant repo.
Specifically, I was running:
```sh
$ fontmake -o variable --output-path font.ttf --drop-implied-oncurves --no-production-names -g Cormorant/sources/Cormorant-Italic.glyphs
```
Contributor guide
Research direction
Reproduce the issue with the provided fontmake command and Cormorant-Italic.glyphs. Compare varLib/__init__.py around the OS/2 usWeightClass assignment with ufo2ft/postProcessor.py around the fontinfo.plist value, then trace how glyphsLib produces that metadata. Done means the correct non-default axis value survives compilation and the responsible behavior is covered by a regression test.
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
- Mostly clear
- Newbie friendliness
- 42/100