summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexei Podtelezhnikov <apodtele@gmail.com>2013-01-25 23:33:00 -0500
committerAlexei Podtelezhnikov <apodtele@gmail.com>2013-01-25 23:33:00 -0500
commit610ee58e07090ead529849b2a454bb6c503b4995 (patch)
treebb052baec28417a18ba8525ea5a67286d9f70f8a
parentf41ee05475695e301ad282bb63b76658f9589b9b (diff)
downloadfreetype2-610ee58e07090ead529849b2a454bb6c503b4995.tar.gz
[base] Fix broken emboldening at small sizes.
* src/base/ftoutln.c (FT_Outline_EmboldenXY): Do not attempt to normalize zero-length vectors.
-rw-r--r--ChangeLog7
-rw-r--r--src/base/ftoutln.c14
2 files changed, 17 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index c06065ce6..a3da50573 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-01-23 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [base] Fix broken emboldening at small sizes.
+
+ * src/base/ftoutln.c (FT_Outline_EmboldenXY): Do not attempt to
+ normalize zero-length vectors.
+
2013-01-25 Werner Lemberg <wl@gnu.org>
Fix Savannah bug #38167.
diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c
index 72d3c5a1c..0efd88bca 100644
--- a/src/base/ftoutln.c
+++ b/src/base/ftoutln.c
@@ -942,8 +942,11 @@
in.x = v_cur.x - v_prev.x;
in.y = v_cur.y - v_prev.y;
l_in = FT_Vector_Length( &in );
- in.x = FT_DivFix( in.x, l_in );
- in.y = FT_DivFix( in.y, l_in );
+ if ( l_in )
+ {
+ in.x = FT_DivFix( in.x, l_in );
+ in.y = FT_DivFix( in.y, l_in );
+ }
for ( n = first; n <= last; n++ )
{
@@ -956,8 +959,11 @@
out.x = v_next.x - v_cur.x;
out.y = v_next.y - v_cur.y;
l_out = FT_Vector_Length( &out );
- out.x = FT_DivFix( out.x, l_out );
- out.y = FT_DivFix( out.y, l_out );
+ if ( l_out )
+ {
+ out.x = FT_DivFix( out.x, l_out );
+ out.y = FT_DivFix( out.y, l_out );
+ }
d = FT_MulFix( in.x, out.x ) + FT_MulFix( in.y, out.y );