From 0ca0d9773e867f87080a44b534e207ea104170ab Mon Sep 17 00:00:00 2001 From: David Turner Date: Wed, 21 Aug 2002 22:06:41 +0000 Subject: [PATCH] * 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 --- ChangeLog | 3 +++ include/freetype/freetype.h | 24 ++++++++++++++++++++++++ src/autohint/ahglyph.c | 2 +- src/base/ftobject.c | 15 +++++++++------ src/base/ftobjs.c | 10 ++++++---- src/pshinter/pshalgo3.c | 15 ++++++--------- 6 files changed, 49 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index dbff64aa2..8bdd4ad63 100644 --- 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 diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h index cd4c36377..6293a01c4 100644 --- a/include/freetype/freetype.h +++ b/include/freetype/freetype.h @@ -2043,6 +2043,8 @@ FT_BEGIN_HEADER /* 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 @@ -2154,6 +2156,28 @@ FT_BEGIN_HEADER /* temporary hack! */ #define FT_LOAD_SBITS_ONLY 16384 + /*************************************************************************/ + /* */ + /* */ + /* FT_LOAD_NO_AUTOHINT */ + /* */ + /* */ + /* 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 + /*************************************************************************/ /* */ diff --git a/src/autohint/ahglyph.c b/src/autohint/ahglyph.c index 8939b7411..601cf469c 100644 --- 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... */ diff --git a/src/base/ftobject.c b/src/base/ftobject.c index 413384c8d..1a5d68e19 100644 --- a/src/base/ftobject.c +++ b/src/base/ftobject.c @@ -1,5 +1,6 @@ #include #include FT_INTERNAL_OBJECT_H +#include FT_INTERNAL_DEBUG_H #include FT_INTERNAL_OBJECTS_H #define FT_MAGIC_DEATH 0xDEADdead @@ -13,6 +14,10 @@ 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; diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c index 5786b6c27..59ac1b8e7 100644 --- 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 ) && diff --git a/src/pshinter/pshalgo3.c b/src/pshinter/pshalgo3.c index 18ea48d38..59b4d5a1d 100644 --- 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;