Comment 31 for bug 80921

Revision history for this message
In , Belshazzar (belshazzar) wrote :

Created an attachment (id=19620)
Layered Gimp file comparing small text

(In reply to comment #18)
> Ooohhh, I really wish all my PDFs could be displayed with HINT_SLIGHT & FIR5!
> Just out of curiosity, what did you modify to force it?

Well, I simply removed lines with FT_LOAD_NO_HINTING and then changed CAIRO_HINT_STYLE_NONE to CAIRO_HINT_STYLE_SLIGHT. I realized last night that sometimes vertical hinting leads to roundish letters drooping slightly below the baseline at certain zoom levels. This is the only drawback I found.

> BTW, I think that for precise positioning of small glyphs, it could be possible
> to do sub-pixel positioning, as defined here:
> http://www.freetype.org/freetype2/docs/glyphs/glyphs-5.html . For the small
> glyphs, instead of generating one glyph per character, it would generate 4
> glyphs (or whatever number) corresponding to the possible displacement compared
> to the base pixel. Then depending on the exact position of the character, the
> best fitting of the 4 glyphs would be used.

Yes, this is one thing that should be looked at some time in the future. Actually David Turner implemented an algorithm that adjusts kerning by caching side-bearing deltas before and after hinting, .i.e., no actual subpixel positioning. But the results are already striking. The ftdiff tool is a good demo for this.
If you want to see how it looks when positioning is done well, download the attachment, open it in Gimp, and compare the layers. The top layer is so much more regular and readable than what Poppler and Cairo produce.