shithub: freetype+ttf2subf

Download patch

ref: b442ca17130e5d103f299440419e5ea3ad1f9fd3
parent: 5e6b9edc89368709d32ea02e6cc71da113a8d984
author: Werner Lemberg <[email protected]>
date: Wed Apr 23 11:50:27 EDT 2003

Cleanups.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -64,10 +64,8 @@
 	* src/type1/t1load.c (is_name_char): The Type 1 loader now accepts
 	more general names according to the PostScript specification (the
 	previous one was too restrictive).
-
 	(parse_font_name, parse_encoding, parse_charstrings, parse_dict):
 	Use `is_name_char'.
-
 	(parse_subrs): Handle empty arrays.
 
 2003-03-20  David Turner  <[email protected]>
@@ -145,7 +143,7 @@
 2003-03-14  David Turner  <[email protected]>
 
 	* src/truetype/ttdriver.c (Set_Char_Sizes): Fixing the small
-	TrueType native rendering glitches, they came from a small rounding
+	TrueType native rendering glitches; they came from a small rounding
 	error.
 
 2003-03-13  David Turner  <[email protected]>
@@ -204,8 +202,7 @@
 
 	* src/gzip/ftgzip.c (ft_gzip_file_fill_output): Fixed a bug that
 	caused FreeType to loop endlessly when trying to read certain
-	compressed gzip files.  The following test could be used to reveal
-	the bug:
+	compressed gzip files.  The following test reveals the bug:
 
 	  touch 0123456789 ; gzip 0123456789 ; ftdump 0123456789.gz
 
@@ -271,7 +268,7 @@
 
 	Changed the incremental loading interface in a way that makes it
 	simpler and allows glyph metrics to be changed (e.g., by adding a
-	constant, as required by CFF fonts) rather than just overridden. 
+	constant, as required by CFF fonts) rather than just overridden.
 	This was required to make the GhostScript-to-FreeType bridge work.
 
 	* src/cff/cffgload.c (cff_slot_load) [FT_CONFIG_OPTION_INCREMENTAL]:
@@ -405,9 +402,11 @@
 
 	* include/freetype/config/ftheader.h (FT_WINFONTS_H): New macro
 	for ftwinfnt.h.
-	* include/freetype/internal/fnttypes.h: Move Windows FNT definition
-	to...
+	* include/freetype/internal/fnttypes.h: Include FT_WINFONTS_H.
+	(FNT_FontRec): Updated.
+	Move Windows FNT definition to...
 	* include/freetype/ftwinfnt.h: This new file.
+	(FT_WinFNT_HeaderRec): Rename `reserved2' to `reserved1'.
 	* src/base/ftwinfnt.c: New file, providing `FT_Get_WinFNT_Header'.
 	* src/winfonts/winfnt.c (winfnt_header_fields): Updated.
 	Rename `reserved2' to `reserved1'.
@@ -434,7 +433,7 @@
 
 2003-01-11  David Chester  <[email protected]>
 
-	Patches to the auto-hinter in order to slightly improve the output. 
+	Patches to the auto-hinter in order to slightly improve the output.
 	Note that everything is controlled through the new
 	FT_CONFIG_OPTION_CHESTER_HINTS defined in "ftoption.h".  There are
 	also individual FT_CONFIG_CHESTER_XXX macros to control individual
@@ -474,8 +473,8 @@
 
 2003-01-11  David Turner  <[email protected]>
 
-	* include/freetype/internal/fnttypes.h: Fixed a structure field
-	definition to avoid memory overwrites.
+	* include/freetype/internal/fnttypes.h (WinFNT_HeaderRec): Increase
+	size of `reserved2' to avoid memory overwrites.
 
 2003-01-08  Huw Dawies  <[email protected]>
 
@@ -572,10 +571,9 @@
 
 	* src/base/ftobjs.c (find_unicode_charmap): Added some comments to
 	better explain what's happening there.
+	(open_face): Included Graham Asher's fix to prevent faces without
+	Unicode charmaps from loading.
 
-	* src/base/ftobjs.c (open_face): Included Graham Asher's fix to
-	prevent faces without Unicode charmaps from loading.
-
 	* src/winfonts/winfnt.c: Included George Williams's fix to support
 	version 2 fonts correctly.
 	(winfnt_header_fields): Updated.
@@ -663,7 +661,7 @@
 	the use of system-wide zlib.
 
 	Note that this macro, as well as
-	FT_CONFIG_OPTION_BYTECODE_INTERPRETER, is not #undef-ed anymore. 
+	FT_CONFIG_OPTION_BYTECODE_INTERPRETER, is not #undef-ed anymore.
 	This allows the build system to define them depending on the
 	configuration (typically by adding -D flags at compile time).
 
@@ -753,7 +751,7 @@
 
 2002-10-30  David Turner  <[email protected]>
 
-	* FreeType 2.1.3rc3 released
+	* FreeType 2.1.3rc3 released.
 
 2002-10-25  David Turner  <[email protected]>
 
--- a/src/sfnt/ttload.c
+++ b/src/sfnt/ttload.c
@@ -5,7 +5,7 @@
 /*    Load the basic TrueType tables, i.e., tables that can be either in   */
 /*    TTF or OTF fonts (body).                                             */
 /*                                                                         */
-/*  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,       */
@@ -213,13 +213,13 @@
 
         has_head = 1;
 
-       /* the table length should be 0x36, but certain font tools
-        * make it 0x38, so we will just check that it is greater.
-        *
-        * note that according to the specification,
-        * the table must be padded to 32-bit lengths, but this doesn't
-        * apply to the value of its "Length" field !!
-        */
+        /* The table length should be 0x36, but certain font tools
+         * make it 0x38, so we will just check that it is greater.
+         *
+         * Note that according to the specification,
+         * the table must be padded to 32-bit lengths, but this doesn't
+         * apply to the value of its "Length" field!
+         */
         if ( table.Length < 0x36                 ||
              FT_STREAM_SEEK( table.Offset + 12 ) ||
              FT_READ_ULONG( magic )              ||
@@ -840,16 +840,16 @@
       {
 
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
-      /* If this is an incrementally loaded font and there are    */
-      /* overriding metrics tolerate a missing 'hmtx' table.      */
+        /* If this is an incrementally loaded font and there are */
+        /* overriding metrics tolerate a missing 'hmtx' table.   */
         if ( face->root.internal->incremental_interface &&
              face->root.internal->incremental_interface->funcs->
-                 get_glyph_metrics )
+               get_glyph_metrics )
         {
           face->horizontal.number_Of_HMetrics = 0;
           error = SFNT_Err_Ok;
           goto Exit;
-	    }
+        }
 #endif
 
         FT_ERROR(( " no horizontal metrics in file!\n" ));
--- a/src/sfnt/ttsbit.c
+++ b/src/sfnt/ttsbit.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType and OpenType embedded bitmap support (body).                */
 /*                                                                         */
-/*  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,       */
@@ -1232,9 +1232,9 @@
     if ( error )
       goto Exit;
 
-    /* this function is recursive.  At the top-level call, we  */
+    /* This function is recursive.  At the top-level call, we  */
     /* compute the dimensions of the higher-level glyph to     */
-    /* allocate the final pixmap buffer                        */
+    /* allocate the final pixmap buffer.                       */
     if ( depth == 0 )
     {
       FT_Long  size;
@@ -1355,7 +1355,7 @@
                                  y_offset + comp->y_offset,
                                  stream,
                                  &elem_metrics,
-                                 depth+1 );
+                                 depth + 1 );
         if ( error )
           goto Fail_Memory;
       }
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    A new `perfect' anti-aliasing renderer (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,       */
--- a/src/truetype/ttdriver.c
+++ b/src/truetype/ttdriver.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType font driver implementation (body).                          */
 /*                                                                         */
-/*  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,       */
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType Glyph Loader (body).                                        */
 /*                                                                         */
-/*  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,       */
@@ -823,9 +823,10 @@
       {
         FT_Incremental_MetricsRec  metrics;
 
-		metrics.bearing_x = left_bearing;
-		metrics.bearing_y = 0;
-		metrics.advance = advance_width;
+
+        metrics.bearing_x = left_bearing;
+        metrics.bearing_y = 0;
+        metrics.advance = advance_width;
         error = face->root.internal->incremental_interface->funcs->get_glyph_metrics(
                   face->root.internal->incremental_interface->object,
                   glyph_index, FALSE, &metrics );
@@ -1066,7 +1067,7 @@
           num_base_points = gloader->base.outline.n_points;
 
           error = load_truetype_glyph( loader, subglyph->index,
-                                       recurse_count+1 );
+                                       recurse_count + 1 );
           if ( error )
             goto Fail;
 
@@ -1492,9 +1493,10 @@
         FT_Incremental_MetricsRec  metrics;
         FT_Error                   error = 0;
 
-		metrics.bearing_x = 0;
-		metrics.bearing_y = top_bearing;
-		metrics.advance = advance_height;
+
+        metrics.bearing_x = 0;
+        metrics.bearing_y = top_bearing;
+        metrics.advance = advance_height;
         error =
           face->root.internal->incremental_interface->funcs->get_glyph_metrics(
             face->root.internal->incremental_interface->object,
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType bytecode interpreter (body).                                */
 /*                                                                         */
-/*  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,       */
--- a/src/truetype/ttobjs.c
+++ b/src/truetype/ttobjs.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Objects manager (body).                                              */
 /*                                                                         */
-/*  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,       */
@@ -69,6 +69,7 @@
   tt_glyphzone_done( TT_GlyphZone  zone )
   {
     FT_Memory  memory = zone->memory;
+
 
     if ( memory )
     {
--- a/src/truetype/ttobjs.h
+++ b/src/truetype/ttobjs.h
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Objects manager (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,       */
@@ -311,7 +311,7 @@
   {
     FT_SizeRec         root;
 
-    FT_Size_Metrics    metrics;    /* slightly different from the root metrics */
+    FT_Size_Metrics    metrics; /* slightly different from the root metrics */
     TT_Size_Metrics    ttmetrics;
 
 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
--- a/src/type1/t1gload.c
+++ b/src/type1/t1gload.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 1 Glyph Loader (body).                                          */
 /*                                                                         */
-/*  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,       */
@@ -98,8 +98,8 @@
       FT_Incremental_MetricsRec  metrics;
 
       metrics.bearing_x = decoder->builder.left_bearing.x;
-	  metrics.bearing_y = decoder->builder.left_bearing.y;
-	  metrics.advance   = decoder->builder.advance.x;
+      metrics.bearing_y = decoder->builder.left_bearing.y;
+      metrics.advance   = decoder->builder.advance.x;
       error = face->root.internal->incremental_interface->funcs->get_glyph_metrics(
                 face->root.internal->incremental_interface->object,
                 glyph_index, FALSE, &metrics );
@@ -130,7 +130,7 @@
       T1_Face  face = (T1_Face)decoder->builder.face;
 
 
-	  if ( face->root.internal->incremental_interface )
+      if ( face->root.internal->incremental_interface )
         face->root.internal->incremental_interface->funcs->free_glyph_data(
           face->root.internal->incremental_interface->object,
           &glyph_data );
--- a/src/type1/t1load.c
+++ b/src/type1/t1load.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 1 font loader (body).                                           */
 /*                                                                         */
-/*  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,       */
@@ -1793,9 +1793,9 @@
             }
           }
       }
-     /* yes, this happens, certain PDF-embedded fonts have only a ".notdef"
-      * glyph defined !
-      */
+      /* Yes, this happens: Certain PDF-embedded fonts have only a ".notdef"
+       * glyph defined!
+       */
       if ( min_char > max_char )
       {
         min_char = 0;
--- a/src/type42/t42objs.c
+++ b/src/type42/t42objs.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 42 objects manager (body).                                      */
 /*                                                                         */
-/*  Copyright 2002 by Roberto Alameda.                                     */
+/*  Copyright 2002, 2003 by Roberto Alameda.                               */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  modified, and distributed under the terms of the FreeType project      */
--- a/src/winfonts/winfnt.c
+++ b/src/winfonts/winfnt.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType font driver for Windows FNT/FON files                       */
 /*                                                                         */
-/*  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,       */
@@ -618,7 +618,7 @@
 
     /* allocate and build bitmap */
     {
-      FT_Int     pitch  = ( bitmap->width + 7 ) >> 3;
+      FT_Int  pitch  = ( bitmap->width + 7 ) >> 3;
 
 
       bitmap->pitch      = pitch;