shithub: freetype+ttf2subf

Download patch

ref: 7bb7fedef169a95ee56ad112fe2be774c0409296
parent: 58c10b5a6b5139a66b61bbe589f4fd98ca803dc2
author: David Turner <[email protected]>
date: Mon Feb 28 06:23:36 EST 2000

fixed a bug which appeared when loading
unscaled composite glyphs

git/fs: mount .git/fs: mount/attach disallowed
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -532,7 +532,8 @@
         loader->pp2.x = FT_MulFix( loader->pp2.x, x_scale );
 
 #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
-      loader->exec->glyphSize = 0;
+      if (loader->exec)
+        loader->exec->glyphSize = 0;
 #endif
       goto Load_End;
     }
@@ -722,8 +723,13 @@
           num_base_points = loader->base.n_points;
           
           error = load_truetype_glyph( loader, subglyph->index );
-          if ((subglyph->flags & USE_MY_METRICS) == 0)
+          if ( subglyph->flags & USE_MY_METRICS )
           {
+            pp1 = loader->pp1;
+            pp2 = loader->pp2;
+          }
+          else
+          {
             loader->pp1 = pp1;
             loader->pp2 = pp2;
           }
@@ -818,7 +824,7 @@
 
 #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
         subglyph--;
-        if (num_subglyphs > 0 && subglyph->flags & WE_HAVE_INSTR)
+        if (num_subglyphs > 0 && loader->exec && subglyph->flags & WE_HAVE_INSTR)
         {
           TT_UShort       n_ins;
           TT_ExecContext  exec = loader->exec;
@@ -839,6 +845,9 @@
             return TT_Err_Too_Many_Ins;
           }
      
+          if (exec)
+          {
+          }
           /* read the instructions */
           if ( FILE_Read( exec->glyphIns, n_ins ) )
             goto Fail;
@@ -1117,7 +1126,8 @@
     }
 
 #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
-    glyph->outline.dropout_mode = (TT_Char)loader->exec->GS.scan_type;
+    if (loader->exec)
+      glyph->outline.dropout_mode = (TT_Char)loader->exec->GS.scan_type;
 #else
     glyph->outline.dropout_mode = 2;
 #endif
--- a/src/type1/t1afm.c
+++ b/src/type1/t1afm.c
@@ -108,8 +108,8 @@
 
  /* parse an AFM file - for now, only read the kerning pairs */
   LOCAL_FUNC
-  FT_Error  T1_Read_AFM( FT_Stream stream,
-                         FT_Face   t1_face )
+  FT_Error  T1_Read_AFM( FT_Face   t1_face,
+                         FT_Stream stream )
   {
     FT_Error       error;
     FT_Memory      memory = stream->memory;
@@ -121,7 +121,7 @@
     T1_Font*       type1 = &((T1_Face)t1_face)->type1;
     T1_AFM*        afm   = 0;
     
-    if ( !ACCESS_Frame(stream->size) )
+    if ( ACCESS_Frame(stream->size) )
       return error;
       
     start = (FT_Byte*)stream->cursor;