diff --git a/ChangeLog b/ChangeLog index 82abe63ac..f2f7957df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2012-11-03 Alexei Podtelezhnikov + + [base] Clean up emboldening code and improve comments there. + + * src/base/ftoutln.c (FT_Outline_EmboldenXY): Replace sequential + calls to FT_MulFix and FT_DivFix with FT_MulDiv. + Mention that bisectors are used to figure out the shift direction. + 2012-10-24 Werner Lemberg [autofit] Add standard character to `AF_ScriptClassRec' structure. diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c index 76e2b04a1..798f8c9a5 100644 --- a/src/base/ftoutln.c +++ b/src/base/ftoutln.c @@ -952,17 +952,18 @@ /* shift only if turn is less then ~160 degrees */ if ( 16 * d > l_in * l_out ) { - /* shift components are rotated */ - shift.x = FT_DivFix( l_out * in.y + l_in * out.y, d ); - shift.y = FT_DivFix( l_out * in.x + l_in * out.x, d ); + /* shift components are aligned along bisector */ + /* and directed according to the outline orientation. */ + shift.x = l_out * in.y + l_in * out.y; + shift.y = l_out * in.x + l_in * out.x; if ( orientation == FT_ORIENTATION_TRUETYPE ) shift.x = -shift.x; else shift.y = -shift.y; - shift.x = FT_MulFix( xstrength, shift.x ); - shift.y = FT_MulFix( ystrength, shift.y ); + shift.x = FT_MulDiv( shift.x, xstrength, d ); + shift.y = FT_MulDiv( shift.y, ystrength, d ); } else shift.x = shift.y = 0;