* src/base/ftoutln.c (FT_OrientationExtremumRec, FT_Outline_Get_Orientation): Trivial typo fixes to make it compile.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
diff --git a/ChangeLog b/ChangeLog
index c97afb8..d87a5ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-10-04 Werner Lemberg <wl@gnu.org>
+
+ * src/base/ftoutln.c (FT_OrientationExtremumRec,
+ FT_Outline_Get_Orientation): Trivial typo fixes to make it compile.
+
2003-10-02 Markus F.X.J. Oberhumer <markus@oberhumer.com>
* src/winfonts/winfnt.c (FT_WinFNT_HeaderRec): `color_table_offset'
@@ -7,16 +12,20 @@
2003-10-01 David Turner <david@freetype.org>
- * src/autofit/*: adding first sources of the new multi-script
- "auto-fitter"
+ * src/autofit/*: Adding first source files of the new multi-script
+ `auto-fitter'.
+
+ * include/freetype/ftoutln.h (FT_Orientation): New enumeration.
+ (FT_Outline_Get_Orientation): New declaration.
- * include/freetype/ftoutln.h, src/base/ftoutln.c: adding the
- definition of FT_Outline_Get_Orientation, used to compute the
- fill orientation of a given glyph outline.
+ * src/base/ftoutln.c (FT_OrientationExtremumRec): New structure.
+ (ft_orientation_extremum_compute): New auxiliary function.
+ (FT_Outline_Get_Orientation): New function to compute the fill
+ orientation of a given glyph outline.
- * include/freetype/internal/ftserv.h: fixed trivial bug which
- could crashed the font engine when a cached service pointer was
- retrieved with FT_FACE_LOOKUP_SERVICE
+ * include/freetype/internal/ftserv.h (FT_FACE_LOOKUP_SERVICE): Fixed
+ trivial bug which could crash the font engine when a cached service
+ pointer was retrieved.
2003-09-30 Werner Lemberg <wl@gnu.org>
diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c
index 4e49514..c19e210 100644
--- a/src/base/ftoutln.c
+++ b/src/base/ftoutln.c
@@ -4,7 +4,7 @@
/* */
/* FreeType outline management (body). */
/* */
-/* Copyright 1996-2001, 2002 by */
+/* Copyright 1996-2001, 2002, 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -656,13 +656,12 @@
}
-
- typedef FT_OrientationExtremumRec_
+ typedef struct FT_OrientationExtremumRec_
{
- FT_Int index;
- FT_Int pos;
- FT_Int first;
- FT_Int last;
+ FT_Int index;
+ FT_Int pos;
+ FT_Int first;
+ FT_Int last;
} FT_OrientationExtremumRec;
@@ -675,15 +674,15 @@
FT_Vector* points = outline->points;
FT_Angle angle_in, angle_out;
- /* compute the previous and next points in the same contour
- */
+
+ /* compute the previous and next points in the same contour */
point = points + extremum->index;
first = points + extremum->first;
last = points + extremum->last;
do
{
- prev = ( point == first ) ? last : point-1;
+ prev = ( point == first ) ? last : point - 1;
if ( prev == point )
return FT_ORIENTATION_TRUETYPE; /* degenerate case */
@@ -692,22 +691,21 @@
do
{
- next = ( point == last ) ? first : point+1;
+ next = ( point == last ) ? first : point + 1;
if ( next == point )
return FT_ORIENTATION_TRUETYPE; /* shouldn't happen */
} while ( next->x != point->x || next->y != point->y );
- /* now, compute the orientation of the "out" vector relative
- * to the "in" vector.
- */
+ /* now compute the orientation of the `out' vector relative */
+ /* to the `in' vector. */
angle_in = FT_Atan2( point->x - prev->x, point->y - prev->y );
angle_out = FT_Atan2( next->x - point->x, next->y - point->y );
return ( FT_Angle_Diff( angle_in, angle_out ) >= 0 )
- ? FT_ORIENTATION_TRUETYPE
- : FT_ORIENTATION_POSTSCRIPT;
+ ? FT_ORIENTATION_TRUETYPE
+ : FT_ORIENTATION_POSTSCRIPT;
}
@@ -716,6 +714,7 @@
{
FT_Orientation result = FT_ORIENTATION_TRUETYPE;
+
if ( outline && outline->n_points > 0 )
{
FT_OrientationExtremumRec xmin, ymin, xmax, ymax;
@@ -723,27 +722,29 @@
FT_Int first, last;
FT_Vector* points = outline->points;
+
xmin.pos = ymin.pos = +32768L;
xmax.pos = ymax.pos = -32768L;
xmin.index = ymin.index = xmax.index = ymax.index = -1;
first = 0;
- for ( n = 0; n < outline->n_contours; n++, first = last+1 )
+ for ( n = 0; n < outline->n_contours; n++, first = last + 1 )
{
last = outline->contours[n];
- /* skip single-point contours, these are degenerated cases
- */
- if ( last > first+1 )
+ /* skip single-point contours; these are degenerated cases */
+ if ( last > first + 1 )
{
FT_Int i;
+
for ( i = first; i < last; i++ )
{
- x = points[i].x;
- y = points[i].y;
+ FT_Pos x = points[i].x;
+ FT_Pos y = points[i].y;
+
if ( x < xmin.pos )
{
xmin.pos = x;
@@ -792,4 +793,5 @@
return result;
}
+
/* END */