From 124d3334411e6c06c9d023330960b993eb451e0f Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Wed, 4 Jun 2003 07:59:58 +0000 Subject: [PATCH] * src/truetype/ttgload.c (load_truetype_glyph) [TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Call FT_GlyphLoader_CheckPoints before adding phantom points. This fixes a segfault bug with fonts (e.g. htst3.ttf) which have nested subglyphs more than one level deep. Reported by Anthony Fok. * include/freetype/config/ftoption.h: Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER, TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING, and TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING to make it the new default. --- ChangeLog | 14 ++++++++++++++ include/freetype/config/ftoption.h | 19 ++++++++++--------- src/truetype/ttgload.c | 5 +++++ 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 997c72816..578da91c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2003-06-04 Werner Lemberg + + * src/truetype/ttgload.c (load_truetype_glyph) + [TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Call + FT_GlyphLoader_CheckPoints before adding phantom points. This fixes + a segfault bug with fonts (e.g. htst3.ttf) which have nested + subglyphs more than one level deep. Reported by Anthony Fok. + + * include/freetype/config/ftoption.h: Define + TT_CONFIG_OPTION_BYTECODE_INTERPRETER, + TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING, and + TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING to make it the new + default. + 2003-06-03 Werner Lemberg * src/autohint/ahhint.c (ah_hinter_hint_edges): Removed. Just a diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h index c55404b25..21f2c9a54 100644 --- a/include/freetype/config/ftoption.h +++ b/include/freetype/config/ftoption.h @@ -291,7 +291,7 @@ FT_BEGIN_HEADER /* should define FT_DEBUG_MEMORY here. */ /* */ /* Note that the memory debugger is only activated at runtime when */ - /* when the _environment_ variable "FT_DEBUG_MEMORY" is also defined! */ + /* when the _environment_ variable "FT2_DEBUG_MEMORY" is defined also! */ /* */ /* Do not #undef this macro here since the build system might define */ /* it for certain configurations only. */ @@ -399,18 +399,19 @@ FT_BEGIN_HEADER /* Do not #undef this macro here, since the build system might */ /* define it for certain configurations only. */ /* */ -/* #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ +#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER /*************************************************************************/ /* */ - /* Define TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING to compile the */ - /* unpatented work-around hinting system. You must define this if you */ - /* want either to force the use of the unpatented hinting system by also */ - /* defining TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING, or if you want to */ - /* select it at run time using the FT_PARAM_TAG_UNPATENTED_HINTING tag. */ + /* Define TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING (in addition to */ + /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER) to compile the unpatented */ + /* work-around hinting system. You must define this if you want either */ + /* to force the use of the unpatented hinting system by also defining */ + /* TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING, or if you want to select */ + /* it at run time using the FT_PARAM_TAG_UNPATENTED_HINTING tag. */ /* */ -/* #define TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING */ +#define TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING /*************************************************************************/ @@ -423,7 +424,7 @@ FT_BEGIN_HEADER /* For this to work you must also define */ /* TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING. */ /* */ -/* #define TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING */ +#define TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING /*************************************************************************/ diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index c66050d55..82ad8ab52 100644 --- a/src/truetype/ttgload.c +++ b/src/truetype/ttgload.c @@ -779,6 +779,7 @@ FT_Bool glyph_data_loaded = 0; #endif + if ( recurse_count >= TT_MAX_COMPOSITE_RECURSE ) { error = TT_Err_Invalid_Composite; @@ -1279,6 +1280,10 @@ if ( error ) goto Fail; + error = FT_GlyphLoader_CheckPoints( gloader, num_points + 2, 0 ); + if ( error ) + goto Fail; + /* prepare the execution context */ tt_prepare_zone( &exec->pts, &gloader->base, start_point, start_contour );