Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent character heights in hinted text between regular and italic styles #16

Open
nyanpasu64 opened this issue Oct 22, 2022 · 1 comment

Comments

@nyanpasu64
Copy link

While using Gentium (GentiumPlus-6.101.zip), I noticed that with hinting enabled, some sizes of text appear at different heights between regular and italic styles (and likely bold as well), on Windows 7 (didn't test 10) and Linux slight hinting mode (though this may be unfixable without telling freetype to use bytecode hinting for this particular font):

test.zip

win7 firefox

Because you run ttfautohint on each font file individually, ttfautohint makes the font size rounding decisions separately for each style. At some font sizes, the italic text's x-height is a full pixel shorter than regular, which looks jarring.

The solution is to pass --reference (regular.ttf) to ttfautohint. (Note that this fails on Windows due to a CRLF conversion error, though this should not affect your VM-based build system.) You could use the same reference for Gentium and Gentium Book (so both fonts have identical rounding), or each font name's regular font for all font styles of that name.

I've locally hinted all 8 fonts using GentiumPlus-Regular.ttf as a reference, and the results look decent:

firefox_35VC18DBsM

Bold and bold-italic seem to have manageable counters, and I haven't seen the holes in e or g collapse entirely, even at small font sizes. So setting a reference doesn't seem to have any negative consequences (in my limited testing).


On Linux, I don't know if FreeType's default-enabled render-time autohinting (which ignores bytecode) will follow the reference metrics you pass into the bytecode autohinter. I suspect not, but haven't tested yet.

@jvgaultney
Copy link
Contributor

Fascinating! We'll try this in the future. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants