[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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
diff --git a/ChangeLog b/ChangeLog
index 82abe63..f2f7957 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c
index 76e2b04..798f8c9 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;