From 1a293d6c7331600d6acd219d183120ff7d96fdd7 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Fri, 18 Nov 2005 08:23:06 +0000 Subject: [PATCH] * src/sfnt/ttload.c (tt_face_load_metrics): Ignore excess number of metrics instead of aborting. Patch suggested by Derek Noonburg. --- ChangeLog | 12 ++++++++---- builds/unix/ftsystem.c | 2 +- builds/vms/ftsystem.c | 2 +- builds/win32/ftdebug.c | 2 +- include/freetype/ftgxval.h | 12 ++++++------ include/freetype/ftotval.h | 4 ++-- src/sfnt/ttload.c | 5 +++++ 7 files changed, 24 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index b4fdf8ae6..0269a9236 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-11-18 Werner Lemberg + + * 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 * include/freetype/ftgxval.h, src/base/ftgxval.c @@ -23,16 +28,15 @@ 2005-11-17 Detlef Würkner - * 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 Add vertical metrics support to OpenType CFF outlines. Based on a - patch from Mike Moening + patch from Mike Moening . * src/cff/cffgload.c (cff_face_get_vertical_metrics): New function. (cff_slot_load): Use cff_face_get_vertical_metrics. diff --git a/builds/unix/ftsystem.c b/builds/unix/ftsystem.c index 89212eb16..81a45eb15 100644 --- 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, */ diff --git a/builds/vms/ftsystem.c b/builds/vms/ftsystem.c index 2cbb3aa64..76bfae9f4 100644 --- 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, */ diff --git a/builds/win32/ftdebug.c b/builds/win32/ftdebug.c index 307bf2935..420b008b7 100644 --- 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, */ diff --git a/include/freetype/ftgxval.h b/include/freetype/ftgxval.h index fd999cc95..2fdcdb4c4 100644 --- a/include/freetype/ftgxval.h +++ b/include/freetype/ftgxval.h @@ -206,10 +206,10 @@ FT_BEGIN_HEADER * 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 @@ FT_BEGIN_HEADER * * @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, diff --git a/include/freetype/ftotval.h b/include/freetype/ftotval.h index d9b92c149..5b3139840 100644 --- a/include/freetype/ftotval.h +++ b/include/freetype/ftotval.h @@ -146,8 +146,8 @@ FT_BEGIN_HEADER * 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. */ diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c index 387c5b3e0..0c3d357c3 100644 --- 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 ) ||