aboutsummaryrefslogtreecommitdiff
path: root/freetype/src/base/ftoutln.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-02-13 09:55:16 +0100
committermarha <marha@users.sourceforge.net>2013-02-13 09:55:16 +0100
commit88bcd02cfecbf8ba9cf726b0d337c56f9c9b2bc4 (patch)
treeded42639873b943c7ec97b06961ad067228652d1 /freetype/src/base/ftoutln.c
parent3247a4e031a7d5160332c0d7ca2a91a516c082bb (diff)
parentaaf21968deb85b635cb6aa6544df233ea5981346 (diff)
downloadvcxsrv-88bcd02cfecbf8ba9cf726b0d337c56f9c9b2bc4.tar.gz
vcxsrv-88bcd02cfecbf8ba9cf726b0d337c56f9c9b2bc4.tar.bz2
vcxsrv-88bcd02cfecbf8ba9cf726b0d337c56f9c9b2bc4.zip
Merge remote-tracking branch 'origin/released'
* origin/released: Update to following packages: Conflicts: freetype/src/autofit/afhints.c freetype/src/autofit/afmodule.c freetype/src/psaux/psconv.c freetype/src/sfnt/sfntpic.h openssl/Makefile openssl/util/pl/VC-32.pl
Diffstat (limited to 'freetype/src/base/ftoutln.c')
-rw-r--r--freetype/src/base/ftoutln.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/freetype/src/base/ftoutln.c b/freetype/src/base/ftoutln.c
index f94319d0b..f542f01c8 100644
--- a/freetype/src/base/ftoutln.c
+++ b/freetype/src/base/ftoutln.c
@@ -922,7 +922,7 @@
for ( c = 0; c < outline->n_contours; c++ )
{
FT_Vector in, out, shift;
- FT_Fixed l_in, l_out, d;
+ FT_Fixed l_in, l_out, l, q, d;
int last = outline->contours[c];
@@ -952,17 +952,32 @@
/* 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 );
+ /* threshold strength to better handle collapsing segments */
+ l = FT_MIN( l_in, l_out );
+ q = out.x * in.y - out.y * in.x;
+ if ( orientation == FT_ORIENTATION_TRUETYPE )
+ q = -q;
+
+ if ( FT_MulDiv( xstrength, q, l ) < d )
+ shift.x = FT_MulDiv( shift.x, xstrength, d );
+ else
+ shift.x = FT_MulDiv( shift.x, l, q );
+
+
+ if ( FT_MulDiv( ystrength, q, l ) < d )
+ shift.y = FT_MulDiv( shift.y, ystrength, d );
+ else
+ shift.y = FT_MulDiv( shift.y, l, q );
}
else
shift.x = shift.y = 0;