googlefonts / googlefonts/fontmake
missing xHeight crash
- Dominant language
- Python
- Stars
- 888
- Forks
- 97
- Avg merge
- 4d 52m
- Merged PRs (30d)
- 1
Description
UFO is exported from [this SFD](https://github.com/georgd/EB-Garamond/tree/master/SFD/EBGaramond08-Regular.sfdir) using FontForge.
When OS2XHeight is missing:
```text
$ fontmake -u EBGaramond08-Regular.ufo -o otf --optimize-cff 0 --keep-overlaps --timing --verbose DEBUG
DEBUG:fontmake.font_project:ufoLib UFO validation is disabled
INFO:fontmake.font_project:Building OTF for EBGaramond08-Regular
INFO:ufo2ft:Pre-processing glyphs
INFO:ufo2ft.filters:Running DecomposeComponentsFilter on EBGaramond08-Regular
DEBUG:ufo2ft.filters:Took 0.797s to run DecomposeComponentsFilter on 1457 glyphs
INFO:ufo2ft:Building OpenType tables
Traceback (most recent call last):
File "/bin/fontmake", line 11, in
load_entry_point('fontmake==2.0.7', 'console_scripts', 'fontmake')()
File "/usr/lib/python3.6/site-packages/fontmake/__main__.py", line 460, in main
ufo_paths, is_instance=args.pop("masters_as_instances"), **args
File "/usr/lib/python3.6/site-packages/fontmake/font_project.py", line 1013, in run_from_ufos
self.build_otfs(ufos, **kwargs)
File "/usr/lib/python3.6/site-packages/fontmake/font_project.py", line 204, in build_otfs
self.save_otfs(ufos, **kwargs)
File "/usr/lib/python3.6/site-packages/fontTools/misc/loggingTools.py", line 367, in wrapper
return func(*args, **kwds)
File "/usr/lib/python3.6/site-packages/fontmake/font_project.py", line 480, in save_otfs
for font, ufo in zip(fonts, ufos):
File "/usr/lib/python3.6/site-packages/fontmake/font_project.py", line 345, in _iter_compile
yield compile_func(ufo, debugFeatureFile=debugFeatureFile, **options)
File "/usr/lib/python3.6/site-packages/ufo2ft/__init__.py", line 124, in compileOTF
otf = outlineCompiler.compile()
File "/usr/lib/python3.6/site-packages/ufo2ft/outlineCompiler.py", line 122, in compile
self.setupTable_OS2()
File "/usr/lib/python3.6/site-packages/ufo2ft/outlineCompiler.py", line 507, in setupTable_OS2
xHeight = getAttrWithFallback(font.info, "xHeight")
File "/usr/lib/python3.6/site-packages/ufo2ft/fontInfoData.py", line 499, in getAttrWithFallback
value = staticFallbackData[attr]
KeyError: 'xHeight'
```
Contributor guide
Assessment
This issue has not been assessed yet.