[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.
This commit is contained in:
Alexei Podtelezhnikov 2012-11-03 22:27:27 -04:00
parent 553bb3c3ca
commit 48ce226ae3
2 changed files with 14 additions and 5 deletions

View File

@ -1,3 +1,11 @@
2012-11-03 Alexei Podtelezhnikov <apodtele@gmail.com>
[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 <wl@gnu.org>
[autofit] Add standard character to `AF_ScriptClassRec' structure.

View File

@ -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;