From ad83071620f6c4c3bf029beec761f710e9bbea17 Mon Sep 17 00:00:00 2001 From: David Turner Date: Wed, 27 Sep 2006 16:20:59 +0000 Subject: [PATCH] * include/freetype/internal/ftobjs.h, src/truetype/ttobjs.c, src/base/ftobjs.c: fixed a bug in the automatic unpatented hinting support which prevented normal bytecode hinting to work properly * src/autofit/aftypes.h: undefining AF_DEBUG to get rid of traces --- ChangeLog | 10 ++++++++++ include/freetype/internal/ftobjs.h | 27 ++++++--------------------- src/autofit/aftypes.h | 2 +- src/base/ftobjs.c | 6 ++---- src/truetype/ttobjs.c | 2 +- 5 files changed, 20 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index c5bde9bc9..fa747bbe9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2006-09-28 David Turner + + * include/freetype/internal/ftobjs.h, src/truetype/ttobjs.c, + src/base/ftobjs.c: fixed a bug in the automatic unpatented + hinting support which prevented normal bytecode hinting to + work properly + + * src/autofit/aftypes.h: undefining AF_DEBUG to get rid of + traces + 2006-09-27 David Turner * include/freetype/freetype.h: bumping FT_FREETYPE_PATCH to 2 diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h index 2e7c8952c..9f8704de5 100644 --- a/include/freetype/internal/ftobjs.h +++ b/include/freetype/internal/ftobjs.h @@ -211,26 +211,11 @@ FT_BEGIN_HEADER /* this data when first opened. This field exists only if */ /* @FT_CONFIG_OPTION_INCREMENTAL is defined. */ /* */ - /* force_autohing :: */ - /* This boolean flag instructs the glyph loader to ignore the */ - /* format-specific hinter, and to use the auto-hinter instead to */ - /* load all glyphs. */ - /* */ - /* If the unpatented bytecode interpreter is compiled into the */ - /* library, then: */ - /* */ - /* - if this is one of the tricky Asian fonts, like Gulim, which */ - /* absolutely require a bytecode interpreter to load anything */ - /* properly, the flag is set to FALSE */ - /* */ - /* - for other fonts, the flag is set to TRUE, and the auto-hinter */ - /* is used to scale the glyphs. */ - /* */ - /* If the unpatented bytecode interpreter is not compiled into */ - /* the library, the flag is always set to FALSE. */ - /* */ - /* The detection of `tricky' fonts is located in the TrueType */ - /* face loader, testing against a bunch of font names. */ + /* unpatented_hinting :: */ + /* This boolean flag instructs the glyph loader that this font */ + /* can only be loaded through the unpatented bytecode interpreter. */ + /* in this case, the auto-hinter will never be called for it. */ + /* except if you use FT_LOAD_FORCE_AUTOHINT */ /* */ typedef struct FT_Face_InternalRec_ { @@ -248,7 +233,7 @@ FT_BEGIN_HEADER FT_Incremental_InterfaceRec* incremental_interface; #endif - FT_Bool force_autohint; + FT_Bool unpatented_hinting; } FT_Face_InternalRec; diff --git a/src/autofit/aftypes.h b/src/autofit/aftypes.h index 5ab78d3a2..e5f4ea6a8 100644 --- a/src/autofit/aftypes.h +++ b/src/autofit/aftypes.h @@ -54,7 +54,7 @@ FT_BEGIN_HEADER /*************************************************************************/ #define xxAF_USE_WARPER /* only define to use warp hinting */ -#define AF_DEBUG +#define xxAF_DEBUG #ifdef AF_DEBUG diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c index a871d50d6..3022cbd45 100644 --- a/src/base/ftobjs.c +++ b/src/base/ftobjs.c @@ -576,9 +576,6 @@ if ( FT_LOAD_TARGET_MODE( load_flags ) == FT_RENDER_MODE_LIGHT ) load_flags |= FT_LOAD_FORCE_AUTOHINT; - if ( face->internal->force_autohint ) - load_flags |= FT_LOAD_FORCE_AUTOHINT; - /* auto-hinter is preferred and should be used */ if ( ( !FT_DRIVER_HAS_HINTER( driver ) || ( load_flags & FT_LOAD_FORCE_AUTOHINT ) ) && @@ -591,7 +588,8 @@ FT_DRIVER_IS_SCALABLE( driver ) && FT_DRIVER_USES_OUTLINES( driver ) && face->internal->transform_matrix.yy > 0 && - face->internal->transform_matrix.yx == 0 ); + face->internal->transform_matrix.yx == 0 && + !face->internal->unpatented_hinting ); } if ( autohint ) diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c index 724193167..4bc4ba880 100644 --- a/src/truetype/ttobjs.c +++ b/src/truetype/ttobjs.c @@ -290,7 +290,7 @@ } } - ttface->internal->force_autohint = !face->unpatented_hinting; + ttface->internal->unpatented_hinting = face->unpatented_hinting; #endif /* TT_CONFIG_OPTION_UNPATENTED_HINTING */ /* initialize standard glyph loading routines */