freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] a hidden gem: the autohint warper code


From: JustFillBug
Subject: Re: [ft-devel] a hidden gem: the autohint warper code
Date: Tue, 1 Mar 2011 16:37:43 +0000 (UTC)
User-agent: slrn/pre1.0.0-18 (Linux)

On 2011-03-01, Werner LEMBERG <address@hidden> wrote:
>
>>> If the bottom line of the warped glyph is shifted away from a
>>> bluezone, then the whole glyph should be shifted back a whole
>>> 1?pixel back toward the bluezone after being warped.
>> 
>> This won't work.  If you shift one pixel back, all other optimized
>> zones, would be at the wrong position.  Warping, as it is currently
>> implemented, only works if the code has the absolute freedom to
>> positions stems at any places.

About the warper, Werner LEMBERG wrote:
> An example of (b) is the warper code in the autofit module (to be
> activated by defining AF_USE_WARPER in aftypes.h) which is highly
> dependent on the output resolution since it shifts and scales a glyph
> by tiny amounts until a best score is found; this score is based on
> how many `segments' (stems and similar features) are near to or
> located on grid lines.

I assume when finding the best score, the shift and scale performed in
the warper code are uniform over the whole glyph points. 

After tiny scaled/shifted, the stems are then grid fit to pixels.

Then shifting back 1 pixel in the screen resolution will simply add a
64(?) font unit point *offset*. It won't effect the distance between a
point and the nearest gid point. The grid fitting should fit toward the
same side of grid except 1 pixel off.

Or do it in another order, we can grid fitting normally first and then
move the result down/up 1 pixel if needed, according the warper effect
over bottom blue zone. Keep the shape, align the bottom.

For example
 * Without warper, the bottom edge will autofit to line 1 (blue zone)
 * With warper, the bottom edge will autofit to line 0
 * Autofit with warper normally
 * After autofit, shift the whole thing up 1 pixel to align the
   warper-autofited bottom edge to line 1.
 * If the un-warpered bottom edge don't fit to blue zone edge, do nothing.

Are these steps make sense?





reply via email to

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