[autofit] Minor clean-ups. * src/autofit/afhints.c (AF_FLAGS): Remove obsolete values. * src/autofit/afhints.c (af_glyph_hints_dump_points, af_glyph_hints_align_strong_points): Updated. * src/autofit/aflatin.c (af_latin_hints_link_segments, af_latin_hints_compute_segments), src/autofit/afcjk.c (af_cjk_hints_link_segments), src/autofit/aflatin2.c (af_latin2_hints_link_segments, af_latin2_hints_compute_segments): There are no longer fake segments since more than 10 years...
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 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217
diff --git a/ChangeLog b/ChangeLog
index de1e06a..808ca3a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2014-09-24 Werner Lemberg <wl@gnu.org>
+
+ [autofit] Minor clean-ups.
+
+ * src/autofit/afhints.c (AF_FLAGS): Remove obsolete values.
+
+ * src/autofit/afhints.c (af_glyph_hints_dump_points,
+ af_glyph_hints_align_strong_points): Updated.
+
+ * src/autofit/aflatin.c (af_latin_hints_link_segments,
+ af_latin_hints_compute_segments), src/autofit/afcjk.c
+ (af_cjk_hints_link_segments), src/autofit/aflatin2.c
+ (af_latin2_hints_link_segments, af_latin2_hints_compute_segments):
+ There are no longer fake segments since more than 10 years...
+
2014-09-22 Werner Lemberg <wl@gnu.org>
[autofit] Minor code streamlining.
diff --git a/src/autofit/afcjk.c b/src/autofit/afcjk.c
index 2084e31..048e0e7 100644
--- a/src/autofit/afcjk.c
+++ b/src/autofit/afcjk.c
@@ -765,10 +765,6 @@
/* now compare each segment to the others */
for ( seg1 = segments; seg1 < segment_limit; seg1++ )
{
- /* the fake segments are for metrics hinting only */
- if ( seg1->first == seg1->last )
- continue;
-
if ( seg1->dir != major_dir )
continue;
diff --git a/src/autofit/afhints.c b/src/autofit/afhints.c
index ec61426..9fbc541 100644
--- a/src/autofit/afhints.c
+++ b/src/autofit/afhints.c
@@ -201,7 +201,7 @@
for ( point = points; point < limit; point++ )
AF_DUMP(( " [ %5d | %5d | %5d | %6.2f | %6.2f"
- " | %5.2f | %5.2f | %c%c%c%c%c%c ]\n",
+ " | %5.2f | %5.2f | %c ]\n",
point - points,
point->fx,
point->fy,
@@ -209,12 +209,7 @@
point->oy / 64.0,
point->x / 64.0,
point->y / 64.0,
- ( point->flags & AF_FLAG_WEAK_INTERPOLATION ) ? 'w' : ' ',
- ( point->flags & AF_FLAG_INFLECTION ) ? 'i' : ' ',
- ( point->flags & AF_FLAG_EXTREMA_X ) ? '<' : ' ',
- ( point->flags & AF_FLAG_EXTREMA_Y ) ? 'v' : ' ',
- ( point->flags & AF_FLAG_ROUND_X ) ? '(' : ' ',
- ( point->flags & AF_FLAG_ROUND_Y ) ? 'u' : ' '));
+ ( point->flags & AF_FLAG_WEAK_INTERPOLATION ) ? 'w' : ' '));
AF_DUMP(( "\n" ));
}
#ifdef __cplusplus
@@ -1076,8 +1071,7 @@
/* if this point is candidate to weak interpolation, we */
/* interpolate it after all strong points have been processed */
- if ( ( point->flags & AF_FLAG_WEAK_INTERPOLATION ) &&
- !( point->flags & AF_FLAG_INFLECTION ) )
+ if ( ( point->flags & AF_FLAG_WEAK_INTERPOLATION ) )
continue;
if ( dim == AF_DIMENSION_VERT )
diff --git a/src/autofit/afhints.h b/src/autofit/afhints.h
index c0ebd0d..92101de 100644
--- a/src/autofit/afhints.h
+++ b/src/autofit/afhints.h
@@ -72,13 +72,9 @@ FT_BEGIN_HEADER
* `af_{cjk,latin,...}_hints_compute_segments' are the functions to
* find segments in an outline.
*
- * A segment is a series of consecutive points that are approximately
- * aligned along a coordinate axis. The analysis to do so is specific
- * to a writing system.
- *
- * A segment must have at least two points, except in the case of
- * `fake' segments that are generated to hint metrics appropriately,
- * and which consist of a single point.
+ * A segment is a series of at least two consecutive points that are
+ * approximately aligned along a coordinate axis. The analysis to do
+ * so is specific to a writing system.
*
*
* Edges
@@ -148,7 +144,7 @@ FT_BEGIN_HEADER
* Serifs are detected by `af_{cjk,latin,...}_hint_edges'.
*
* In comparison to a stem, a serif (as handled by the auto-hinter
- * module which takes care of the `latin' writing system) has
+ * module that takes care of the `latin' writing system) has
*
* best segment_1 = segment_2 && best segment_2 != segment_1
*
@@ -178,19 +174,19 @@ FT_BEGIN_HEADER
*
* Strong Points
*
- * Experience has shown that points which are not part of an edge need
- * to be interpolated linearly between their two closest edges, even if
- * these are not part of the contour of those particular points.
- * Typical candidates for this are
+ * Experience has shown that points not part of an edge need to be
+ * interpolated linearly between their two closest edges, even if these
+ * are not part of the contour of those particular points. Typical
+ * candidates for this are
*
* - angle points (i.e., points where the `in' and `out' direction
* differ greatly)
*
* - inflection points (i.e., where the `in' and `out' angles are the
* same, but the curvature changes sign) [currently, such points
- * aren't handled in the auto-hinter]
+ * aren't handled specially in the auto-hinter]
*
- * `af_glyph_hints_align_strong_points' is the function which takes
+ * `af_glyph_hints_align_strong_points' is the function that takes
* care of such situations; it is equivalent to the TrueType `IP'
* hinting instruction.
*
@@ -220,23 +216,12 @@ FT_BEGIN_HEADER
AF_FLAG_CUBIC = 1 << 1,
AF_FLAG_CONTROL = AF_FLAG_CONIC | AF_FLAG_CUBIC,
- /* point extremum flags */
- AF_FLAG_EXTREMA_X = 1 << 2,
- AF_FLAG_EXTREMA_Y = 1 << 3,
-
- /* point roundness flags */
- AF_FLAG_ROUND_X = 1 << 4,
- AF_FLAG_ROUND_Y = 1 << 5,
-
/* point touch flags */
- AF_FLAG_TOUCH_X = 1 << 6,
- AF_FLAG_TOUCH_Y = 1 << 7,
+ AF_FLAG_TOUCH_X = 1 << 2,
+ AF_FLAG_TOUCH_Y = 1 << 3,
/* candidates for weak interpolation have this flag set */
- AF_FLAG_WEAK_INTERPOLATION = 1 << 8,
-
- /* all inflection points in the outline have this flag set */
- AF_FLAG_INFLECTION = 1 << 9
+ AF_FLAG_WEAK_INTERPOLATION = 1 << 4
} AF_Flags;
diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c
index dc424af..36a3689 100644
--- a/src/autofit/aflatin.c
+++ b/src/autofit/aflatin.c
@@ -1329,9 +1329,6 @@
FT_Pos last_v = last->v;
- if ( first == last )
- continue;
-
if ( first_v < last_v )
{
AF_Point p;
@@ -1407,9 +1404,7 @@
/* now compare each segment to the others */
for ( seg1 = segments; seg1 < segment_limit; seg1++ )
{
- /* the fake segments are introduced to hint the metrics -- */
- /* we must never link them to anything */
- if ( seg1->dir != axis->major_dir || seg1->first == seg1->last )
+ if ( seg1->dir != axis->major_dir )
continue;
/* search for stems having opposite directions, */
diff --git a/src/autofit/aflatin2.c b/src/autofit/aflatin2.c
index 29b4af2..07590b3 100644
--- a/src/autofit/aflatin2.c
+++ b/src/autofit/aflatin2.c
@@ -890,9 +890,6 @@
FT_Pos last_v = last->v;
- if ( first == last )
- continue;
-
if ( first_v < last_v )
{
p = first->prev;
@@ -984,7 +981,7 @@
#ifdef AF_SORT_SEGMENTS
for ( seg1 = segments; seg1 < segment_mid; seg1++ )
{
- if ( seg1->dir != axis->major_dir || seg1->first == seg1->last )
+ if ( seg1->dir != axis->major_dir )
continue;
for ( seg2 = segment_mid; seg2 < segment_limit; seg2++ )
@@ -992,9 +989,7 @@
/* now compare each segment to the others */
for ( seg1 = segments; seg1 < segment_limit; seg1++ )
{
- /* the fake segments are introduced to hint the metrics -- */
- /* we must never link them to anything */
- if ( seg1->dir != axis->major_dir || seg1->first == seg1->last )
+ if ( seg1->dir != axis->major_dir )
continue;
for ( seg2 = segments; seg2 < segment_limit; seg2++ )