freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] gamma correction and FreeType


From: Antti Lankila
Subject: Re: [ft-devel] gamma correction and FreeType
Date: Thu, 7 Nov 2013 09:28:19 +0200


Antti Lankila <address@hidden> kirjoitti 5.11.2013 kello 23.31:

I humored myself and spent this evening reminding myself how to use FT and libpng. Here is the result:


I’ve been thinking of using the full 6-bit fixed point glyph advance and kerning, and completely get rid of the pixel grid, but anyway, this is what it looks like when text is rendered to subpixel grid.

One more update.

Since I hate hinting and munging of glyph outlines for philosophical reasons, I’ve been experimenting with ways to get the result of hinting (crisp fonts) without actually doing any.

I updated that page with an approach that applies a per-glyph translation which is calculated in such a way that it should result in symmetric antialiasing around stems, to the degree it is possible with the approach I chose. In fact, this translation is calculated in two ways:

- one face and size -global y offset, calculated over all the glyphs in the face, to produce the best contrast available for horizontal stems
- per glyph x offset, which just enhances the vertical stems. Since kerning and glyph placement is per subpixel, it causes only very minor bit of horizontal jitter, too little to be noticeable to me.

The offsets are calculated from the vector outline by looking at vertical and horizontal edges, and noting which 1/64th pixel offset they fall on, and then applying a translation that tries to move the average edge as close to the full pixel boundary as possible. (I’m personally not yet quite convinced if it finds the actually optimal translation though.)

I’d also like to implement the darkening somehow without touching the glyph outline, but the best idea I have so far is to simply use a multiplier on the alpha bitmap (which should of course be calculated somehow, not just specified as some kind of magical number). For now, I leave the 0.5 px outline bolding because it is just one number and should ”optimally” enhance glyphs to full alpha range in small glyph sizes, and degrades gradually to irrelevance if the rendering size is increased.

— 
Antti

reply via email to

[Prev in Thread] Current Thread [Next in Thread]