shithub: freetype+ttf2subf

Download patch

ref: 1ab77fdfffe083dea6e5e9e657d4447632ee1949
parent: 1a3e3d6a0dc1b4ac7e31313887d6ffb6ee454dcf
author: David Turner <[email protected]>
date: Thu Feb 10 13:08:17 EST 2000

some updates to make everything compile clean

git/fs: mount .git/fs: mount/attach disallowed
--- a/src/psnames/rules.mk
+++ b/src/psnames/rules.mk
@@ -76,11 +76,9 @@
 #
 #   All objects are recompiled if any of the header files is changed
 #
-$(OBJ_)tt%.$O: $(PSNAMES_DIR_)tt%.c $(BASE_H) $(SHARED_H) $(PSNAMES_DRV_H)
+$(OBJ_)ps%.$O: $(PSNAMES_DIR_)ps%.c $(BASE_H) $(SHARED_H) $(PSNAMES_DRV_H)
 	$(PSNAMES_COMPILE) $T$@ $<
 
-$(OBJ_)sf%.$O: $(PSNAMES_DIR_)sf%.c $(BASE_H) $(SHARED_H) $(PSNAMES_DRV_H)
-	$(PSNAMES_COMPILE) $T$@ $<
 
 # update main driver object lists
 #
--- a/src/truetype/ttconfig.h
+++ b/src/truetype/ttconfig.h
@@ -37,7 +37,7 @@
   /* By undefining this, you'll only compile the code necessary to load    */
   /* TrueType glyphs without hinting..                                     */
   /*                                                                       */
-#undef  TT_CONFIG_OPTION_BYTECODE_INTERPRETER
+#define  TT_CONFIG_OPTION_BYTECODE_INTERPRETER
 
   /*************************************************************************/
   /*                                                                       */
@@ -57,7 +57,7 @@
   /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support       */
   /* embedded bitmaps in the TrueType/OpenType driver.                     */
   /*                                                                       */
-#undef  TT_CONFIG_OPTION_EMBEDDED_BITMAPS
+#define  TT_CONFIG_OPTION_EMBEDDED_BITMAPS
 
 
   /*************************************************************************/
@@ -66,7 +66,7 @@
   /* load and enumerate the glyph Postscript names in a TrueType or        */
   /* OpenType file.                                                        */
   /*                                                                       */
-#undef  TT_CONFIG_OPTION_POSTSCRIPT_NAMES
+#define  TT_CONFIG_OPTION_POSTSCRIPT_NAMES
 
   /* The maximum number of sub-glyphs in a TrueType composite glyph */
 #define TT_MAX_SUBGLYPHS  32
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -20,8 +20,12 @@
 #include <ftsystem.h>
 #include <ftcalc.h>
 
+#include <ttobjs.h>
 #include <ttinterp.h>
 
+#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
+
+
 #define TT_MULFIX   FT_MulFix
 #define TT_MULDIV   FT_MulDiv
 
@@ -7964,5 +7968,6 @@
 
 #endif /* DEBUG_INTERPRETER */
 
+#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
 
 /* END */
--- a/src/type1/t1afm.c
+++ b/src/type1/t1afm.c
@@ -142,7 +142,7 @@
       goto Exit;
     
     /* allocate the pairs */
-    if ( ALLOC(       afm, sizeof(*afm )                     ||
+    if ( ALLOC(       afm, sizeof(*afm ) )                   ||
          ALLOC_ARRAY( afm->kern_pairs, count, T1_Kern_Pair ) )
       goto Exit;
     
@@ -151,7 +151,7 @@
     afm->num_pairs = count;
     
     /* save in face object */
-    ((T1_Face*)t1_face)->afm_data = afm;
+    ((T1_Face)t1_face)->afm_data = afm;
 
     for ( p = start; p < limit-3; p++ )
     {
--- a/src/type1/t1config.h
+++ b/src/type1/t1config.h
@@ -40,7 +40,7 @@
 /* Define T1_CONFIG_OPTION_DISABLE_HINTER if you want to generate  */
 /* a driver with no hinter. This can be useful to debug the parser */
 /*                                                                 */
-#define T1_CONFIG_OPTION_DISABLE_HINTER
+#undef  T1_CONFIG_OPTION_DISABLE_HINTER
 
 /* Define this configuration macro if you want to prevent the      */
 /* compilation of "t1afm", which is in charge of reading Type1     */
@@ -47,6 +47,6 @@
 /* AFM files into an existing face. Note that when set, the T1     */
 /* driver will be unable to produce kerning distances..            */
 /*                                                                 */
-#define T1_CONFIG_OPTION_NO_AFM
+#undef  T1_CONFIG_OPTION_NO_AFM
 
 #endif /* T1CONFIG_H */
--- a/src/type1/t1driver.c
+++ b/src/type1/t1driver.c
@@ -55,8 +55,8 @@
   /*    time).                                                             */
   /*                                                                       */
   static
-  void*  Get_Interface)( FT_Driver         driver,
-                         const FT_String*  interface )
+  void*  Get_Interface( FT_Driver         driver,
+                        const FT_String*  interface )
   {
     if ( strcmp( (const char*)interface, "attach_file" ) == 0 )
       return T1_Read_AFM;
@@ -140,35 +140,11 @@
                             T1_UInt      horz_resolution,
                             T1_UInt      vert_resolution )
   {
-    FT_Size_Metrics*  metrics;
-    T1_Face           face;
-  
-    if (!size)
-      return T1_Err_Invalid_Size_Handle;
-    
-    if ( char_width  < 1*64 ) char_width = 1*64;
-    if ( char_height < 1*64 ) char_height = 1*64;
+    UNUSED(char_width);
+    UNUSED(horz_resolution);
+    UNUSED(vert_resolution);
 
-    metrics = &size->root.metrics;
-    face    = (T1_Face)size->root.face;
-    
-    metrics->x_ppem = ( char_width  * horz_resolution + 36 )/72;
-    metrics->y_ppem = ( char_height * vert_resolution + 36 )/72;
-    
-    metrics->x_ppem = ( metrics->x_ppem + 32 ) & -64;
-    metrics->y_ppem = ( metrics->y_ppem + 32 ) & -64;
-    
-    metrics->x_scale = FT_MulDiv( metrics->x_ppem, 0x10000,
-                                  face->root.units_per_EM );
-    
-    metrics->y_scale = FT_MulDiv( metrics->y_ppem, 0x10000,
-                                  face->root.units_per_EM );
-
-    metrics->x_ppem >>= 6;
-    metrics->y_ppem >>= 6;
-    
     size->valid = FALSE;
-
     return T1_Reset_Size( size );
   }
 
@@ -203,32 +179,12 @@
                              T1_Int      pixel_width,
                              T1_Int      pixel_height )
   {
-    FT_Size_Metrics*   metrics;
-    T1_Face            face;
-  
-    if (!size)
-      return T1_Err_Invalid_Size_Handle;
-    
-    if ( pixel_width  < 1 ) pixel_width = 1;
-    if ( pixel_height < 1 ) pixel_height = 1;
-  
-    metrics = &size->root.metrics;
-    face    = (T1_Face)size->root.face;
-  
-    metrics->x_ppem    = pixel_width;
-    metrics->y_ppem    = pixel_height;
-  
-    metrics->x_scale = FT_MulDiv( metrics->x_ppem * 64,
-                                  0x10000, face->root.units_per_EM );
-  
-    metrics->y_scale = FT_MulDiv( metrics->y_ppem * 64,
-                                  0x10000, face->root.units_per_EM );
-  
-    size->valid = 0;
-  
+    UNUSED(pixel_width);
+    UNUSED(pixel_height);
+
+    size->valid = FALSE; 
     return T1_Reset_Size(size);
   }
-
 
   /*************************************************************************/
   /*                                                                       */
--- a/src/type1/t1gload.c
+++ b/src/type1/t1gload.c
@@ -1421,11 +1421,10 @@
     glyph->root.outline.n_points   = 0;
     glyph->root.outline.n_contours = 0;
 
-    hinting = ( load_flags & FT_LOAD_NO_SCALE   ) == 0 &&
-              ( load_flags & FT_LOAD_NO_HINTING ) == 0;
-
     glyph->root.format = ft_glyph_format_none;
 
+    hinting = 0;
+
 #ifndef T1_CONFIG_OPTION_DISABLE_HINTER
     /*****************************************************************/
     /*                                                               */
@@ -1441,6 +1440,8 @@
     /*    Then, a second pass is performed to load the outline       */
     /*    points as well as hint/scale them correctly.               */
     /*                                                               */
+
+    hinting = (load_flags & (FT_LOAD_NO_SCALE|FT_LOAD_NO_HINTING)) == 0;
 
     if ( hinting )
     {
--- a/src/type1/type1.c
+++ b/src/type1/type1.c
@@ -28,16 +28,6 @@
 /***************************************************************************/
 
 
-
-#if 0
-#define FT_MAKE_OPTION_SINGLE_OBJECT
-#include <t1driver.c>   /* driver interface  */
-#include <t1objs.c>     /* object manager    */
-#include <t1load.c>     /* table loader      */
-#include <t1hint.c>     /* hinter            */
-#include <t1gload.c>    /* glyph loader      */
-#endif
-
 #include <t1driver.c>
 #include <t1objs.c>
 #include <t1load.c>     /* table loader      */