shithub: freetype+ttf2subf

Download patch

ref: a4cb0d95d90a7ed76625dc5d60af66dca03733c5
parent: 4c60bd916cd487b9ee90b561ecfa4011d443c68c
author: Werner Lemberg <[email protected]>
date: Sat Aug 23 15:54:06 EDT 2008

* src/type/t1afm.c (compare_kern_pairs), src/pxaux/afmparse.c
(afm_compare_kern_pairs): Fix comparison.  This fixes Savannah bug
#24119.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,16 @@
+2008-08-23  Werner Lemberg  <[email protected]>
+
+	* src/type/t1afm.c (compare_kern_pairs), src/pxaux/afmparse.c
+	(afm_compare_kern_pairs): Fix comparison.  This fixes Savannah bug
+	#24119.
+
 2008-08-19  suzuki toshiya <[email protected]>
 
-	* src/base/ftobjs.c (FT_Stream_New): Initialize *astream
-	always, even if passed library or arguments are invalid.
-	This fixes a bug that uninitialized stream is freed when
-	an invalid library handle is passed. Originally proposed
-	by Mike Fabian, 2008/08/18 on freetype-devel.
+	* src/base/ftobjs.c (FT_Stream_New): Initialize *astream always,
+	even if passed library or arguments are invalid.  This fixes a bug
+	that an uninitialized stream is freed when an invalid library handle
+	is passed.  Originally proposed by Mike Fabian, 2008/08/18 on
+	freetype-devel.
 	(FT_Open_Face): Ditto (stream).
 	(load_face_in_embedded_rfork): Ditto (stream2).
 
--- a/src/gxvalid/gxvcommn.c
+++ b/src/gxvalid/gxvcommn.c
@@ -50,11 +50,11 @@
                              FT_UShort*  b )
   {
     if ( *a < *b )
-      return ( -1 );
+      return -1;
     else if ( *a > *b )
-      return ( 1 );
+      return 1;
     else
-      return ( 0 );
+      return 0;
   }
 
 
@@ -115,11 +115,11 @@
                             FT_ULong*  b )
   {
     if ( *a < *b )
-      return ( -1 );
+      return -1;
     else if ( *a > *b )
-      return ( 1 );
+      return 1;
     else
-      return ( 0 );
+      return 0;
   }
 
 
--- a/src/psaux/afmparse.c
+++ b/src/psaux/afmparse.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    AFM parser (body).                                                   */
 /*                                                                         */
-/*  Copyright 2006, 2007 by                                                */
+/*  Copyright 2006, 2007, 2008 by                                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -672,7 +672,12 @@
     FT_ULong  index2 = KERN_INDEX( kp2->index1, kp2->index2 );
 
 
-    return (int)( index1 - index2 );
+    if ( index1 > index2 )
+      return 1;
+    else if ( index1 < index2 )
+      return -1;
+    else
+      return 0;
   }
 
 
--- a/src/psnames/psmodule.c
+++ b/src/psnames/psmodule.c
@@ -174,9 +174,23 @@
 
     /* sort base glyphs before glyph variants */
     if ( unicode1 == unicode2 )
-      return map1->unicode - map2->unicode;
+    {
+      if ( map1->unicode > map2->unicode )
+        return 1;
+      else if ( map1->unicode < map2->unicode )
+        return -1;
+      else
+        return 0;
+    }
     else
-      return unicode1 - unicode2;
+    {
+      if ( unicode1 > unicode2 )
+        return 1;
+      else if ( unicode1 < unicode2 )
+        return -1;
+      else
+        return 0;
+    }
   }
 
 
--- a/src/type1/t1afm.c
+++ b/src/type1/t1afm.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    AFM support for Type 1 fonts (body).                                 */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by             */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -88,7 +88,12 @@
     FT_ULong  index2 = KERN_INDEX( pair2->index1, pair2->index2 );
 
 
-    return (int)( index1 - index2 );
+    if ( index1 > index2 )
+      return 1;
+    else if ( index1 < index2 )
+      return -1;
+    else
+      return 0;
   }