More 16bit fixes.

* src/autohint/ahglobal.c (sort_values): Use FT_Pos for `swap'.
(ah_hinter_compute_widths): Use FT_Pos for `dist'.
Use AH_MAX_WIDTHS.
* src/autohint/ahglyph.c (ah_outline_scale_blue_edges): Use FT_Pos
for `delta'.
(ah_outline_compute_edges): Replace some ints with FT_Int and
FT_Pos.
(ah_test_extrema): Clean up code.
(ah_get_orientation): Use 4 FT_Int variables instead of FT_BBox to
hold indices.
* src/autohint/ahtypes.h (AH_SegmentRec): Change type of `score'
to FT_Pos.
This commit is contained in:
Werner Lemberg 2002-09-21 08:33:27 +00:00
parent 97dc77493c
commit d02e984ed9
4 changed files with 48 additions and 28 deletions

View File

@ -1,3 +1,20 @@
2002-09-19 Wolfgang Domröse <porthos.domroese@harz.de>
More 16bit fixes.
* src/autohint/ahglobal.c (sort_values): Use FT_Pos for `swap'.
(ah_hinter_compute_widths): Use FT_Pos for `dist'.
Use AH_MAX_WIDTHS.
* src/autohint/ahglyph.c (ah_outline_scale_blue_edges): Use FT_Pos
for `delta'.
(ah_outline_compute_edges): Replace some ints with FT_Int and
FT_Pos.
(ah_test_extrema): Clean up code.
(ah_get_orientation): Use 4 FT_Int variables instead of FT_BBox to
hold indices.
* src/autohint/ahtypes.h (AH_SegmentRec): Change type of `score'
to FT_Pos.
2002-09-19 Werner Lemberg <wl@gnu.org>
* builds/unix/config.guess, builds/unix/config.sub: Updated to

View File

@ -43,7 +43,8 @@
sort_values( FT_Int count,
FT_Pos* table )
{
FT_Int i, j, swap;
FT_Int i, j;
FT_Pos swap;
for ( i = 1; i < count; i++ )
@ -345,14 +346,14 @@
/* we only consider stem segments there! */
if ( link && link->link == seg && link > seg )
{
FT_Int dist;
FT_Pos dist;
dist = seg->pos - link->pos;
if ( dist < 0 )
dist = -dist;
if ( num_widths < 12 )
if ( num_widths < AH_MAX_WIDTHS )
widths[num_widths++] = dist;
}
}

View File

@ -164,13 +164,14 @@
/* this function is used by ah_get_orientation (see below) to test */
/* the fill direction of a given bbox extrema */
static int
static FT_Int
ah_test_extrema( FT_Outline* outline,
int n )
FT_Int n )
{
FT_Vector *prev, *cur, *next;
FT_Pos product;
FT_Int first, last, c;
FT_Int retval;
/* we need to compute the `previous' and `next' point */
@ -201,10 +202,11 @@
next->x - cur->x, /* out.x */
0x40 );
retval = 0;
if ( product )
product = product > 0 ? 2 : 1;
retval = product > 0 ? 2 : 1;
return product;
return retval;
}
@ -218,18 +220,18 @@
/* */
/* The function returns either 1 or -1. */
/* */
static int
static FT_Int
ah_get_orientation( FT_Outline* outline )
{
FT_BBox box;
FT_BBox indices;
int n, last;
FT_Int indices_xMin, indices_yMin, indices_xMax, indices_yMax;
FT_Int n, last;
indices.xMin = -1;
indices.yMin = -1;
indices.xMax = -1;
indices.yMax = -1;
indices_xMin = -1;
indices_yMin = -1;
indices_xMax = -1;
indices_yMax = -1;
box.xMin = box.yMin = 32767L;
box.xMax = box.yMax = -32768L;
@ -249,41 +251,41 @@
if ( x < box.xMin )
{
box.xMin = x;
indices.xMin = n;
indices_xMin = n;
}
if ( x > box.xMax )
{
box.xMax = x;
indices.xMax = n;
indices_xMax = n;
}
y = outline->points[n].y;
if ( y < box.yMin )
{
box.yMin = y;
indices.yMin = n;
indices_yMin = n;
}
if ( y > box.yMax )
{
box.yMax = y;
indices.yMax = n;
indices_yMax = n;
}
}
/* test orientation of the xmin */
n = ah_test_extrema( outline, indices.xMin );
n = ah_test_extrema( outline, indices_xMin );
if ( n )
goto Exit;
n = ah_test_extrema( outline, indices.yMin );
n = ah_test_extrema( outline, indices_yMin );
if ( n )
goto Exit;
n = ah_test_extrema( outline, indices.xMax );
n = ah_test_extrema( outline, indices_xMax );
if ( n )
goto Exit;
n = ah_test_extrema( outline, indices.yMax );
n = ah_test_extrema( outline, indices_yMax );
if ( !n )
n = 1;
@ -1284,10 +1286,10 @@
/* now, compute each edge properties */
for ( edge = edges; edge < edge_limit; edge++ )
{
int is_round = 0; /* does it contain round segments? */
int is_straight = 0; /* does it contain straight segments? */
int ups = 0; /* number of upwards segments */
int downs = 0; /* number of downwards segments */
FT_Int is_round = 0; /* does it contain round segments? */
FT_Int is_straight = 0; /* does it contain straight segments? */
FT_Pos ups = 0; /* number of upwards segments */
FT_Pos downs = 0; /* number of downwards segments */
seg = edge->first;
@ -1561,7 +1563,7 @@
{
AH_Edge edge = outline->horz_edges;
AH_Edge edge_limit = edge + outline->num_hedges;
FT_Int delta;
FT_Pos delta;
delta = globals->scaled.blue_refs - globals->design.blue_refs;

View File

@ -286,7 +286,7 @@ FT_BEGIN_HEADER
AH_Segment link; /* link segment */
AH_Segment serif; /* primary segment for serifs */
FT_Pos num_linked; /* number of linked segments */
FT_Int score;
FT_Pos score;
} AH_SegmentRec;