shithub: freetype+ttf2subf

Download patch

ref: 673a28ef93a94e1cf604c38cd4db9146ead2abbb
parent: 9cc0ad7bf51df800e8852b511c3ea5b8edd7076b
author: Alexei Podtelezhnikov <[email protected]>
date: Sat Oct 11 10:40:51 EDT 2014

[base] Small bbox correction.

* src/base/ftbbox.c (FT_Outline_Get_BBox): Start from nonsense bbox
instead of initial point that could be `off' in conic outlines.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-10-11  Alexei Podtelezhnikov  <[email protected]>
+
+	[base] Small bbox correction.
+
+	* src/base/ftbbox.c (FT_Outline_Get_BBox): Start from nonsense bbox
+	instead of initial point that could be `off' in conic outlines. 
+
 2014-10-08  Alexei Podtelezhnikov  <[email protected]>
 
 	[base] Fix Savannah bug #43356.
--- a/src/base/ftbbox.c
+++ b/src/base/ftbbox.c
@@ -433,8 +433,8 @@
   FT_Outline_Get_BBox( FT_Outline*  outline,
                        FT_BBox     *abbox )
   {
-    FT_BBox     cbox;
-    FT_BBox     bbox;
+    FT_BBox     cbox = { 0x7FFFFFFF, 0x7FFFFFFF, -0x7FFFFFFF, -0x7FFFFFFF };
+    FT_BBox     bbox = { 0x7FFFFFFF, 0x7FFFFFFF, -0x7FFFFFFF, -0x7FFFFFFF };
     FT_Vector*  vec;
     FT_UShort   n;
 
@@ -458,11 +458,8 @@
     /* coincide, we exit immediately.                             */
 
     vec = outline->points;
-    bbox.xMin = bbox.xMax = cbox.xMin = cbox.xMax = vec->x;
-    bbox.yMin = bbox.yMax = cbox.yMin = cbox.yMax = vec->y;
-    vec++;
 
-    for ( n = 1; n < outline->n_points; n++ )
+    for ( n = 0; n < outline->n_points; n++ )
     {
       FT_UPDATE_BBOX( vec, cbox);