googlefonts / googlefonts/ufo2ft

Default vertical metrics throw warnings in fontbakery

Open
#347 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
176
Forks
48
PR merge metrics
No merged PRs in 30d

Description

I'm doing test builds of [Cascadia Code](https://github.com/aaronbell/cascadia-code/tree/master/sources) from UFO and am not getting the correct winAscent / winDescent values (under ufo2ft 2.9.1).

In the font head table, the yMax is listed as 2226 (thanks to the Abrevehook), however, the OS/2 winAscent is 1977. Similarly, the yMin is -750 and the OS/2 winDescent is 480. This is throwing up a 'FAIL' in the FontBakery testing. Weirdly, 1977 does not align with any glyph height in the font.

Reading through the code, it appears that the OS/2 winAscent, winDescent values are simply set by setting them to the hhea ascender and descender values. Should it not use the head yMin and yMax values instead?

That also makes me wonder why the hhea values are not being calculated correctly either. Have yet to track that down.

Any guidance on where I can look to track down the issue, or what might be causing this to happen?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the code that assigns OS/2 winAscent and winDescent from the hhea ascender and descender, then compare those values with head yMin and yMax in the generated font. Use the FontBakery failure as the check; done means the intended vertical metrics are calculated consistently and the warning is resolved.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.