Commit 27b20e9a1e941b09681a6572bfb84d99b391ea91

Werner Lemberg 2011-05-09T09:48:49

Formatting, minor doc improvements.

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
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
diff --git a/docs/CHANGES b/docs/CHANGES
index fa04a21..f242c48 100644
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -16,10 +16,9 @@ CHANGES BETWEEN 2.4.4 and 2.4.5
       redundant and  is simply ignored;  this means that FreeType  now
       ignores the global advance width value in TrueType fonts.
 
-    - Just Fill Bugs contributed an experimental code to compute  blue
-      zones for CJK Ideographs, to improve the alignment of horizontal
-      stems at the top or bottom edges. Mainly tested with  a TrueType
-      WenQuanYi-ZenHei.
+    - Just  Fill Bugs contributed (experimental) code to compute  blue
+      zones for CJK Ideographs, improving the alignment of  horizontal
+      stems at the top or bottom edges.
 
 
   III. MISCELLANEOUS
diff --git a/src/autofit/afcjk.c b/src/autofit/afcjk.c
index 101e668..0180e3d 100644
--- a/src/autofit/afcjk.c
+++ b/src/autofit/afcjk.c
@@ -62,7 +62,8 @@
   /*************************************************************************/
 
 
-  /* Basically the Latin version with AF_CJKMetrics to replace AF_LatinMetrics */
+  /* Basically the Latin version with AF_CJKMetrics */
+  /* to replace AF_LatinMetrics.                    */
 
   FT_LOCAL_DEF( void )
   af_cjk_metrics_init_widths( AF_CJKMetrics  metrics,
@@ -79,11 +80,11 @@
     metrics->axis[AF_DIMENSION_VERT].width_count = 0;
 
     {
-      FT_Error             error;
-      FT_UInt              glyph_index;
-      int                  dim;
-      AF_CJKMetricsRec     dummy[1];
-      AF_Scaler            scaler = &dummy->root.scaler;
+      FT_Error          error;
+      FT_UInt           glyph_index;
+      int               dim;
+      AF_CJKMetricsRec  dummy[1];
+      AF_Scaler         scaler = &dummy->root.scaler;
 
 
       glyph_index = FT_Get_Char_Index( face, charcode );
@@ -121,13 +122,11 @@
         FT_UInt       num_widths = 0;
 
 
-        error = af_latin_hints_compute_segments( hints,
-                                                 (AF_Dimension)dim );
+        error = af_latin_hints_compute_segments( hints, (AF_Dimension)dim );
         if ( error )
           goto Exit;
 
-        af_latin_hints_link_segments( hints,
-                                      (AF_Dimension)dim );
+        af_latin_hints_link_segments( hints, (AF_Dimension)dim );
 
         seg   = axhints->segments;
         limit = seg + axhints->num_segments;
@@ -155,16 +154,15 @@
         axis->width_count = num_widths;
       }
 
-  Exit:
+    Exit:
       for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )
       {
-        AF_CJKAxis    axis = &metrics->axis[dim];
-        FT_Pos        stdw;
+        AF_CJKAxis  axis = &metrics->axis[dim];
+        FT_Pos      stdw;
 
 
-        stdw = ( axis->width_count > 0 )
-                 ? axis->widths[0].org
-                 : AF_LATIN_CONSTANT( metrics, 50 );
+        stdw = ( axis->width_count > 0 ) ? axis->widths[0].org
+                                         : AF_LATIN_CONSTANT( metrics, 50 );
 
         /* let's try 20% of the smallest width */
         axis->edge_distance_threshold = stdw / 5;
@@ -177,13 +175,12 @@
   }
 
 
-
 #define AF_CJK_MAX_TEST_CHARACTERS  32
 
 
-  /* Every blue zone has 2 types of fill and unfill,
-   * Which means fill the entire square or not.
-   * */
+  /* Each blue zone has two types of fill and unfill, this is, */
+  /* filling the entire glyph square or not.                   */
+
   enum
   {
     AF_CJK_BLUE_TYPE_FILL,
@@ -191,6 +188,7 @@
     AF_CJK_BLUE_TYPE_MAX
   };
 
+
   /* Put some common and representative Han Ideographs characters here. */
   static const FT_ULong af_cjk_hani_blue_chars[AF_CJK_BLUE_MAX]
                                               [AF_CJK_BLUE_TYPE_MAX]
@@ -260,28 +258,32 @@
   };
 
 
-  /* Calculate blue zones for all the CJK_BLUE_XXX's */
+  /* Calculate blue zones for all the CJK_BLUE_XXX's. */
 
   static void
   af_cjk_metrics_init_blues( AF_CJKMetrics   metrics,
                              FT_Face         face,
-                             const FT_ULong  blue_chars[AF_CJK_BLUE_MAX]
-                                                       [AF_CJK_BLUE_TYPE_MAX]
-                                                       [AF_CJK_MAX_TEST_CHARACTERS] )
+                             const FT_ULong  blue_chars
+                                               [AF_CJK_BLUE_MAX]
+                                               [AF_CJK_BLUE_TYPE_MAX]
+                                               [AF_CJK_MAX_TEST_CHARACTERS] )
   {
     FT_Pos        fills[AF_CJK_MAX_TEST_CHARACTERS];
     FT_Pos        flats[AF_CJK_MAX_TEST_CHARACTERS];
+
     FT_Int        num_fills;
     FT_Int        num_flats;
+
     FT_Int        bb;
     AF_CJKBlue    blue;
     FT_Error      error;
     AF_CJKAxis    axis;
     FT_GlyphSlot  glyph = face->glyph;
 
-    /* we compute the blues simply by loading each character from the    */
-    /* 'blue_chars[blues]' string, then compute its extreme  */
-    /* points (depending blue zone type etc.)                */
+
+    /* We compute the blues simply by loading each character from the */
+    /* `blue_chars[blues]' string, then computing its extreme points  */
+    /* (depending blue zone type etc.).                               */
 
     FT_TRACE5(( "cjk blue zones computation\n" ));
     FT_TRACE5(( "------------------------------------------------\n" ));
@@ -293,13 +295,15 @@
       FT_Pos*  blue_shoot;
 
 
-      num_fills  = 0;
-      num_flats  = 0;
-      for ( fill_type = 0 ; fill_type < AF_CJK_BLUE_TYPE_MAX; fill_type++)
+      num_fills = 0;
+      num_flats = 0;
+
+      for ( fill_type = 0; fill_type < AF_CJK_BLUE_TYPE_MAX; fill_type++ )
       {
         const FT_ULong*  p     = blue_chars[bb][fill_type];
         const FT_ULong*  limit = p + AF_CJK_MAX_TEST_CHARACTERS;
-        FT_Bool          fill  = FT_BOOL( fill_type == AF_CJK_BLUE_TYPE_FILL );
+        FT_Bool          fill  = FT_BOOL(
+                                   fill_type == AF_CJK_BLUE_TYPE_FILL );
 
 
         FT_TRACE5(( "cjk blue %3d/%d: ", bb, fill_type ));
@@ -312,6 +316,7 @@
           FT_Int      best_point, best_first, best_last;
           FT_Vector*  points;
 
+
           FT_TRACE5(( "0x%lX", *p ));
 
           /* load the character in the face -- skip unknown or empty ones */
@@ -336,7 +341,9 @@
             FT_Int  last  = -1;
 
 
-            for ( nn = 0; nn < glyph->outline.n_contours; first = last+1, nn++ )
+            for ( nn = 0;
+                  nn < glyph->outline.n_contours;
+                  first = last + 1, nn++ )
             {
               FT_Int  old_best_point = best_point;
               FT_Int  pp;
@@ -344,49 +351,54 @@
 
               last = glyph->outline.contours[nn];
 
-              /* Avoid single-point contours since they are never rasterized. */
-              /* In some fonts, they correspond to mark attachment points     */
-              /* which are way outside of the glyph's real outline.           */
+              /* Avoid single-point contours since they are never       */
+              /* rasterized.  In some fonts, they correspond to mark    */
+              /* attachment points which are way outside of the glyph's */
+              /* real outline.                                          */
               if ( last <= first )
                 continue;
 
-              switch (bb)
+              switch ( bb )
               {
-                case AF_CJK_BLUE_TOP:
-                  for ( pp = first; pp <= last; pp++ )
-                    if ( best_point < 0 || points[pp].y > best_pos )
-                    {
-                      best_point = pp;
-                      best_pos   = points[pp].y;
-                    }
-                  break;
-                case AF_CJK_BLUE_BOTTOM:
-                  for ( pp = first; pp <= last; pp++ )
-                    if ( best_point < 0 || points[pp].y < best_pos )
-                    {
-                      best_point = pp;
-                      best_pos   = points[pp].y;
-                    }
-                  break;
-                case AF_CJK_BLUE_LEFT:
-                  for ( pp = first; pp <= last; pp++ )
-                    if ( best_point < 0 || points[pp].x < best_pos )
-                    {
-                      best_point = pp;
-                      best_pos   = points[pp].x;
-                    }
-                  break;
-                case AF_CJK_BLUE_RIGHT:
-                  for ( pp = first; pp <= last; pp++ )
-                    if ( best_point < 0 || points[pp].x > best_pos )
-                    {
-                      best_point = pp;
-                      best_pos   = points[pp].x;
-                    }
-                  break;
-                default:
-                  ;
-            }
+              case AF_CJK_BLUE_TOP:
+                for ( pp = first; pp <= last; pp++ )
+                  if ( best_point < 0 || points[pp].y > best_pos )
+                  {
+                    best_point = pp;
+                    best_pos   = points[pp].y;
+                  }
+                break;
+
+              case AF_CJK_BLUE_BOTTOM:
+                for ( pp = first; pp <= last; pp++ )
+                  if ( best_point < 0 || points[pp].y < best_pos )
+                  {
+                    best_point = pp;
+                    best_pos   = points[pp].y;
+                  }
+                break;
+
+              case AF_CJK_BLUE_LEFT:
+                for ( pp = first; pp <= last; pp++ )
+                  if ( best_point < 0 || points[pp].x < best_pos )
+                  {
+                    best_point = pp;
+                    best_pos   = points[pp].x;
+                  }
+                break;
+
+              case AF_CJK_BLUE_RIGHT:
+                for ( pp = first; pp <= last; pp++ )
+                  if ( best_point < 0 || points[pp].x > best_pos )
+                  {
+                    best_point = pp;
+                    best_pos   = points[pp].x;
+                  }
+                break;
+
+              default:
+                ;
+              }
 
               if ( best_point != old_best_point )
               {
@@ -397,7 +409,7 @@
             FT_TRACE5(( "%5ld, ", best_pos ));
           }
 
-          if (fill)
+          if ( fill )
             fills[num_fills++] = best_pos;
           else
             flats[num_flats++] = best_pos;
@@ -406,7 +418,7 @@
         FT_TRACE5(( "\n" ));
       }
 
-      if ( num_flats == 0 && num_fills == 0)
+      if ( num_flats == 0 && num_fills == 0 )
       {
         /*
          *  we couldn't find a single glyph to compute this blue zone,
@@ -417,8 +429,8 @@
       }
 
       /* we have computed the contents of the `fill' and `flats' tables, */
-      /* now determine the reference position of the blue --  */
-      /* we simply take the median value after a simple sort  */
+      /* now determine the reference position of the blue --             */
+      /* we simply take the median value after a simple sort             */
       af_sort_pos( num_flats, flats );
       af_sort_pos( num_fills, fills );
 
@@ -448,8 +460,8 @@
         *blue_shoot = flats[num_flats / 2];
       }
 
-      /* make sure blue_ref >= blue_shoot for top/right or
-       * vis vesa for bottom/left. */
+      /* make sure blue_ref >= blue_shoot for top/right or */
+      /* vice versa for bottom/left                        */
       if ( *blue_shoot != *blue_ref )
       {
         FT_Pos   ref       = *blue_ref;
@@ -467,8 +479,10 @@
       else if ( AF_CJK_BLUE_RIGHT == bb )
         blue->flags |= AF_CJK_BLUE_IS_RIGHT;
 
-      FT_TRACE5(( "-- cjk ref = %ld shoot = %ld\n", *blue_ref, *blue_shoot ));
+      FT_TRACE5(( "-- cjk ref = %ld shoot = %ld\n",
+                  *blue_ref, *blue_shoot ));
     }
+
     return;
   }
 
@@ -580,8 +594,8 @@
     /* scale the blue zones */
     for ( nn = 0; nn < axis->blue_count; nn++ )
     {
-      AF_CJKBlue    blue = &axis->blues[nn];
-      FT_Pos        dist;
+      AF_CJKBlue  blue = &axis->blues[nn];
+      FT_Pos      dist;
 
 
       blue->ref.cur   = FT_MulFix( blue->ref.org, scale ) + delta;
@@ -596,10 +610,11 @@
       {
         FT_Pos  delta1, delta2;
 
-        blue->ref.fit   = FT_PIX_ROUND( blue->ref.cur );
+
+        blue->ref.fit  = FT_PIX_ROUND( blue->ref.cur );
 
         /* shoot is under shoot for cjk */
-        delta1 = FT_DivFix(blue->ref.fit, scale) - blue->shoot.org;
+        delta1 = FT_DivFix( blue->ref.fit, scale ) - blue->shoot.org;
         delta2 = delta1;
         if ( delta1 < 0 )
           delta2 = -delta2;
@@ -609,10 +624,10 @@
         FT_TRACE5(( "delta: %d", delta1 ));
         if ( delta2 < 32 )
           delta2 = 0;
-        /*
+#if 0
         else if ( delta2 < 64 )
           delta2 = 32 + ( ( ( delta2 - 32 ) + 16 ) & ~31 );
-        */
+#endif
         else
           delta2 = FT_PIX_ROUND( delta2 );
         FT_TRACE5(( "/%d\n", delta2 ));
@@ -624,10 +639,10 @@
 
         FT_TRACE5(( ">> active cjk blue zone %c%d[%ld/%ld]: "
                      "ref: cur=%.2f fit=%.2f shoot: cur=%.2f fit=%.2f\n",
-                       ( dim == AF_DIMENSION_HORZ ) ? 'H':'V',
+                       ( dim == AF_DIMENSION_HORZ ) ? 'H' : 'V',
                        nn, blue->ref.org, blue->shoot.org,
-                       blue->ref.cur/64.0, blue->ref.fit/64.0,
-                       blue->shoot.cur/64.0, blue->shoot.fit/64.0 ));
+                       blue->ref.cur / 64.0, blue->ref.fit / 64.0,
+                       blue->shoot.cur / 64.0, blue->shoot.fit / 64.0 ));
 
         blue->flags |= AF_CJK_BLUE_ACTIVE;
       }
@@ -1143,14 +1158,14 @@
 
 
   FT_LOCAL_DEF( void )
-  af_cjk_hints_compute_blue_edges( AF_GlyphHints    hints,
-                                   AF_CJKMetrics    metrics,
-                                   AF_Dimension     dim )
+  af_cjk_hints_compute_blue_edges( AF_GlyphHints  hints,
+                                   AF_CJKMetrics  metrics,
+                                   AF_Dimension   dim )
   {
-    AF_AxisHints  axis       = &hints->axis[ dim ];
+    AF_AxisHints  axis       = &hints->axis[dim];
     AF_Edge       edge       = axis->edges;
     AF_Edge       edge_limit = edge + axis->num_edges;
-    AF_CJKAxis    cjk        = &metrics->axis[ dim ];
+    AF_CJKAxis    cjk        = &metrics->axis[dim];
     FT_Fixed      scale      = cjk->scale;
     FT_Pos        best_dist0;  /* initial threshold */
 
@@ -1158,15 +1173,16 @@
     /* compute the initial threshold as a fraction of the EM size */
     best_dist0 = FT_MulFix( metrics->units_per_em / 40, scale );
 
-    if ( best_dist0 > 64 / 2 ) /* Maximum 1/2 pixel */
+    if ( best_dist0 > 64 / 2 ) /* maximum 1/2 pixel */
       best_dist0 = 64 / 2;
 
     /* compute which blue zones are active, i.e. have their scaled */
     /* size < 3/4 pixels                                           */
 
-    /* If the distant between an edge and a blue zone is shorter than
-     * best_dist0, set the blue zone for the edge. Then search for
-     * the blue zone with the smallest best_dist to the edge. */
+    /* If the distant between an edge and a blue zone is shorter than */
+    /* best_dist0, set the blue zone for the edge.  Then search for   */
+    /* the blue zone with the smallest best_dist to the edge.         */
+
     for ( ; edge < edge_limit; edge++ )
     {
       FT_UInt   bb;
@@ -1176,8 +1192,9 @@
 
       for ( bb = 0; bb < cjk->blue_count; bb++ )
       {
-        AF_CJKBlue    blue = cjk->blues + bb;
-        FT_Bool       is_top_right_blue, is_major_dir;
+        AF_CJKBlue  blue = cjk->blues + bb;
+        FT_Bool     is_top_right_blue, is_major_dir;
+
 
         /* skip inactive blue zones (i.e., those that are too small) */
         if ( !( blue->flags & AF_CJK_BLUE_ACTIVE ) )
@@ -1187,8 +1204,9 @@
         /* zone, check for left edges                                      */
         /*                                                                 */
         /* of course, that's for TrueType                                  */
-        is_top_right_blue  = FT_BOOL( ( ( blue->flags & AF_CJK_BLUE_IS_TOP )   != 0 ) ||
-                                      ( ( blue->flags & AF_CJK_BLUE_IS_RIGHT ) != 0 ) );
+        is_top_right_blue  =
+          FT_BOOL( ( ( blue->flags & AF_CJK_BLUE_IS_TOP )   != 0 ) ||
+                   ( ( blue->flags & AF_CJK_BLUE_IS_RIGHT ) != 0 ) );
         is_major_dir = FT_BOOL( edge->dir == axis->major_dir );
 
         /* if it is a top zone, the edge must be against the major    */
@@ -1208,7 +1226,7 @@
             compare = &blue->ref;
 
           dist = edge->fpos - compare->org;
-          if (dist < 0)
+          if ( dist < 0 )
             dist = -dist;
 
           dist = FT_MulFix( dist, scale );
@@ -1227,8 +1245,8 @@
 
 
   FT_LOCAL_DEF( FT_Error )
-  af_cjk_hints_init( AF_GlyphHints    hints,
-                     AF_CJKMetrics    metrics )
+  af_cjk_hints_init( AF_GlyphHints  hints,
+                     AF_CJKMetrics  metrics )
   {
     FT_Render_Mode  mode;
     FT_UInt32       scaler_flags, other_flags;
@@ -1353,11 +1371,11 @@
                              AF_Edge_Flags  base_flags,
                              AF_Edge_Flags  stem_flags )
   {
-    AF_CJKMetrics    metrics  = (AF_CJKMetrics) hints->metrics;
-    AF_CJKAxis       axis     = & metrics->axis[dim];
-    FT_Pos           dist     = width;
-    FT_Int           sign     = 0;
-    FT_Bool          vertical = FT_BOOL( dim == AF_DIMENSION_VERT );
+    AF_CJKMetrics  metrics  = (AF_CJKMetrics) hints->metrics;
+    AF_CJKAxis     axis     = & metrics->axis[dim];
+    FT_Pos         dist     = width;
+    FT_Int         sign     = 0;
+    FT_Bool        vertical = FT_BOOL( dim == AF_DIMENSION_VERT );
 
     FT_UNUSED( base_flags );
     FT_UNUSED( stem_flags );
@@ -2073,9 +2091,9 @@
 
 
   FT_LOCAL_DEF( FT_Error )
-  af_cjk_hints_apply( AF_GlyphHints    hints,
-                      FT_Outline*      outline,
-                      AF_CJKMetrics    metrics )
+  af_cjk_hints_apply( AF_GlyphHints  hints,
+                      FT_Outline*    outline,
+                      AF_CJKMetrics  metrics )
   {
     FT_Error  error;
     int       dim;
diff --git a/src/autofit/afcjk.h b/src/autofit/afcjk.h
index 4b22581..8416c0d 100644
--- a/src/autofit/afcjk.h
+++ b/src/autofit/afcjk.h
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter hinting routines for CJK script (specification).         */
 /*                                                                         */
-/*  Copyright 2006, 2007 by                                                */
+/*  Copyright 2006, 2007, 2011 by                                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -33,9 +33,9 @@ FT_BEGIN_HEADER
   /* CJK (global) metrics management */
 
   /*
-   * CJK glyphs tend to fill the square. So we have both verticle and
-   * horizontal blue zones. But some glyphs have flat bounding stroke that
-   * leave some space between neighbour glyphs.
+   *  CJK glyphs tend to fill the square.  So we have both vertical and
+   *  horizontal blue zones.  But some glyphs have flat bounding strokes that
+   *  leave some space between neighbour glyphs.
    */
   enum
   {
@@ -58,10 +58,11 @@ FT_BEGIN_HEADER
     AF_CJK_BLUE_IS_TOP     = 1 << 1,
     AF_CJK_BLUE_IS_RIGHT   = 1 << 2,
     AF_CJK_BLUE_ADJUSTMENT = 1 << 3,  /* used for scale adjustment */
-                                        /* optimization              */
+                                      /* optimization              */
     AF_CJK_BLUE_FLAG_MAX
   };
 
+
   typedef struct  AF_CJKBlueRec_
   {
     AF_WidthRec  ref;
@@ -70,24 +71,25 @@ FT_BEGIN_HEADER
 
   } AF_CJKBlueRec, *AF_CJKBlue;
 
+
   typedef struct  AF_CJKAxisRec_
   {
-    FT_Fixed         scale;
-    FT_Pos           delta;
+    FT_Fixed       scale;
+    FT_Pos         delta;
 
-    FT_UInt          width_count;
-    AF_WidthRec      widths[AF_CJK_MAX_WIDTHS];
-    FT_Pos           edge_distance_threshold;
-    FT_Pos           standard_width;
-    FT_Bool          extra_light;
+    FT_UInt        width_count;
+    AF_WidthRec    widths[AF_CJK_MAX_WIDTHS];
+    FT_Pos         edge_distance_threshold;
+    FT_Pos         standard_width;
+    FT_Bool        extra_light;
 
     /* used for horizontal metrics too for CJK */
-    FT_Bool          control_overshoot;
-    FT_UInt          blue_count;
-    AF_CJKBlueRec    blues[AF_CJK_BLUE_MAX];
+    FT_Bool        control_overshoot;
+    FT_UInt        blue_count;
+    AF_CJKBlueRec  blues[AF_CJK_BLUE_MAX];
 
-    FT_Fixed         org_scale;
-    FT_Pos           org_delta;
+    FT_Fixed       org_scale;
+    FT_Pos         org_delta;
 
   } AF_CJKAxisRec, *AF_CJKAxis;
 
@@ -100,22 +102,23 @@ FT_BEGIN_HEADER
 
   } AF_CJKMetricsRec, *AF_CJKMetrics;
 
+
   FT_LOCAL( FT_Error )
-  af_cjk_metrics_init( AF_CJKMetrics    metrics,
-                       FT_Face          face );
+  af_cjk_metrics_init( AF_CJKMetrics  metrics,
+                       FT_Face        face );
 
   FT_LOCAL( void )
-  af_cjk_metrics_scale( AF_CJKMetrics    metrics,
-                        AF_Scaler        scaler );
+  af_cjk_metrics_scale( AF_CJKMetrics  metrics,
+                        AF_Scaler      scaler );
 
   FT_LOCAL( FT_Error )
-  af_cjk_hints_init( AF_GlyphHints    hints,
-                     AF_CJKMetrics    metrics );
+  af_cjk_hints_init( AF_GlyphHints  hints,
+                     AF_CJKMetrics  metrics );
 
   FT_LOCAL( FT_Error )
-  af_cjk_hints_apply( AF_GlyphHints    hints,
-                      FT_Outline*      outline,
-                      AF_CJKMetrics    metrics );
+  af_cjk_hints_apply( AF_GlyphHints  hints,
+                      FT_Outline*    outline,
+                      AF_CJKMetrics  metrics );
 
   /* Shared. called from afindic.c */
   FT_LOCAL( void )
diff --git a/src/autofit/afindic.c b/src/autofit/afindic.c
index 7c2f4dd..c232cff 100644
--- a/src/autofit/afindic.c
+++ b/src/autofit/afindic.c
@@ -33,8 +33,8 @@
 
 
   static FT_Error
-  af_indic_metrics_init( AF_CJKMetrics    metrics,
-                         FT_Face          face )
+  af_indic_metrics_init( AF_CJKMetrics  metrics,
+                         FT_Face        face )
   {
     /* skip blue zone init in CJK routines */
     FT_CharMap  oldmap = face->charmap;
@@ -48,7 +48,7 @@
     {
       af_cjk_metrics_init_widths( metrics, face, 0x7530 );
 #if 0
-      /* either need indic specific blue_chars[] or just skip blue zones. */
+      /* either need indic specific blue_chars[] or just skip blue zones */
       af_cjk_metrics_init_blues( metrics, face, af_cjk_blue_chars );
 #endif
       af_cjk_metrics_check_digits( metrics, face );
@@ -61,8 +61,8 @@
 
 
   static void
-  af_indic_metrics_scale( AF_CJKMetrics    metrics,
-                          AF_Scaler        scaler )
+  af_indic_metrics_scale( AF_CJKMetrics  metrics,
+                          AF_Scaler      scaler )
   {
     /* use CJK routines */
     af_cjk_metrics_scale( metrics, scaler );
@@ -70,8 +70,8 @@
 
 
   static FT_Error
-  af_indic_hints_init( AF_GlyphHints    hints,
-                       AF_CJKMetrics    metrics )
+  af_indic_hints_init( AF_GlyphHints  hints,
+                       AF_CJKMetrics  metrics )
   {
     /* use CJK routines */
     return af_cjk_hints_init( hints, metrics );
@@ -79,9 +79,9 @@
 
 
   static FT_Error
-  af_indic_hints_apply( AF_GlyphHints    hints,
-                        FT_Outline*      outline,
-                        AF_CJKMetrics    metrics)
+  af_indic_hints_apply( AF_GlyphHints  hints,
+                        FT_Outline*    outline,
+                        AF_CJKMetrics  metrics )
   {
     /* use CJK routines */
     return af_cjk_hints_apply( hints, outline, metrics );