fonttools / fontbakery

🧁 A font quality assurance tool for everyone
https://fontbakery.readthedocs.io
Apache License 2.0
547 stars 99 forks source link

New check: consistent underline position and thickness #4203

Open dscorbett opened 1 year ago

dscorbett commented 1 year ago

What needs to be checked?

underlinePosition and underlineThickness in the 'post' table should be consistent with UnderlinePosition and UnderlineThickness in the 'CFF ' table.

Detailed description of the problem

The specification of underlinePosition in 'post' says “The value of the PostScript key may be calculated by subtracting half the underlineThickness from the value of this field.” That is, CFF.UnderlinePosition == post.underlinePosition - post.underlineThickness / 2 by definition.

underlineThickness in 'post' and UnderlineThickness in 'CFF ' are both simply the underline thickness, so they should always equal each other.

Suggested profile

Suggest which profile the check should be added to. The most common are:

Suggested result

Which log result level should the check have:

Severity assessment

1 (minor)

benkiel commented 1 year ago

See https://github.com/googlefonts/ufo2ft/pull/764 and https://github.com/unified-font-object/ufo-spec/pull/221 which will make this easier to deal with in sources