Commit 790b8dfbffad6bc25c3fca9b5f6feda8dece4661

Werner Lemberg 2015-05-20T12:33:40

[truetype] Minor.

diff --git a/ChangeLog b/ChangeLog
index 122082e..2929e7c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-05-20  Werner Lemberg  <wl@gnu.org>
+
+	[truetype] Minor.
+
+	* src/truetype/ttinterp.h (SetSuperRound): Fix type of `GridPeriod'
+	argument.
+
 2015-05-17  Werner Lemberg  <wl@gnu.org>
 
 	[truetype] Fix loading of composite glyphs.
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index b9ae045..0e536af 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -1930,7 +1930,7 @@
         val = 0;
     }
 
-    return  val;
+    return val;
   }
 
 
@@ -2273,7 +2273,7 @@
   /*                                                                       */
   static void
   SetSuperRound( TT_ExecContext  exc,
-                 FT_F26Dot6      GridPeriod,
+                 FT_F2Dot14      GridPeriod,
                  FT_Long         selector )
   {
     switch ( (FT_Int)( selector & 0xC0 ) )
@@ -2291,7 +2291,6 @@
         break;
 
       /* This opcode is reserved, but... */
-
       case 0xC0:
         exc->period = GridPeriod;
         break;
@@ -2321,9 +2320,10 @@
     else
       exc->threshold = ( (FT_Int)( selector & 0x0F ) - 4 ) * exc->period / 8;
 
-    exc->period    /= 256;
-    exc->phase     /= 256;
-    exc->threshold /= 256;
+    /* convert to F26Dot6 format */
+    exc->period    >>= 8;
+    exc->phase     >>= 8;
+    exc->threshold >>= 8;
   }