fonttools / fontbakery

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

GASP table warning provides incorrect information #3073

Open aaronbell opened 4 years ago

aaronbell commented 4 years ago

Observed behaviour

On Cascadia Code, I received the following warning:

⚠ WARN: Is the Grid-fitting and Scan-conversion Procedure ('gasp') table set to optimize rendering? com.google.fonts/check/gasp --- Rationale --- Traditionally version 0 'gasp' tables were set so that font sizes below 8 ppem had no grid fitting but did have antialiasing. From 9-16 ppem, just grid fitting. And fonts above 17ppem had both antialiasing and grid fitting toggled on. The use of accelerated graphics cards and higher resolution screens make this approach obsolete. Microsoft's DirectWrite pushed this even further with much improved rendering built into the OS and apps.

In this scenario it makes sense to simply toggle all 4 flags ON for all font sizes.

ℹ INFO These are the ppm ranges declared on the gasp table: PPM <= 9: flag = 0x0A - Use grayscale rendering - Use smoothing along multiple axes with ClearType® PPM <= 50: flag = 0x0F - Use grid-fitting - Use grayscale rendering - Use gridfitting with ClearType symmetric smoothing - Use smoothing along multiple axes with ClearType® PPM <= 65535: flag = 0x0A - Use grayscale rendering - Use smoothing along multiple axes with ClearType® [code: ranges] ⚠ WARN The gasp table has a range of 9 that may be unneccessary. [code: non-ffff-range] ⚠ WARN The gasp table has a range of 50 that may be unneccessary. [code: non-ffff-range] * ⚠ WARN The gasp range 0xFFFF value 0x0A should be set to 0x0F. [code: unset-flags]

Expected behaviour

{"rangeMaxPPEM": 9, "rangeGaspBehavior": [1, 3]}, {"rangeMaxPPEM": 50, "rangeGaspBehavior": [0, 1, 2, 3]}, {"rangeMaxPPEM": 65535, "rangeGaspBehavior": [1, 3]},

In this case, grid-fit hinting is disables below 9ppem, and above 50ppem.

Resources and exact process needed to replicate

https://github.com/microsoft/cascadia-code/releases/tag/v2009.22

aaronbell commented 4 years ago

Looks like this is generally covered in: #2672, #1708