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

<<attachment: grid-yi1.png>>

_______________________________________________
Freetype-devel mailing list
Freetype-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype-devel

Reply via email to