[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ft-devel] Culprit for missing segment at the ends of stems.
From: |
Just Fill Bugs |
Subject: |
[ft-devel] Culprit for missing segment at the ends of stems. |
Date: |
Wed, 04 May 2011 18:12:51 +0800 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110422 Shredder/3.1.11pre |
I traced the autofit a bit to find out why some segments were missed at
the ends of stems. like the vertical segments at the end of 一 of
wqy-zenhei.ttc
It turned out that the culprit was, that the surrounding anchor points
have no 'out direction' when searching for segments.
The code in afhints.c[1] has the following lines:
af_direction_compute( FT_Pos dx,
FT_Pos dy )
{
FT_Pos ll, ss; /* long and short arm lengths */
...
/* return no direction if arm lengths differ too much */
/* (value 14 is heuristic) */
ss *= 14;
if ( FT_ABS( ll ) <= FT_ABS( ss ) )
dir = AF_DIR_NONE;
For 一 in wqy-zenhei, ss = -5, and ll = -50 or something for a end
point. Hence AF_DIR_NONE.
Cross out that part will solve the problem for "一" , of cause might
also screw up some other parts. It's there to keep the tangent small.
Any suggestion on how to fix it properly?
[1]
http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/src/autofit/afhints.c#n455
grid-yi1.png
Description: PNG image
- [ft-devel] Culprit for missing segment at the ends of stems.,
Just Fill Bugs <=