Commit f5dcdd5cfb6d66fd1e75508b7bd85da58973e921

David Turner 2000-05-23T22:16:27

minor fix to the Type1 driver(s) to apply the font matrix when necessary..

diff --git a/CHANGES b/CHANGES
index 249665e..4013727 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
 LATEST_CHANGES
 
+  - a minor fix to the Type 1 driver to let them apply the font matrix
+    correctly (used for many oblique fonts..)
+
   - some fixes for 64-bit systems (mainly changing some FT_TRACE calls
     to use %p instead of %lx).. Thanks to Karl Robillard
 
diff --git a/src/type1/t1gload.c b/src/type1/t1gload.c
index 585204d..921ecc5 100644
--- a/src/type1/t1gload.c
+++ b/src/type1/t1gload.c
@@ -1565,6 +1565,9 @@
         FT_BBox           cbox;
         FT_Glyph_Metrics* metrics = &glyph->root.metrics;
 
+        /* apply the font matrix */
+        FT_Outline_Transform( &glyph->root.outline, &face->type1.font_matrix );
+
         FT_Outline_Get_CBox( &glyph->root.outline, &cbox );
 
         /* grid fit the bounding box if necessary */
diff --git a/src/type1/t1parse.c b/src/type1/t1parse.c
index 9a71f99..6f4ae78 100644
--- a/src/type1/t1parse.c
+++ b/src/type1/t1parse.c
@@ -586,8 +586,8 @@
         switch (n)
         {
           case 0 : result = &matrix->xx; break;
-          case 1 : result = &matrix->xy; break;
-          case 2 : result = &matrix->yx; break;
+          case 1 : result = &matrix->yx; break;
+          case 2 : result = &matrix->xy; break;
           default: result = &matrix->yy;
         }
 
diff --git a/src/type1z/t1gload.c b/src/type1z/t1gload.c
index 71a7173..9fbb56f 100644
--- a/src/type1z/t1gload.c
+++ b/src/type1z/t1gload.c
@@ -1349,6 +1349,9 @@
           metrics->vertAdvance  = FT_MulFix( metrics->vertAdvance,  x_scale );
         }
 
+        /* apply the font matrix */
+        FT_Outline_Transform( &glyph->root.outline, &face->type1.font_matrix );
+
         /* compute the other metrics */
         FT_Outline_Get_CBox( &glyph->root.outline, &cbox );
 
diff --git a/src/type1z/t1parse.c b/src/type1z/t1parse.c
index b7d9506..3ce8086 100644
--- a/src/type1z/t1parse.c
+++ b/src/type1z/t1parse.c
@@ -579,6 +579,43 @@
     return t1_tobool( &parser->cursor, parser->limit );
   }
 
+
+#if 0
+  /* load a single field in an object */
+  LOCAL_FUNC
+  T1_Error  T1_Load_Field( T1_Parser*     parser,
+                           void*          object,
+                           T1_Field_Rec*  field )
+  {
+    FT_Byte*  p       = (FT_Byte*)object + field->offset;
+    FT_Byte** pcursor = &parser->cursor;
+    FT_Byte*  limit   = parser->limit;
+    
+    switch (field->type)
+    {
+      case t1_field_boolean:
+        *(T1_Bool*)p = t1_tobool( pcursor, limit );
+        break;
+        
+      case t1_field_string:
+        *(T1_String**)p = t1_tostring( pcursor, limit, parser->memory );
+        break;
+        
+      case t1_field_int:
+        *(T1_Long*)p = t1_toint( pcursor, limit );
+        break;
+        
+      case t1_field_fixed:
+        *(T1_Fixed*)p = t1_tofixed( pcursor, limit, field->power_ten );
+        break;
+        
+      default:
+        return T1_Err_Invalid_Argument;
+    }
+    return 0;
+  }                           
+#endif
+
   static
   FT_Error  read_pfb_tag( FT_Stream  stream, T1_UShort *tag, T1_Long*  size )
   {
diff --git a/src/type1z/t1parse.h b/src/type1z/t1parse.h
index 6482d52..0dd7a89 100644
--- a/src/type1z/t1parse.h
+++ b/src/type1z/t1parse.h
@@ -37,6 +37,30 @@
   extern "C" {
 #endif
 
+
+  typedef enum T1_Field_Type_
+  {
+    t1_field_none = 0,
+    t1_field_bool,
+    t1_field_integer,
+    t1_field_fixed,
+    t1_field_string,
+    t1_field_fixed_array,
+    t1_field_coord_array
+    
+  } T1_Field_Type;
+  
+  
+  typedef struct T1_Field_Rec_
+  {
+    T1_Field_Type  type;      /* type of field                        */
+    FT_UInt        offset;    /* offset of field in object            */
+    FT_UInt        size;      /* size of field in bytes               */
+    T1_Int         array_max; /* maximum number of elements for array */
+    T1_Int         power_ten; /* power of ten for "fixed" fields      */
+    
+  } T1_Field_Rec;
+  
 /*************************************************************************
  *
  * <Struct> T1_Table
@@ -183,6 +207,14 @@
   T1_Int  T1_ToImmediate( T1_Parser*  parser );
 #endif
 
+#if 0
+  /* load a single field in an object */
+  LOCAL_DEF
+  T1_Error  T1_Load_Field( T1_Parser*     parser,
+                           void*          object,
+                           T1_Field_Rec*  field );
+#endif
+
   LOCAL_DEF
   T1_Error  T1_New_Parser( T1_Parser*  parser,
                            FT_Stream   stream,