shithub: freetype+ttf2subf

Download patch

ref: 1a293d6c7331600d6acd219d183120ff7d96fdd7
parent: 8d81d41ae3373c830cf8a41f0da430fb0608c4a6
author: Werner Lemberg <wl@gnu.org>
date: Fri Nov 18 03:23:06 EST 2005

* src/sfnt/ttload.c (tt_face_load_metrics): Ignore excess number
of metrics instead of aborting.  Patch suggested by Derek Noonburg.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-11-18  Werner Lemberg  <wl@gnu.org>
+
+	* src/sfnt/ttload.c (tt_face_load_metrics): Ignore excess number
+	of metrics instead of aborting.  Patch suggested by Derek Noonburg.
+
 2005-11-18  susuzki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
 	* include/freetype/ftgxval.h, src/base/ftgxval.c
@@ -23,16 +28,15 @@
 
 2005-11-17  Detlef W�rkner  <TetiSoft@apg.lahn.de>
 
-	* builds/amiga/makefile,
-	builds/amiga/makefile.os4,
+	* builds/amiga/makefile, builds/amiga/makefile.os4,
 	builds/amiga/smakefile.os4,
 	builds/amiga/include/freetype/config/ftmodule.h: Updated the Amiga
-	build files (added support for the gxvalid module)
+	build files (added support for the gxvalid module).
 
 2005-11-17  Werner Lemberg  <wl@gnu.org>
 
 	Add vertical metrics support to OpenType CFF outlines.  Based on a
-	patch from Mike Moening <MikeM@RetekSolutions.com>
+	patch from Mike Moening <MikeM@RetekSolutions.com>.
 
 	* src/cff/cffgload.c (cff_face_get_vertical_metrics): New function.
 	(cff_slot_load): Use cff_face_get_vertical_metrics.
--- a/builds/unix/ftsystem.c
+++ b/builds/unix/ftsystem.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Unix-specific FreeType low-level system interface (body).            */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2004 by                                     */
+/*  Copyright 1996-2001, 2002, 2004, 2005 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
--- a/builds/vms/ftsystem.c
+++ b/builds/vms/ftsystem.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    VMS-specific FreeType low-level system interface (body).             */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002 by                                           */
+/*  Copyright 1996-2001, 2002, 2005 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
--- a/builds/win32/ftdebug.c
+++ b/builds/win32/ftdebug.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Debugging and logging component for Win32 (body).                    */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002 by                                           */
+/*  Copyright 1996-2001, 2002, 2005 by                                     */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
--- a/include/freetype/ftgxval.h
+++ b/include/freetype/ftgxval.h
@@ -206,10 +206,10 @@
   *   otherwise.
   *
   *   After use, the application should deallocate the buffers pointed to by
-  *   each tables' element, by calling FT_TrueTypeGX_Free(). A NULL value
-  *   indicates that the table either doesn't exist in the font,
-  *   the application hasn't asked for validation, or the validator doesn't
-  *   have the ability to validate the sfnt table.
+  *   each `tables' element, by calling FT_TrueTypeGX_Free().  A NULL value
+  *   indicates that the table either doesn't exist in the font, the
+  *   application hasn't asked for validation, or the validator doesn't have
+  *   the ability to validate the sfnt table.
   */
   FT_EXPORT( FT_Error )
   FT_TrueTypeGX_Validate( FT_Face   face,
@@ -310,8 +310,8 @@
   *
   * @note:
   *   After use, the application should deallocate the buffers pointed to by
-  *   ckern_table, by calling FT_ClassicKern_Free(). A NULL value indicates
-  *   that the table doesn't exist in the font.
+  *   `ckern_table', by calling FT_ClassicKern_Free().  A NULL value
+  *   indicates that the table doesn't exist in the font.
   */
   FT_EXPORT( FT_Error )
   FT_ClassicKern_Validate( FT_Face    face,
--- a/include/freetype/ftotval.h
+++ b/include/freetype/ftotval.h
@@ -146,8 +146,8 @@
   *   This function only works with OpenType fonts, returning an error
   *   otherwise.
   *
-  *   After use, the application should deallocate the five tables by
-  *   FT_OpenType_Free(). A NULL value indicates that the table either
+  *   After use, the application should deallocate the five tables with
+  *   FT_OpenType_Free().  A NULL value indicates that the table either
   *   doesn't exist in the font, or the application hasn't asked for
   *   validation.
   */
--- a/src/sfnt/ttload.c
+++ b/src/sfnt/ttload.c
@@ -972,9 +972,14 @@
                  vertical ? "Vertical"
                           : "Horizontal" ));
 
+      /* Adobe simply ignores this problem.  So we shall do the same. */
+#if 0
       error = vertical ? SFNT_Err_Invalid_Vert_Metrics
                        : SFNT_Err_Invalid_Horiz_Metrics;
       goto Exit;
+#else
+      num_shorts = 0;
+#endif
     }
 
     if ( FT_QNEW_ARRAY( *longs,  num_longs  ) ||