Commit edbcbde7033e05ce97333af946084d835c833d93

Werner Lemberg 2002-08-22T08:49:42

Formatting.

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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
diff --git a/ChangeLog b/ChangeLog
index 7345a46..45f527f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,26 +6,36 @@
 
 2002-08-21  David Turner  <david@freetype.org>
 
-        * src/pshinter/pshalgo3.c, src/autohint/ahangles.c,
-        src/autohint/ahangles.h, src/autohint/ahglyph.c, src/autohint/ahhint.c,
-        src/autohint/ahtypes.h: the automatic and Postscript hinter now
-        automatically detect inflection points in glyph outlines and treats
-        them specially. This is very useful to prevent nasty effect like the
-        disappearing diagonals of "S" and "s" in many, many fonts..
-
-        * src/tools/docmaker/docmaker.py, src/tools/docmaker/utils.py,
-        src/tools/docmaker/tohtml.py: updating the DocMaker tool
-
-        * include/freetype/freetype.h, src/base/ftobjs.c: changing the type
-        of the "load_flags" parameter of FT_Load_Glyph and FT_Load_Char from
-        "FT_Int" to "FT_Int32", this in order to support more options.
-        
-        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
+	The automatic and Postscript hinter now automatically detect
+	inflection points in glyph outlines and treats them specially.  This
+	is very useful to prevent nasty effect like the disappearing
+	diagonals of "S" and "s" in many, many fonts.
+
+	* src/autohint/ahtypes.h (ah_flag_inflection): New macro.
+	* src/autohint/ahangles.c (ah_angle_diff): New function.
+	* src/autohint/ahangles.h: Updated.
+	* src/autohint/ahglyph.c (ah_outline_compute_inflections): New
+	function.
+	(ah_outline_detect_features): Use it.
+	* src/autohint/ahhint.c (ah_hinter_align_strong_points)
+	[!AH_OPTION_NO_WEAK_INTERPOLATION]: Handle inflection.
+
+	* src/tools/docmaker/docmaker.py, src/tools/docmaker/utils.py,
+	src/tools/docmaker/tohtml.py: Updating the DocMaker tool.
+
+	* include/freetype/freetype.h: Changing the type of the "load_flags"
+	parameter from "FT_Int" to "FT_Int32", this in order to support more
+	options.  This should only break binary and/or source compatibility
+	on 16-bit platforms (Atari?).
+	(FT_LOAD_NO_AUTOHINT): New macro.
+
+	* src/base/ftobjs.c (FT_Load_Glyph): Updated.
+	Handle FT_LOAD_NO_AUTOHINT.
+	(FT_Load_Char): Updated.
+
+	* 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  <wl@gnu.org>
 
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index 6293a01..aa1acd1 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -1908,9 +1908,9 @@ FT_BEGIN_HEADER
   /*    *not* the values in `face.glyph.metrics'.                          */
   /*                                                                       */
   FT_EXPORT( FT_Error )
-  FT_Load_Glyph( FT_Face  face,
-                 FT_UInt  glyph_index,
-                 FT_Int32 load_flags );
+  FT_Load_Glyph( FT_Face   face,
+                 FT_UInt   glyph_index,
+                 FT_Int32  load_flags );
 
 
   /*************************************************************************/
@@ -1968,7 +1968,7 @@ FT_BEGIN_HEADER
   /*    the vector outline being loaded should not be scaled to 26.6       */
   /*    fractional pixels, but kept in notional units.                     */
   /*                                                                       */
-#define FT_LOAD_NO_SCALE  1
+#define FT_LOAD_NO_SCALE  0x1
 
 
   /*************************************************************************/
@@ -1983,7 +1983,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*    This flag is ignored if FT_LOAD_NO_SCALE is set.                   */
   /*                                                                       */
-#define FT_LOAD_NO_HINTING  2
+#define FT_LOAD_NO_HINTING  0x2
 
 
   /*************************************************************************/
@@ -1999,7 +1999,7 @@ FT_BEGIN_HEADER
   /*    Note that by default, @FT_Load_Glyph loads the glyph image in its  */
   /*    native format.                                                     */
   /*                                                                       */
-#define FT_LOAD_RENDER  4
+#define FT_LOAD_RENDER  0x4
 
 
   /*************************************************************************/
@@ -2014,7 +2014,7 @@ FT_BEGIN_HEADER
   /*    bitmaps of scalable formats, as the native glyph image will be     */
   /*    loaded, and can then be rendered through @FT_Render_Glyph.         */
   /*                                                                       */
-#define FT_LOAD_NO_BITMAP  8
+#define FT_LOAD_NO_BITMAP  0x8
 
 
   /*************************************************************************/
@@ -2030,7 +2030,7 @@ FT_BEGIN_HEADER
   /*    advance width), and that the glyph image will translated to match  */
   /*    the vertical bearings positions.                                   */
   /*                                                                       */
-#define FT_LOAD_VERTICAL_LAYOUT  16
+#define FT_LOAD_VERTICAL_LAYOUT  0x10
 
 
   /*************************************************************************/
@@ -2043,9 +2043,9 @@ 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        */
+  /*    Note that it is ignored if @FT_LOAD_NO_AUTOHINT is also set.       */
   /*                                                                       */
-#define FT_LOAD_FORCE_AUTOHINT  32
+#define FT_LOAD_FORCE_AUTOHINT  0x20
 
 
   /*************************************************************************/
@@ -2059,7 +2059,7 @@ FT_BEGIN_HEADER
   /*    space around its black bits) when loading it.  For now, this       */
   /*    really only works with embedded bitmaps in TrueType fonts.         */
   /*                                                                       */
-#define FT_LOAD_CROP_BITMAP  64
+#define FT_LOAD_CROP_BITMAP  0x40
 
 
   /*************************************************************************/
@@ -2075,7 +2075,7 @@ FT_BEGIN_HEADER
   /*    error.  Otherwise, errors are ignored by the loader, sometimes     */
   /*    resulting in ugly glyphs.                                          */
   /*                                                                       */
-#define FT_LOAD_PEDANTIC  128
+#define FT_LOAD_PEDANTIC  0x80
 
 
   /*************************************************************************/
@@ -2090,7 +2090,7 @@ FT_BEGIN_HEADER
   /*    X-TrueType font server, in order to deal correctly with the        */
   /*    incorrect metrics contained in DynaLab's TrueType CJK fonts.       */
   /*                                                                       */
-#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH  512
+#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH  0x200
 
 
   /*************************************************************************/
@@ -2111,7 +2111,7 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*    Note that the flag forces the load of unscaled glyphs.             */
   /*                                                                       */
-#define FT_LOAD_NO_RECURSE  1024
+#define FT_LOAD_NO_RECURSE  0x400
 
 
   /*************************************************************************/
@@ -2124,7 +2124,7 @@ FT_BEGIN_HEADER
   /*    the glyph loader should not try to transform the loaded glyph      */
   /*    image.                                                             */
   /*                                                                       */
-#define FT_LOAD_IGNORE_TRANSFORM  2048
+#define FT_LOAD_IGNORE_TRANSFORM  0x800
 
 
   /*************************************************************************/
@@ -2138,7 +2138,7 @@ FT_BEGIN_HEADER
   /*    glyph loader to use `ft_render_mode_mono' when calling             */
   /*    @FT_Render_Glyph.                                                  */
   /*                                                                       */
-#define FT_LOAD_MONOCHROME  4096
+#define FT_LOAD_MONOCHROME  0x1000
 
 
   /*************************************************************************/
@@ -2151,10 +2151,12 @@ FT_BEGIN_HEADER
   /*    the function should return the linearly scaled metrics expressed   */
   /*    in original font units, instead of the default 16.16 pixel values. */
   /*                                                                       */
-#define FT_LOAD_LINEAR_DESIGN  8192
+#define FT_LOAD_LINEAR_DESIGN  0x2000
+
 
   /* temporary hack! */
-#define FT_LOAD_SBITS_ONLY  16384
+#define FT_LOAD_SBITS_ONLY  0x4000
+
 
   /*************************************************************************/
   /*                                                                       */
@@ -2163,20 +2165,21 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /* <Description>                                                         */
   /*    A bit field constant, used with @FT_Load_Glyph to indicate that    */
-  /*    the auto-hinter should never be run. This can be important for     */
+  /*    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)                     */
+  /*    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 */
+  /*    The @FT_LOAD_FORCE_AUTOHINT flag will not work if this flag is     */
+  /*    set.                                                               */
   /*                                                                       */
-#define FT_LOAD_NO_AUTOHINT  32768
+#define FT_LOAD_NO_AUTOHINT  0x8000U
 
 
   /*************************************************************************/
@@ -2190,7 +2193,7 @@ FT_BEGIN_HEADER
   /*    embedded bitmaps are favored over outlines, vectors are always     */
   /*    scaled and grid-fitted.                                            */
   /*                                                                       */
-#define FT_LOAD_DEFAULT  0
+#define FT_LOAD_DEFAULT  0x0
 
 
   /*************************************************************************/
diff --git a/src/autohint/ahangles.c b/src/autohint/ahangles.c
index a4ef842..ef5a88e 100644
--- a/src/autohint/ahangles.c
+++ b/src/autohint/ahangles.c
@@ -133,6 +133,7 @@
   {
     AH_Angle  delta;
     
+
     delta = ( angle2 - angle1 );
     if ( delta < 0 )
       delta += AH_2PI;
diff --git a/src/autohint/ahglyph.c b/src/autohint/ahglyph.c
index 601cf46..1268ee0 100644
--- a/src/autohint/ahglyph.c
+++ b/src/autohint/ahglyph.c
@@ -674,12 +674,14 @@
     }
   }
 
- /* compute all inflex points in a given glyph */
+
+  /* compute all inflex points in a given glyph */
   static void
   ah_outline_compute_inflections( AH_Outline*  outline )
   {
-    AH_Point**   contour       =  outline->contours;
-    AH_Point**   contour_limit =  contour + outline->num_contours;
+    AH_Point**  contour       =  outline->contours;
+    AH_Point**  contour_limit =  contour + outline->num_contours;
+
 
     /* load original coordinates in (u,v) */
     ah_setup_uv( outline, ah_uv_fxy );
@@ -698,8 +700,9 @@
       AH_Angle   diff_in, diff_out;
       FT_Int     finished = 0;
 
+
       /* compute first segment in contour */
-      first  = point;
+      first = point;
 
       start = end = first;
       do
@@ -707,8 +710,8 @@
         end = end->next;
         if ( end == first )
           goto Skip;
-      }
-      while ( end->u == first->u && end->v == first->v );
+
+      } while ( end->u == first->u && end->v == first->v );
 
       vec.x = end->u - start->u;
       vec.y = end->v - start->v;
@@ -724,14 +727,14 @@
           before = before->prev;
           if ( before == first )
             goto Skip;
-        }
-        while ( before->u == start->u && before->v == start->v );
+
+        } while ( before->u == start->u && before->v == start->v );
 
         vec.x    = start->u - before->u;
         vec.y    = start->v - before->v;
         angle_in = ah_angle( &vec );
-      }
-      while ( angle_in == angle_seg );
+
+      } while ( angle_in == angle_seg );
 
       first   = start;
       diff_in = ah_angle_diff( angle_in, angle_seg );
@@ -749,14 +752,14 @@
             after = after->next;
             if ( after == first )
               finished = 1;
-          }
-          while ( end->u == after->u && end->v == after->v );
+
+          } while ( end->u == after->u && end->v == after->v );
 
           vec.x     = after->u - end->u;
           vec.y     = after->v - end->v;
           angle_out = ah_angle( &vec );
-        }
-        while ( angle_out == angle_seg );
+
+        } while ( angle_out == angle_seg );
 
         diff_out = ah_angle_diff( angle_seg, angle_out );
 
@@ -769,8 +772,8 @@
           {
             start->flags |= ah_flag_inflection;
             start = start->next;
-          }
-          while ( start != end );
+
+          } while ( start != end );
 
           start->flags |= ah_flag_inflection;
         }
@@ -779,8 +782,8 @@
         end       = after;
         angle_seg = angle_out;
         diff_in   = diff_out;
-      }
-      while ( !finished );
+
+      } while ( !finished );
 
     Skip:
       ;
@@ -788,7 +791,6 @@
   }
 
 
-
   FT_LOCAL_DEF( void )
   ah_outline_compute_segments( AH_Outline*  outline )
   {
@@ -1401,9 +1403,9 @@
   FT_LOCAL_DEF( void )
   ah_outline_detect_features( AH_Outline*  outline )
   {
-    ah_outline_compute_segments( outline );
-    ah_outline_link_segments   ( outline );
-    ah_outline_compute_edges   ( outline );
+    ah_outline_compute_segments   ( outline );
+    ah_outline_link_segments      ( outline );
+    ah_outline_compute_edges      ( outline );
     ah_outline_compute_inflections( outline );
   }
 
diff --git a/src/autohint/ahhint.c b/src/autohint/ahhint.c
index 0aa5f2e..de23d12 100644
--- a/src/autohint/ahhint.c
+++ b/src/autohint/ahhint.c
@@ -612,8 +612,8 @@
 #ifndef AH_OPTION_NO_WEAK_INTERPOLATION
           /* if this point is candidate to weak interpolation, we will  */
           /* interpolate it after all strong points have been processed */
-          if (  (point->flags & ah_flag_weak_interpolation) &&
-               !(point->flags & ah_flag_inflection)         )
+          if (  ( point->flags & ah_flag_weak_interpolation ) &&
+               !( point->flags & ah_flag_inflection )         )
             continue;
 #endif
 
diff --git a/src/pshinter/pshalgo3.c b/src/pshinter/pshalgo3.c
index aa7b878..4bb4958 100644
--- a/src/pshinter/pshalgo3.c
+++ b/src/pshinter/pshalgo3.c
@@ -1438,7 +1438,7 @@
             continue;
 
           if ( !psh3_point_is_extremum( point )   &&
-               !psh3_point_is_inflection( point ) )
+               !psh3_point_is_inflex( point ) )
             continue;
 
           point->flags &= ~PSH3_POINT_SMOOTH;