shithub: freetype+ttf2subf

Download patch

ref: a05c02c9ca6f7d801ad555b447c44a088f4e39d7
parent: d85623c24174daeb0ab4cc1843975e54d4d4810e
author: Tom Kacvinsky <[email protected]>
date: Sun Dec 24 04:57:28 EST 2000

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.

git/fs: mount .git/fs: mount/attach disallowed
--- a/src/cff/cffparse.c
+++ b/src/cff/cffparse.c
@@ -308,8 +308,8 @@
     FT_Vector*      offset = &dict->font_offset;
     FT_Byte**       data   = parser->stack;
     FT_Error        error;
+    FT_Fixed        temp;
 
-
     error = T2_Err_Stack_Underflow;
 
     if ( parser->top >= parser->stack + 6 )
@@ -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;
     }