Commit a05c02c9ca6f7d801ad555b447c44a088f4e39d7

Tom Kacvinsky 2000-12-24T09:57:28

Added code to cff_parse_font_matrix so that the font matrix numbers are scaled by 1/(matrix->yy). Also, the offset vector now contains integer values instead of 16.16 fixed numbers.

diff --git a/src/cff/cffparse.c b/src/cff/cffparse.c
index bbde59a..ff4ab71 100644
--- a/src/cff/cffparse.c
+++ b/src/cff/cffparse.c
@@ -308,7 +308,7 @@
     FT_Vector*      offset = &dict->font_offset;
     FT_Byte**       data   = parser->stack;
     FT_Error        error;
-
+    FT_Fixed        temp;
 
     error = T2_Err_Stack_Underflow;
 
@@ -320,6 +320,23 @@
       matrix->yy = cff_parse_fixed( data++ );
       offset->x  = cff_parse_fixed( data++ );
       offset->y  = cff_parse_fixed( data   );
+
+      temp = ABS( matrix->yy );
+
+      if ( temp != 0x10000L )
+      {
+        matrix->xx = FT_DivFix( matrix->xx, temp );
+        matrix->yx = FT_DivFix( matrix->yx, temp );
+        matrix->xy = FT_DivFix( matrix->xy, temp );
+        matrix->yy = FT_DivFix( matrix->yy, temp );
+        offset->x  = FT_DivFix( offset->x,  temp );
+        offset->y  = FT_DivFix( offset->y,  temp );
+      }
+
+      /* note that the offsets must be expressed in integer font units */
+      offset->x >>= 16;
+      offset->y >>= 16;
+
       error = T2_Err_Ok;
     }