Live data from Hacker News

Ttfautohint – a 99% automated font hinting process

freetype.org

11–14 of 14 posts

Re: Ttfautohint – a 99% automated font hinting process

#11

In my experience, hinting is becoming increasingly obsolete because most engines will create it on the spot if missing and there's more and more situations where TTF engines will completely ignore it, for example ClearType. That's why when I wanted to have a font that is hinted perfectly for one given size, I in the end had to resolve to baking the hinting distortions into the glyph outlines itself. Here's my blog po…

Training a GAN is an interesting approach!

But one thing that I'm not sure you're aware of - is that you can get very good results without resorting to this.

The trick is basically to get Freetype to render the glyph with hinting enabled, but at increased horizontal resolution (eg 4x is enough). By stretching the glyph horizontally, you basically get rid of the vertical hinting. Because you're rendering for LCD sub-pixel display, you triple the 4x again, so you actually render horizontally at say 3*4 = 12x pixel width. This wipes out the effect of hinting horizontally, but preserves the vertical hinting, which gives you the best of both worlds. You get crisp horizontal edges, and the ability to place glyphs with sub-pixel precision on the X axis. Of course for mono-spaced fonts this doesn't matter, and for maximum crispness, you might as well just render LCD sub-pixel glyphs with full hinting, which gives results that looks similar to the example at the top of your page.

Re: Ttfautohint – a 99% automated font hinting process

#12
post #11

In my experience, hinting is becoming increasingly obsolete because most engines will create it on the spot if missing and there's more and more situations where TTF engines will completely ignore it, for example ClearType. That's why when I wanted to have a font that is hinted perfectly for one given size, I in the end had to resolve to baking the hinting distortions into the glyph outlines itself. Here's my blog po…

Training a GAN is an interesting approach! But one thing that I'm not sure you're aware of - is that you can get very good results without resorting to this. The trick is basically to get Freetype to render the glyph with hinting enabled, but at increased horizontal resolution (eg 4x is enough). By stretching the glyph horizontally, you basically get rid of the vertical hinting. Because you're rendering for LCD sub-p…

FreeType already has a v40 byte code mode that mimics the look and feel of DirectWrite hinting by disabling the horizontal adjustments; see https://www.freetype.org/freetype2/docs/hinting/subpixel-hin....

Re: Ttfautohint – a 99% automated font hinting process

#13

IIRC, one limitation of this is that the fonts will look like garbage when font-smoothing is disabled (e.g. all kinds of ugly artifacts and too-thick lines).

I can't think of any other rasterizer than Freetype that has the option to enable hinting and then disable anti-aliasing. I've never tried that combination, what would be the point of that?

It's the default combination for printing, and it's probably also default (i didn't check) e.g. on one-bit e-ink screens.

Re: Ttfautohint – a 99% automated font hinting process

#14
post #11

In my experience, hinting is becoming increasingly obsolete because most engines will create it on the spot if missing and there's more and more situations where TTF engines will completely ignore it, for example ClearType. That's why when I wanted to have a font that is hinted perfectly for one given size, I in the end had to resolve to baking the hinting distortions into the glyph outlines itself. Here's my blog po…

Training a GAN is an interesting approach! But one thing that I'm not sure you're aware of - is that you can get very good results without resorting to this. The trick is basically to get Freetype to render the glyph with hinting enabled, but at increased horizontal resolution (eg 4x is enough). By stretching the glyph horizontally, you basically get rid of the vertical hinting. Because you're rendering for LCD sub-p…

My goal was the other direction: I wanted to force my font to look pixel-perfect after it had been hinted by Windows integrated GDI ClearType renderer. But because I couldn't easily automate that one, I used Freetype to simulate it.
Post reply on HN