shithub: freetype+ttf2subf

Download patch

ref: e20df4a167995e46d0900651be1c30f134638666
parent: 110246c64149e8df09b0101c5b0a2d61117a5b18
author: Werner Lemberg <[email protected]>
date: Wed Sep 27 02:29:21 EDT 2006

* src/pfr/pfrobjs.c (pfr_face_get_kerning): Skip adjustment bytes
correctly.  Reported as Savannah bug #17843.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-09-26  David Bustin
+
+	* src/pfr/pfrobjs.c (pfr_face_get_kerning): Skip adjustment bytes
+	correctly.  Reported as Savannah bug #17843.
+
 2006-09-26  David Turner  <[email protected]>
 
 	* src/autofit/afhints.h (AF_HINTS_DO_HORIZONTAL,
--- a/src/pfr/pfrobjs.c
+++ b/src/pfr/pfrobjs.c
@@ -476,13 +476,14 @@
         goto Exit;
 
       {
-        FT_UInt    count    = item->pair_count;
-        FT_UInt    size     = item->pair_size;
-        FT_UInt    power    = (FT_UInt)ft_highpow2( (FT_UInt32)count );
-        FT_UInt    probe    = power * size;
-        FT_UInt    extra    = count - power;
-        FT_Byte*   base     = stream->cursor;
-        FT_Bool    twobytes = FT_BOOL( item->flags & 1 );
+        FT_UInt    count       = item->pair_count;
+        FT_UInt    size        = item->pair_size;
+        FT_UInt    power       = (FT_UInt)ft_highpow2( (FT_UInt32)count );
+        FT_UInt    probe       = power * size;
+        FT_UInt    extra       = count - power;
+        FT_Byte*   base        = stream->cursor;
+        FT_Bool    twobytes    = FT_BOOL( item->flags & 1 );
+        FT_Bool    twobyte_adj = FT_BOOL( item->flags & 2 );
         FT_Byte*   p;
         FT_UInt32  cpair;
 
@@ -500,7 +501,13 @@
             goto Found;
 
           if ( cpair < pair )
+          {
+            if ( twobyte_adj )
+              p += 2;
+            else
+              p++;
             base = p;
+          }
         }
 
         while ( probe > size )
@@ -533,7 +540,7 @@
 
 
         Found:
-          if ( item->flags & 2 )
+          if ( twobyte_adj )
             value = FT_PEEK_SHORT( p );
           else
             value = p[0];