shithub: freetype+ttf2subf

Download patch

ref: 6ab5624330877f27b786c3616907d01cf805edc5
parent: 9a8e32112963e5f2ede6bad03df58ca23f95ede0
author: Werner Lemberg <[email protected]>
date: Wed Jun 4 03:59:58 EDT 2003

* 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.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2003-06-04  Werner Lemberg  <[email protected]>
+
+	* 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  <[email protected]>
 
 	* src/autohint/ahhint.c (ah_hinter_hint_edges): Removed.  Just a
--- a/include/freetype/config/ftoption.h
+++ b/include/freetype/config/ftoption.h
@@ -291,7 +291,7 @@
   /*   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 @@
   /*   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 @@
   /* 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
 
 
   /*************************************************************************/
--- 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;
@@ -1276,6 +1277,10 @@
                                     tt_coderange_glyph,
                                     exec->glyphIns,
                                     n_ins );
+          if ( error )
+            goto Fail;
+
+          error = FT_GlyphLoader_CheckPoints( gloader, num_points + 2, 0 );
           if ( error )
             goto Fail;