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: Behdad Esfahbod
Subject: Re: [ft-devel] gamma correction and FreeType
Date: Sat, 30 Nov 2013 10:48:31 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1

On 13-11-07 02:28 AM, Antti Lankila wrote:
> - 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.)

As noted before, the warper in FreeType also tries to do this, plus a per
glyph stretch, to achieve the same.  It finds best fit by brute-force.  It
occurred to me that one can find the optimal translate/scale by putting the
x/subpixel-position of all stems in a graph and doing a linear regression.
The slope of the resulting line gives the scale while the intercept gives the
translation.

-- 
behdad
http://behdad.org/



reply via email to

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