shithub: freetype+ttf2subf

Download patch

ref: 8b88466061a85ea3f4ae6753f88cf6fe94cabd1c
parent: f35ff8013254552d5f9d5ea347de24dd645f1c98
author: Werner Lemberg <[email protected]>
date: Tue Jun 3 07:51:43 EDT 2003

* src/autohint/ahhint.c (ah_hinter_hint_edges): Removed.  Just a
wrapper for ah_hint_edges.
(ah_hint_edges): Renamed to...
(ah_hinter_hint_edges): This.

* src/base/ftobjs.c (FT_Set_Hint_Flags): Removed.  Unused.

* include/freetype/internal/ftobjs.h (FT_Face_InternalRec),
include/freetype/internal/psaux.h (T1_DecoderRec),
src/cff/cffgload.h (CFF_Builder): Remove `hint_flags' field.
Unused.

* src/cff/cffgload.c (cff_builder_init): Updated.
(cff_decoder_parse_charstrings) <cff_op_endchar>: Call hinter->apply
with decoder->hint_mode instead of builder->hint_flags.
* src/psaux/t1decode.c (t1_decoder_init): Updated.

* src/base/ftstroker.c (ft_stroke_border_export): s/index/idx/.

* src/sfnt/sfobjs.c (sfnt_load_face): Commented out code which
increased root->height by 15% if the line gap was zero.  There exist
fonts (containing e.g. form drawing characters) which intentionally
have a zero line gap value.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+2003-06-03  Werner Lemberg  <[email protected]>
+
+	* src/autohint/ahhint.c (ah_hinter_hint_edges): Removed.  Just a
+	wrapper for ah_hint_edges.
+	(ah_hint_edges): Renamed to...
+	(ah_hinter_hint_edges): This.
+
+	* src/base/ftobjs.c (FT_Set_Hint_Flags): Removed.  Unused.
+
+	* include/freetype/internal/ftobjs.h (FT_Face_InternalRec),
+	include/freetype/internal/psaux.h (T1_DecoderRec),
+	src/cff/cffgload.h (CFF_Builder): Remove `hint_flags' field. 
+	Unused.
+
+	* src/cff/cffgload.c (cff_builder_init): Updated.
+	(cff_decoder_parse_charstrings) <cff_op_endchar>: Call hinter->apply
+	with decoder->hint_mode instead of builder->hint_flags.
+	* src/psaux/t1decode.c (t1_decoder_init): Updated.
+
+	* src/base/ftstroker.c (ft_stroke_border_export): s/index/idx/.
+
+	* src/sfnt/sfobjs.c (sfnt_load_face): Commented out code which
+	increased root->height by 15% if the line gap was zero.  There exist
+	fonts (containing e.g. form drawing characters) which intentionally
+	have a zero line gap value.
+
 2003-06-02  Werner Lemberg  <[email protected]>
 
 	* src/cff/cffobjs.c (cff_face_init): Use symbolic names for
--- a/include/freetype/internal/ftobjs.h
+++ b/include/freetype/internal/ftobjs.h
@@ -296,9 +296,6 @@
   /*    transform_flags  :: Some flags used to classify the transform.     */
   /*                        Only used by the convenience functions.        */
   /*                                                                       */
-  /*    hint_flags       :: Some flags used to change the hinters'         */
-  /*                        behaviour.  Only used for debugging for now.   */
-  /*                                                                       */
   /*    postscript_name  :: Postscript font name for this face.            */
   /*                                                                       */
   /*    incremental_interface ::                                           */
@@ -317,8 +314,6 @@
     FT_Matrix    transform_matrix;
     FT_Vector    transform_delta;
     FT_Int       transform_flags;
-
-    FT_UInt32    hint_flags;
 
     const char*  postscript_name;
 
--- a/include/freetype/internal/psaux.h
+++ b/include/freetype/internal/psaux.h
@@ -664,7 +664,6 @@
 
     PS_Blend             blend;       /* for multiple master support */
 
-    FT_UInt32            hint_flags;
     FT_Render_Mode       hint_mode;
 
     T1_Decoder_Callback  parse_callback;
--- a/include/freetype/internal/pshints.h
+++ b/include/freetype/internal/pshints.h
@@ -6,7 +6,7 @@
 /*    recorders (specification only).  These are used to support native    */
 /*    T1/T2 hints in the "type1", "cid" and "cff" font drivers.            */
 /*                                                                         */
-/*  Copyright 2001, 2002 by                                                */
+/*  Copyright 2001, 2002, 2003 by                                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -261,13 +261,13 @@
   /*    been recorded.                                                     */
   /*                                                                       */
   /* @input:                                                               */
-  /*   hints      :: A handle to the Type 1 hints recorder.                */
+  /*   hints     :: A handle to the Type 1 hints recorder.                 */
   /*                                                                       */
-  /*   outline    :: A pointer to the target outline descriptor.           */
+  /*   outline   :: A pointer to the target outline descriptor.            */
   /*                                                                       */
-  /*   globals    :: The hinter globals for this font.                     */
+  /*   globals   :: The hinter globals for this font.                      */
   /*                                                                       */
-  /*   hint_flags :: Hinter bit flags.                                     */
+  /*   hint_mode :: Hinting information.                                   */
   /*                                                                       */
   /* @return:                                                              */
   /*   FreeType error code.  0 means success.                              */
@@ -542,13 +542,13 @@
   /*    method.                                                            */
   /*                                                                       */
   /* @input:                                                               */
-  /*    hints      :: A handle to the Type 2 hints recorder.               */
+  /*    hints     :: A handle to the Type 2 hints recorder.                */
   /*                                                                       */
-  /*    outline    :: A pointer to the target outline descriptor.          */
+  /*    outline   :: A pointer to the target outline descriptor.           */
   /*                                                                       */
-  /*    globals    :: The hinter globals for this font.                    */
+  /*    globals   :: The hinter globals for this font.                     */
   /*                                                                       */
-  /*    hint_flags :: Hinter bit flags.                                    */
+  /*    hint_mode :: Hinting information.                                  */
   /*                                                                       */
   /* @return:                                                              */
   /*   FreeType error code.  0 means success.                              */
--- a/src/autohint/ahhint.c
+++ b/src/autohint/ahhint.c
@@ -421,8 +421,8 @@
   /*************************************************************************/
 
 
-  static void
-  ah_hint_edges( AH_Hinter  hinter )
+  FT_LOCAL_DEF( void )
+  ah_hinter_hint_edges( AH_Hinter  hinter )
   {
     AH_Edge     edges;
     AH_Edge     edge_limit;
@@ -785,18 +785,6 @@
     Next_Dimension:
       edges      = outline->vert_edges;
       edge_limit = edges + outline->num_vedges;
-    }
-  }
-
-
-  FT_LOCAL_DEF( void )
-  ah_hinter_hint_edges( AH_Hinter  hinter )
-  {
-    /* AH_Interpolate_Blue_Edges( hinter ); -- doesn't seem to help      */
-    /* reduce the problem of the disappearing eye in the `e' of Times... */
-    /* also, creates some artifacts near the blue zones?                 */
-    {
-      ah_hint_edges( hinter );
     }
   }
 
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -427,24 +427,6 @@
   }
 
 
-  /* documentation is in freetype.h */
-
-  FT_EXPORT_DEF( void )
-  FT_Set_Hint_Flags( FT_Face   face,
-                     FT_ULong  flags )
-  {
-    FT_Face_Internal  internal;
-
-
-    if ( !face )
-      return;
-
-    internal = face->internal;
-
-    internal->hint_flags = (FT_UInt)flags;
-  }
-
-
   static FT_Renderer
   ft_lookup_glyph_renderer( FT_GlyphSlot  slot );
 
--- a/src/base/ftstroker.c
+++ b/src/base/ftstroker.c
@@ -578,14 +578,14 @@
       FT_UInt    count = border->num_points;
       FT_Byte*   tags  = border->tags;
       FT_Short*  write = outline->contours + outline->n_contours;
-      FT_Short   index = (FT_Short)outline->n_points;
+      FT_Short   idx   = (FT_Short)outline->n_points;
 
 
-      for ( ; count > 0; count--, tags++, index++ )
+      for ( ; count > 0; count--, tags++, idx++ )
       {
         if ( *tags & FT_STROKE_TAG_END )
         {
-          *write++ = index;
+          *write++ = idx;
           outline->n_contours++;
         }
       }
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -246,7 +246,6 @@
       builder->current = &loader->current.outline;
       FT_GlyphLoader_Rewind( loader );
 
-      builder->hint_flags    = FT_FACE(face)->internal->hint_flags;
       builder->hints_globals = 0;
       builder->hints_funcs   = 0;
 
@@ -1770,7 +1769,7 @@
             hinter->apply( hinter->hints,
                            builder->current,
                            (PSH_Globals)builder->hints_globals,
-                           builder->hint_flags );
+                           decoder->hint_mode );
           }
 
           /* add current outline to the glyph slot */
--- a/src/cff/cffgload.h
+++ b/src/cff/cffgload.h
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    OpenType Glyph Loader (specification).                               */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002 by                                           */
+/*  Copyright 1996-2001, 2002, 2003 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -113,8 +113,6 @@
 
     FT_Error        error;         /* only used for memory errors */
     FT_Bool         metrics_only;
-
-    FT_UInt32       hint_flags;
 
     void*           hints_funcs;    /* hinter-specific */
     void*           hints_globals;  /* hinter-specific */
--- a/src/psaux/t1decode.c
+++ b/src/psaux/t1decode.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    PostScript Type 1 decoding routines (body).                          */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002 by                                           */
+/*  Copyright 2000-2001, 2002, 2003 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -1148,7 +1148,6 @@
 
     decoder->num_glyphs     = (FT_UInt)face->num_glyphs;
     decoder->glyph_names    = glyph_names;
-    decoder->hint_flags     = face->internal->hint_flags;
     decoder->hint_mode      = hint_mode;
     decoder->blend          = blend;
     decoder->parse_callback = parse_callback;
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -708,10 +708,12 @@
         root->height    = (FT_Short)( root->ascender - root->descender +
                                       face->horizontal.Line_Gap );
 
+#if 0
         /* if the line_gap is 0, we add an extra 15% to the text height --  */
         /* this computation is based on various versions of Times New Roman */
         if ( face->horizontal.Line_Gap == 0 )
           root->height = (FT_Short)( ( root->height * 115 + 50 ) / 100 );
+#endif
 
 #if 0