From 08ba57b25ca444416b17991f984999a680e9f208 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Fri, 2 May 2003 15:16:13 +0000 Subject: [PATCH] * src/autohint/ahglyph.c (ah_test_extrema): Renamed to... (ah_test_extremum): This. --- ChangeLog | 5 +++++ src/autohint/ahglobal.c | 8 ++++---- src/autohint/ahglyph.c | 38 +++++++++++++++++++++----------------- src/autohint/ahtypes.h | 2 +- 4 files changed, 31 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index d9199425a..27c1d02fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-05-01 Werner Lemberg + + * src/autohint/ahglyph.c (ah_test_extrema): Renamed to... + (ah_test_extremum): This. + 2003-04-28 Werner Lemberg * builds/unix/configure.ac: Generate `freetype.pc' from diff --git a/src/autohint/ahglobal.c b/src/autohint/ahglobal.c index f6fdd90bb..120c4a212 100644 --- a/src/autohint/ahglobal.c +++ b/src/autohint/ahglobal.c @@ -235,8 +235,8 @@ AH_LOG(( "\n" )); /* we have computed the contents of the `rounds' and `flats' tables, */ - /* now determine the reference and overshoot position of the blue; */ - /* we simply take the median value after a simple short */ + /* now determine the reference and overshoot position of the blue -- */ + /* we simply take the median value after a simple sort */ sort_values( num_rounds, rounds ); sort_values( num_flats, flats ); @@ -312,7 +312,7 @@ /* stem height of the "-", but it wasn't too good. Moreover, we now */ /* have a single character that gives us standard width and height. */ { - FT_UInt glyph_index; + FT_UInt glyph_index; glyph_index = FT_Get_Char_Index( hinter->face, 'o' ); @@ -376,7 +376,7 @@ } /* Now, compute the edge distance threshold as a fraction of the */ - /* smallest width in the font. Set it in `hinter.glyph' too! */ + /* smallest width in the font. Set it in `hinter->glyph' too! */ if ( edge_distance_threshold == 32000 ) edge_distance_threshold = 50; diff --git a/src/autohint/ahglyph.c b/src/autohint/ahglyph.c index b371c55eb..8a9c33130 100644 --- a/src/autohint/ahglyph.c +++ b/src/autohint/ahglyph.c @@ -120,8 +120,8 @@ : ( seg->dir == AH_DIR_RIGHT ? "right" : "none" ) ) ), - seg->link ? (seg->link-segments) : -1, - seg->serif ? (seg->serif-segments) : -1, + seg->link ? ( seg->link - segments ) : -1, + seg->serif ? ( seg->serif - segments ) : -1, (int)seg->num_linked, seg->first - points, seg->last - points ); @@ -135,7 +135,7 @@ #endif /* AH_DEBUG */ - /* compute the direction value of a given vector.. */ + /* compute the direction value of a given vector */ static AH_Direction ah_compute_direction( FT_Pos dx, FT_Pos dy ) @@ -147,6 +147,8 @@ dir = AH_DIR_NONE; + /* atan(1/12) == 4.7 degrees */ + /* test for vertical direction */ if ( ax * 12 < ay ) { @@ -163,10 +165,10 @@ /* this function is used by ah_get_orientation (see below) to test */ - /* the fill direction of a given bbox extrema */ + /* the fill direction of given bbox extremum */ static FT_Int - ah_test_extrema( FT_Outline* outline, - FT_Int n ) + ah_test_extremum( FT_Outline* outline, + FT_Int n ) { FT_Vector *prev, *cur, *next; FT_Pos product; @@ -175,7 +177,9 @@ /* we need to compute the `previous' and `next' point */ - /* for these extrema */ + /* for this extremum; we check whether the extremum */ + /* is start or end of a contour and providing */ + /* appropriate values if so */ cur = outline->points + n; prev = cur - 1; next = cur + 1; @@ -183,7 +187,7 @@ first = 0; for ( c = 0; c < outline->n_contours; c++ ) { - last = outline->contours[c]; + last = outline->contours[c]; if ( n == first ) prev = outline->points + last; @@ -218,7 +222,7 @@ /* We do this by computing bounding box points, and computing their */ /* curvature. */ /* */ - /* The function returns either 1 or -1. */ + /* The function returns either 1 or 2. */ /* */ static FT_Int ah_get_orientation( FT_Outline* outline ) @@ -272,20 +276,20 @@ } } - /* test orientation of the xmin */ - n = ah_test_extrema( outline, indices_xMin ); + /* test orientation of the extrema */ + n = ah_test_extremum( outline, indices_xMin ); if ( n ) goto Exit; - n = ah_test_extrema( outline, indices_yMin ); + n = ah_test_extremum( outline, indices_yMin ); if ( n ) goto Exit; - n = ah_test_extrema( outline, indices_xMax ); + n = ah_test_extremum( outline, indices_xMax ); if ( n ) goto Exit; - n = ah_test_extrema( outline, indices_yMax ); + n = ah_test_extremum( outline, indices_yMax ); if ( !n ) n = 1; @@ -306,14 +310,14 @@ ah_outline_new( FT_Memory memory, AH_Outline* aoutline ) { - FT_Error error; - AH_Outline outline; + FT_Error error; + AH_Outline outline; if ( !FT_NEW( outline ) ) { outline->memory = memory; - *aoutline = outline; + *aoutline = outline; } return error; diff --git a/src/autohint/ahtypes.h b/src/autohint/ahtypes.h index c5cf27a8f..d004ed4cc 100644 --- a/src/autohint/ahtypes.h +++ b/src/autohint/ahtypes.h @@ -121,7 +121,7 @@ FT_BEGIN_HEADER /*************************************************************************/ - /* see agangles.h */ + /* see ahangles.h */ typedef FT_Int AH_Angle;