shithub: freetype+ttf2subf

Download patch

ref: ad83071620f6c4c3bf029beec761f710e9bbea17
parent: 826935a381e0c3d36be6ac301b3c94c52d46e556
author: David Turner <[email protected]>
date: Wed Sep 27 12:20:59 EDT 2006

* 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

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2006-09-28  David Turner  <[email protected]>
+
+        * 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  <[email protected]>
 
         * include/freetype/freetype.h: bumping FT_FREETYPE_PATCH to 2
--- a/include/freetype/internal/ftobjs.h
+++ b/include/freetype/internal/ftobjs.h
@@ -211,27 +211,12 @@
   /*      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.                                                 */
+  /*    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                         */
   /*                                                                       */
-  /*      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.              */
-  /*                                                                       */
   typedef struct  FT_Face_InternalRec_
   {
 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS
@@ -248,7 +233,7 @@
     FT_Incremental_InterfaceRec*  incremental_interface;
 #endif
 
-    FT_Bool             force_autohint;
+    FT_Bool             unpatented_hinting;
 
   } FT_Face_InternalRec;
 
--- a/src/autofit/aftypes.h
+++ b/src/autofit/aftypes.h
@@ -54,7 +54,7 @@
   /*************************************************************************/
 
 #define xxAF_USE_WARPER  /* only define to use warp hinting */
-#define AF_DEBUG
+#define xxAF_DEBUG
 
 #ifdef AF_DEBUG
 
--- 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 )
--- 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 */