shithub: freetype+ttf2subf

Download patch

ref: 21f433cec9c148300db7c1665531320f30eac510
parent: f467e6a93f8caa6c7ef997ef328ba92d7c7ac009
author: David Turner <[email protected]>
date: Wed Aug 21 18:06:41 EDT 2002

* src/pshinter/pshalgo3.c, src/base/ftobjs.c, src/base/ftobject.c,
        src/autohint/ahglyph.c, include/freetype/freetype.h: fixing typos
        and removing compiler warnings

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,9 @@
         this should only break binary and/or source compatibility on
         16-bit platforms (Atari?)
 
+        * src/pshinter/pshalgo3.c, src/base/ftobjs.c, src/base/ftobject.c,
+        src/autohint/ahglyph.c, include/freetype/freetype.h: fixing typos
+        and removing compiler warnings
 
 2002-08-20  Werner Lemberg  <[email protected]>
 
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -2043,6 +2043,8 @@
   /*    the function should try to auto-hint the glyphs, even if a driver  */
   /*    specific hinter is available.                                      */
   /*                                                                       */
+  /*    Note that it is ignored if @FT_LOAD_NO_AUTOHINT is also set        */
+  /*                                                                       */
 #define FT_LOAD_FORCE_AUTOHINT  32
 
 
@@ -2153,6 +2155,28 @@
 
   /* temporary hack! */
 #define FT_LOAD_SBITS_ONLY  16384
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Constant>                                                            */
+  /*    FT_LOAD_NO_AUTOHINT                                                */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    A bit field constant, used with @FT_Load_Glyph to indicate that    */
+  /*    the auto-hinter should never be run. This can be important for     */
+  /*    certain fonts where un-hinted output is better than auto-hinted    */
+  /*    one.                                                               */
+  /*                                                                       */
+  /*    Note that this will _not_ prevent a native hinter to be run        */
+  /*    when available (i.e. for Postscript fonts, or for TrueType ones    */
+  /*    when the bytecode interpreter was compiled in)                     */
+  /*                                                                       */
+  /*    If you want to completely disable hinting, use @FT_LOAD_NO_HINTING */
+  /*    instead.                                                           */
+  /*                                                                       */
+  /*    The @FT_LOAD_FORCE_AUTOHINT flag will not work if this flag is set */
+  /*                                                                       */
+#define FT_LOAD_NO_AUTOHINT  32768
 
 
   /*************************************************************************/
--- a/src/autohint/ahglyph.c
+++ b/src/autohint/ahglyph.c
@@ -760,7 +760,7 @@
 
         diff_out = ah_angle_diff( angle_seg, angle_out );
 
-        if ( diff_in ^ diff_out < 0 )
+        if ( ( diff_in ^ diff_out ) < 0 )
         {
           /* diff_in and diff_out have different signs, we have */
           /* inflection points here...                          */
--- a/src/base/ftobject.c
+++ b/src/base/ftobject.c
@@ -1,5 +1,6 @@
 #include <ft2build.h>
 #include FT_INTERNAL_OBJECT_H
+#include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_OBJECTS_H
 
 #define  FT_MAGIC_DEATH   0xDEADdead
@@ -13,7 +14,11 @@
              FT_OBJECT(o)->ref_count    >= 1              && \
              FT_OBJECT(o)->clazz->magic == FT_MAGIC_CLASS )
 
+#define  FT_CLASS_CHECK(c)  \
+           ( FT_CLASS(c) != NULL && FT_CLASS(c)->magic == FT_MAGIC_CLASS )
 
+#define  FT_ASSERT_IS_CLASS(c)  FT_ASSERT( FT_CLASS_CHECK(c) )
+
  /*******************************************************************/
  /*******************************************************************/
  /*****                                                         *****/
@@ -34,7 +39,6 @@
   {
     FT_Class   clazz  = node->clazz;
     FT_Memory  memory = clazz->memory;
-    FT_Type    ctype  = clazz->type;
 
     if ( clazz->class_done )
       clazz->class_done( (FT_Object) clazz );
@@ -61,9 +65,9 @@
     /* compare parent types */
     if ( type1->super != type2->super )
     {
-      if ( type1->super == NULL             ||
-           type2->super == NULL             ||
-           !ft_type_compare( type1, type2 ) )
+      if ( type1->super == NULL           ||
+           type2->super == NULL           ||
+           !ft_type_equal( type1, type2 ) )
         goto Fail;
     }
 
@@ -298,7 +302,6 @@
   {
     if ( FT_OBJECT_CHECK(obj) )
     {
-      FT_Object  o = FT_OBJECT(obj);
       FT_Class   c = FT_OBJECT__CLASS(obj);
 
       do
@@ -327,7 +330,7 @@
 
     FT_ASSERT_IS_CLASS(clazz);
 
-    memory = FT_CLASS__MEMORY(memory);
+    memory = FT_CLASS__MEMORY(clazz);
     if ( !FT_ALLOC( obj, clazz->obj_size ) )
     {
       obj->clazz     = clazz;
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -443,10 +443,12 @@
     library  = driver->root.library;
     hinter   = library->auto_hinter;
     autohint =
-      FT_BOOL( hinter                                                      &&
-               !( load_flags & ( FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING ) ) &&
-               FT_DRIVER_IS_SCALABLE( driver )                             &&
-               FT_DRIVER_USES_OUTLINES( driver )                           );
+      FT_BOOL( hinter                                      &&
+               !( load_flags & ( FT_LOAD_NO_SCALE    | 
+                                 FT_LOAD_NO_HINTING  | 
+                                 FT_LOAD_NO_AUTOHINT ) )   &&
+               FT_DRIVER_IS_SCALABLE( driver )             &&
+               FT_DRIVER_USES_OUTLINES( driver )           );
     if ( autohint )
     {
       if ( FT_DRIVER_HAS_HINTER( driver ) &&
--- a/src/pshinter/pshalgo3.c
+++ b/src/pshinter/pshalgo3.c
@@ -738,7 +738,7 @@
 
         diff_out = FT_Angle_Diff( angle_seg, angle_out );
 
-        if ( diff_in ^ diff_out < 0 )
+        if ( ( diff_in ^ diff_out ) < 0 )
         {
           /* diff_in and diff_out have different signs, we have */
           /* inflection points here...                          */
@@ -1043,9 +1043,7 @@
   static void
   psh3_glyph_compute_extrema( PSH3_Glyph  glyph )
   {
-    FT_UInt       first = 0, next, n;
-    PSH3_Point    points  = glyph->points;
-    PSH3_Contour  contour = glyph->contours;
+    FT_UInt   n;
 
     /* first of all, compute all local extrema */
     for ( n = 0; n < glyph->num_contours; n++ )
@@ -1116,12 +1114,12 @@
     {
       PSH3_Point  point, before, after;
 
-      point = &glyph->points[n];
+      point  = &glyph->points[n];
+      before = point;
+      after  = point;
+      
       if ( psh3_point_is_extremum( point ) )
       {
-        PSH3_Point  before = point;
-        PSH3_Point  after  = point;
-
         do
         {
           before = before->prev;
@@ -1172,7 +1170,6 @@
     PSH3_Hint*   sort      = table->sort;
     FT_UInt      num_hints = table->num_hints;
     FT_Int       point_dir = 0;
-    FT_UInt      flag;
 
     if ( PSH3_DIR_COMPARE( point->dir_in, major_dir ) )
       point_dir = point->dir_in;