chiark / gitweb /
Don't emit counter hints for horizontal stems
authorBen Harris <bjh21@bjh21.me.uk>
Mon, 3 Mar 2025 22:57:37 +0000 (22:57 +0000)
committerBen Harris <bjh21@bjh21.me.uk>
Mon, 3 Mar 2025 22:57:37 +0000 (22:57 +0000)
commitaea0b12ba2e4c2a0b56a8ba79f7659574bc075d0
tree00ea3c512f4dee9c5f4def5a3cdadcf610006fac
parent0d2296e4afe2a53bb42006536b6ad0c3564f5da2
Don't emit counter hints for horizontal stems

Microsoft Windows 11 pays some attention to counter hints, and the
results are disastrous.  Specifically, at awkward ppem, characters
with counter hints end up one pixel smaller that characters without
them.  That makes the counters the same size, and puts every
horizontal stem squarely on a pixel, but means that cap height is all
wobbly, which looks horrible.  Additionally, some characters ('2' and
'3', at least) end up grossly distorted, with the top of the character
either stretched way above the character cell or squashed down to the
centre line.

Turning off the counter hints solves these problems.  Windows does
then draw the 'B' with its centre-line below the centre rather than
above it, but that's not a regression from 002.009.  As far as I can
tell, FreeType 2.12.1 ignores counter hints entirely.  At least, the
output of ftlint at 11 ppem is the same before and after this change.

Vertical counter hints survive.  They're also ignored by FreeType
2.12.1 (as are all vertical stem hints), but they seem to have a
broadly positive effect in Windows.
bedstead.c