Commit 6edaef3b14b94136eb11591ed94b67cc8c8c9f12

Werner Lemberg 2012-08-24T13:41:24

[sfnt] More 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
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
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
diff --git a/src/sfnt/sfdriver.c b/src/sfnt/sfdriver.c
index 847d83d..9c4c3d8 100644
--- a/src/sfnt/sfdriver.c
+++ b/src/sfnt/sfdriver.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    High-level SFNT driver interface (body).                             */
 /*                                                                         */
-/*  Copyright 1996-2007, 2009-2011 by                                      */
+/*  Copyright 1996-2007, 2009-2012 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -50,6 +50,7 @@
 #include FT_SERVICE_SFNT_H
 #include FT_SERVICE_TT_CMAP_H
 
+
   /*************************************************************************/
   /*                                                                       */
   /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
@@ -60,10 +61,10 @@
 #define FT_COMPONENT  trace_sfdriver
 
 
- /*
-  *  SFNT TABLE SERVICE
-  *
-  */
+  /*
+   *  SFNT TABLE SERVICE
+   *
+   */
 
   static void*
   get_sfnt_table( TT_Face      face,
@@ -136,19 +137,19 @@
   }
 
 
-  FT_DEFINE_SERVICE_SFNT_TABLEREC(sfnt_service_sfnt_table,
+  FT_DEFINE_SERVICE_SFNT_TABLEREC(
+    sfnt_service_sfnt_table,
     (FT_SFNT_TableLoadFunc)tt_face_load_any,
     (FT_SFNT_TableGetFunc) get_sfnt_table,
-    (FT_SFNT_TableInfoFunc)sfnt_table_info
-  )
+    (FT_SFNT_TableInfoFunc)sfnt_table_info )
 
 
 #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
 
- /*
-  *  GLYPH DICT SERVICE
-  *
-  */
+  /*
+   *  GLYPH DICT SERVICE
+   *
+   */
 
   static FT_Error
   sfnt_get_glyph_name( TT_Face     face,
@@ -172,17 +173,18 @@
   sfnt_get_name_index( TT_Face     face,
                        FT_String*  glyph_name )
   {
-    FT_Face   root = &face->root;
-    FT_UInt   i, max_gid = FT_UINT_MAX;
+    FT_Face  root = &face->root;
+
+    FT_UInt  i, max_gid = FT_UINT_MAX;
 
 
     if ( root->num_glyphs < 0 )
       return 0;
-    else if ( ( FT_ULong ) root->num_glyphs < FT_UINT_MAX )
-      max_gid = ( FT_UInt ) root->num_glyphs;
+    else if ( (FT_ULong)root->num_glyphs < FT_UINT_MAX )
+      max_gid = (FT_UInt)root->num_glyphs;
     else
       FT_TRACE0(( "Ignore glyph names for invalid GID 0x%08x - 0x%08x\n",
-         FT_UINT_MAX, root->num_glyphs ));
+                  FT_UINT_MAX, root->num_glyphs ));
 
     for ( i = 0; i < max_gid; i++ )
     {
@@ -201,18 +203,19 @@
   }
 
 
-  FT_DEFINE_SERVICE_GLYPHDICTREC(sfnt_service_glyph_dict,
+  FT_DEFINE_SERVICE_GLYPHDICTREC(
+    sfnt_service_glyph_dict,
     (FT_GlyphDict_GetNameFunc)  sfnt_get_glyph_name,
-    (FT_GlyphDict_NameIndexFunc)sfnt_get_name_index
-  )
+    (FT_GlyphDict_NameIndexFunc)sfnt_get_name_index )
+
 
 #endif /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */
 
 
- /*
-  *  POSTSCRIPT NAME SERVICE
-  *
-  */
+  /*
+   *  POSTSCRIPT NAME SERVICE
+   *
+   */
 
   static const char*
   sfnt_get_ps_name( TT_Face  face )
@@ -324,17 +327,18 @@
     return result;
   }
 
-  FT_DEFINE_SERVICE_PSFONTNAMEREC(sfnt_service_ps_name,
-    (FT_PsName_GetFunc)sfnt_get_ps_name
-  )
+
+  FT_DEFINE_SERVICE_PSFONTNAMEREC(
+    sfnt_service_ps_name,
+    (FT_PsName_GetFunc)sfnt_get_ps_name )
 
 
   /*
    *  TT CMAP INFO
    */
-  FT_DEFINE_SERVICE_TTCMAPSREC(tt_service_get_cmap_info,
-    (TT_CMap_Info_GetFunc)tt_get_cmap_info
-  )
+  FT_DEFINE_SERVICE_TTCMAPSREC(
+    tt_service_get_cmap_info,
+    (TT_CMap_Info_GetFunc)tt_get_cmap_info )
 
 
 #ifdef TT_CONFIG_OPTION_BDF
@@ -375,10 +379,11 @@
   }
 
 
-  FT_DEFINE_SERVICE_BDFRec(sfnt_service_bdf,
-    (FT_BDF_GetCharsetIdFunc) sfnt_get_charset_id,
-    (FT_BDF_GetPropertyFunc)  tt_face_find_bdf_prop
-  )
+  FT_DEFINE_SERVICE_BDFRec(
+    sfnt_service_bdf,
+    (FT_BDF_GetCharsetIdFunc)sfnt_get_charset_id,
+    (FT_BDF_GetPropertyFunc) tt_face_find_bdf_prop )
+
 
 #endif /* TT_CONFIG_OPTION_BDF */
 
@@ -388,33 +393,33 @@
    */
 
 #if defined TT_CONFIG_OPTION_POSTSCRIPT_NAMES && defined TT_CONFIG_OPTION_BDF
-  FT_DEFINE_SERVICEDESCREC5(sfnt_services,
+  FT_DEFINE_SERVICEDESCREC5(
+    sfnt_services,
     FT_SERVICE_ID_SFNT_TABLE,           &FT_SFNT_SERVICE_SFNT_TABLE_GET,
     FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &FT_SFNT_SERVICE_PS_NAME_GET,
     FT_SERVICE_ID_GLYPH_DICT,           &FT_SFNT_SERVICE_GLYPH_DICT_GET,
     FT_SERVICE_ID_BDF,                  &FT_SFNT_SERVICE_BDF_GET,
-    FT_SERVICE_ID_TT_CMAP,              &FT_TT_SERVICE_GET_CMAP_INFO_GET
-  )
+    FT_SERVICE_ID_TT_CMAP,              &FT_TT_SERVICE_GET_CMAP_INFO_GET )
 #elif defined TT_CONFIG_OPTION_POSTSCRIPT_NAMES
-  FT_DEFINE_SERVICEDESCREC4(sfnt_services,
+  FT_DEFINE_SERVICEDESCREC4(
+    sfnt_services,
     FT_SERVICE_ID_SFNT_TABLE,           &FT_SFNT_SERVICE_SFNT_TABLE_GET,
     FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &FT_SFNT_SERVICE_PS_NAME_GET,
     FT_SERVICE_ID_GLYPH_DICT,           &FT_SFNT_SERVICE_GLYPH_DICT_GET,
-    FT_SERVICE_ID_TT_CMAP,              &FT_TT_SERVICE_GET_CMAP_INFO_GET
-  )
+    FT_SERVICE_ID_TT_CMAP,              &FT_TT_SERVICE_GET_CMAP_INFO_GET )
 #elif defined TT_CONFIG_OPTION_BDF
-  FT_DEFINE_SERVICEDESCREC4(sfnt_services,
+  FT_DEFINE_SERVICEDESCREC4(
+    sfnt_services,
     FT_SERVICE_ID_SFNT_TABLE,           &FT_SFNT_SERVICE_SFNT_TABLE_GET,
     FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &FT_SFNT_SERVICE_PS_NAME_GET,
     FT_SERVICE_ID_BDF,                  &FT_SFNT_SERVICE_BDF_GET,
-    FT_SERVICE_ID_TT_CMAP,              &FT_TT_SERVICE_GET_CMAP_INFO_GET
-  )
+    FT_SERVICE_ID_TT_CMAP,              &FT_TT_SERVICE_GET_CMAP_INFO_GET )
 #else
-  FT_DEFINE_SERVICEDESCREC3(sfnt_services,
+  FT_DEFINE_SERVICEDESCREC3(
+    sfnt_services,
     FT_SERVICE_ID_SFNT_TABLE,           &FT_SFNT_SERVICE_SFNT_TABLE_GET,
     FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &FT_SFNT_SERVICE_PS_NAME_GET,
-    FT_SERVICE_ID_TT_CMAP,              &FT_TT_SERVICE_GET_CMAP_INFO_GET
-  )
+    FT_SERVICE_ID_TT_CMAP,              &FT_TT_SERVICE_GET_CMAP_INFO_GET )
 #endif
 
 
@@ -435,6 +440,7 @@
 #else
     FT_UNUSED( module );
 #endif
+
     return ft_service_list_lookup( FT_SFNT_SERVICES_GET, module_interface );
   }
 
@@ -566,18 +572,21 @@
 
 #endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
 
+
 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
-#define PUT_EMBEDDED_BITMAPS(a) a
+#define PUT_EMBEDDED_BITMAPS( a )  a
 #else
-#define PUT_EMBEDDED_BITMAPS(a) 0
+#define PUT_EMBEDDED_BITMAPS( a )  NULL
 #endif
+
 #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
-#define PUT_PS_NAMES(a) a
+#define PUT_PS_NAMES( a )  a
 #else
-#define PUT_PS_NAMES(a) 0
+#define PUT_PS_NAMES( a )  NULL
 #endif
 
-  FT_DEFINE_SFNT_INTERFACE(sfnt_interface,
+  FT_DEFINE_SFNT_INTERFACE(
+    sfnt_interface,
     tt_face_goto_table,
 
     sfnt_init_face,
@@ -588,7 +597,7 @@
     tt_face_load_any,
 
     tt_face_load_sfnt_header_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
-    tt_face_load_directory_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
+    tt_face_load_directory_stub,   /* FT_CONFIG_OPTION_OLD_INTERNALS */
 
     tt_face_load_head,
     tt_face_load_hhea,
@@ -608,21 +617,21 @@
     tt_face_load_pclt,
 
     /* see `ttload.h' */
-    PUT_EMBEDDED_BITMAPS(tt_face_load_bhed),
+    PUT_EMBEDDED_BITMAPS( tt_face_load_bhed ),
 
     tt_face_set_sbit_strike_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
-    tt_face_load_sbit_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
+    tt_face_load_sbit_stub,       /* FT_CONFIG_OPTION_OLD_INTERNALS */
 
-    tt_find_sbit_image, /* FT_CONFIG_OPTION_OLD_INTERNALS */
+    tt_find_sbit_image,   /* FT_CONFIG_OPTION_OLD_INTERNALS */
     tt_load_sbit_metrics, /* FT_CONFIG_OPTION_OLD_INTERNALS */
 
-    PUT_EMBEDDED_BITMAPS(tt_face_load_sbit_image),
+    PUT_EMBEDDED_BITMAPS( tt_face_load_sbit_image ),
 
     tt_face_free_sbit_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
 
     /* see `ttpost.h' */
-    PUT_PS_NAMES(tt_face_get_ps_name),
-    PUT_PS_NAMES(tt_face_free_ps_names),
+    PUT_PS_NAMES( tt_face_get_ps_name   ),
+    PUT_PS_NAMES( tt_face_free_ps_names ),
 
     tt_face_load_charmap_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
     tt_face_free_charmap_stub, /* FT_CONFIG_OPTION_OLD_INTERNALS */
@@ -637,17 +646,18 @@
     tt_face_load_hmtx,
 
     /* see `ttsbit.h' and `sfnt.h' */
-    PUT_EMBEDDED_BITMAPS(tt_face_load_eblc),
-    PUT_EMBEDDED_BITMAPS(tt_face_free_eblc),
+    PUT_EMBEDDED_BITMAPS( tt_face_load_eblc ),
+    PUT_EMBEDDED_BITMAPS( tt_face_free_eblc ),
 
-    PUT_EMBEDDED_BITMAPS(tt_face_set_sbit_strike),
-    PUT_EMBEDDED_BITMAPS(tt_face_load_strike_metrics),
+    PUT_EMBEDDED_BITMAPS( tt_face_set_sbit_strike     ),
+    PUT_EMBEDDED_BITMAPS( tt_face_load_strike_metrics ),
 
     tt_face_get_metrics
   )
 
 
-  FT_DEFINE_MODULE(sfnt_module_class,
+  FT_DEFINE_MODULE(
+    sfnt_module_class,
 
     0,  /* not a font driver or renderer */
     sizeof ( FT_ModuleRec ),
@@ -660,8 +670,7 @@
 
     (FT_Module_Constructor)0,
     (FT_Module_Destructor) 0,
-    (FT_Module_Requester)  sfnt_get_interface
-  )
+    (FT_Module_Requester)  sfnt_get_interface )
 
 
 /* END */
diff --git a/src/sfnt/ttcmap.c b/src/sfnt/ttcmap.c
index 7957e12..461956d 100644
--- a/src/sfnt/ttcmap.c
+++ b/src/sfnt/ttcmap.c
@@ -165,20 +165,24 @@
   }
 
 
-  FT_DEFINE_TT_CMAP(tt_cmap0_class_rec,
-      sizeof ( TT_CMapRec ),
+  FT_DEFINE_TT_CMAP(
+    tt_cmap0_class_rec,
+    sizeof ( TT_CMapRec ),
 
-      (FT_CMap_InitFunc)     tt_cmap_init,
-      (FT_CMap_DoneFunc)     NULL,
-      (FT_CMap_CharIndexFunc)tt_cmap0_char_index,
-      (FT_CMap_CharNextFunc) tt_cmap0_char_next,
+    (FT_CMap_InitFunc)     tt_cmap_init,
+    (FT_CMap_DoneFunc)     NULL,
+    (FT_CMap_CharIndexFunc)tt_cmap0_char_index,
+    (FT_CMap_CharNextFunc) tt_cmap0_char_next,
+
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
 
-      NULL, NULL, NULL, NULL, NULL
-    ,
     0,
-    (TT_CMap_ValidateFunc)   tt_cmap0_validate,
-    (TT_CMap_Info_GetFunc)   tt_cmap0_get_info
-  )
+    (TT_CMap_ValidateFunc)tt_cmap0_validate,
+    (TT_CMap_Info_GetFunc)tt_cmap0_get_info )
 
 #endif /* TT_CONFIG_CMAP_FORMAT_0 */
 
@@ -541,20 +545,24 @@
   }
 
 
-  FT_DEFINE_TT_CMAP(tt_cmap2_class_rec,
-      sizeof ( TT_CMapRec ),
+  FT_DEFINE_TT_CMAP(
+    tt_cmap2_class_rec,
+    sizeof ( TT_CMapRec ),
 
-      (FT_CMap_InitFunc)     tt_cmap_init,
-      (FT_CMap_DoneFunc)     NULL,
-      (FT_CMap_CharIndexFunc)tt_cmap2_char_index,
-      (FT_CMap_CharNextFunc) tt_cmap2_char_next,
+    (FT_CMap_InitFunc)     tt_cmap_init,
+    (FT_CMap_DoneFunc)     NULL,
+    (FT_CMap_CharIndexFunc)tt_cmap2_char_index,
+    (FT_CMap_CharNextFunc) tt_cmap2_char_next,
+
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
 
-      NULL, NULL, NULL, NULL, NULL
-    ,
     2,
-    (TT_CMap_ValidateFunc)   tt_cmap2_validate,
-    (TT_CMap_Info_GetFunc)   tt_cmap2_get_info
-  )
+    (TT_CMap_ValidateFunc)tt_cmap2_validate,
+    (TT_CMap_Info_GetFunc)tt_cmap2_get_info )
 
 #endif /* TT_CONFIG_CMAP_FORMAT_2 */
 
@@ -1377,19 +1385,23 @@
   }
 
 
-  FT_DEFINE_TT_CMAP(tt_cmap4_class_rec,
-      sizeof ( TT_CMap4Rec ),
-      (FT_CMap_InitFunc)     tt_cmap4_init,
-      (FT_CMap_DoneFunc)     NULL,
-      (FT_CMap_CharIndexFunc)tt_cmap4_char_index,
-      (FT_CMap_CharNextFunc) tt_cmap4_char_next,
+  FT_DEFINE_TT_CMAP(
+    tt_cmap4_class_rec,
+    sizeof ( TT_CMap4Rec ),
+    (FT_CMap_InitFunc)     tt_cmap4_init,
+    (FT_CMap_DoneFunc)     NULL,
+    (FT_CMap_CharIndexFunc)tt_cmap4_char_index,
+    (FT_CMap_CharNextFunc) tt_cmap4_char_next,
+
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
 
-      NULL, NULL, NULL, NULL, NULL
-    ,
     4,
-    (TT_CMap_ValidateFunc)   tt_cmap4_validate,
-    (TT_CMap_Info_GetFunc)   tt_cmap4_get_info
-  )
+    (TT_CMap_ValidateFunc)tt_cmap4_validate,
+    (TT_CMap_Info_GetFunc)tt_cmap4_get_info )
 
 #endif /* TT_CONFIG_CMAP_FORMAT_4 */
 
@@ -1536,20 +1548,24 @@
   }
 
 
-  FT_DEFINE_TT_CMAP(tt_cmap6_class_rec,
-      sizeof ( TT_CMapRec ),
+  FT_DEFINE_TT_CMAP(
+    tt_cmap6_class_rec,
+    sizeof ( TT_CMapRec ),
 
-      (FT_CMap_InitFunc)     tt_cmap_init,
-      (FT_CMap_DoneFunc)     NULL,
-      (FT_CMap_CharIndexFunc)tt_cmap6_char_index,
-      (FT_CMap_CharNextFunc) tt_cmap6_char_next,
+    (FT_CMap_InitFunc)     tt_cmap_init,
+    (FT_CMap_DoneFunc)     NULL,
+    (FT_CMap_CharIndexFunc)tt_cmap6_char_index,
+    (FT_CMap_CharNextFunc) tt_cmap6_char_next,
+
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
 
-      NULL, NULL, NULL, NULL, NULL
-    ,
     6,
-    (TT_CMap_ValidateFunc)   tt_cmap6_validate,
-    (TT_CMap_Info_GetFunc)   tt_cmap6_get_info
-  )
+    (TT_CMap_ValidateFunc)tt_cmap6_validate,
+    (TT_CMap_Info_GetFunc)tt_cmap6_get_info )
 
 #endif /* TT_CONFIG_CMAP_FORMAT_6 */
 
@@ -1789,20 +1805,24 @@
   }
 
 
-  FT_DEFINE_TT_CMAP(tt_cmap8_class_rec,
-      sizeof ( TT_CMapRec ),
+  FT_DEFINE_TT_CMAP(
+    tt_cmap8_class_rec,
+    sizeof ( TT_CMapRec ),
 
-      (FT_CMap_InitFunc)     tt_cmap_init,
-      (FT_CMap_DoneFunc)     NULL,
-      (FT_CMap_CharIndexFunc)tt_cmap8_char_index,
-      (FT_CMap_CharNextFunc) tt_cmap8_char_next,
+    (FT_CMap_InitFunc)     tt_cmap_init,
+    (FT_CMap_DoneFunc)     NULL,
+    (FT_CMap_CharIndexFunc)tt_cmap8_char_index,
+    (FT_CMap_CharNextFunc) tt_cmap8_char_next,
+
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
 
-      NULL, NULL, NULL, NULL, NULL
-    ,
     8,
-    (TT_CMap_ValidateFunc)   tt_cmap8_validate,
-    (TT_CMap_Info_GetFunc)   tt_cmap8_get_info
-  )
+    (TT_CMap_ValidateFunc)tt_cmap8_validate,
+    (TT_CMap_Info_GetFunc)tt_cmap8_get_info )
 
 #endif /* TT_CONFIG_CMAP_FORMAT_8 */
 
@@ -1938,20 +1958,24 @@
   }
 
 
-  FT_DEFINE_TT_CMAP(tt_cmap10_class_rec,
-      sizeof ( TT_CMapRec ),
+  FT_DEFINE_TT_CMAP(
+    tt_cmap10_class_rec,
+    sizeof ( TT_CMapRec ),
+
+    (FT_CMap_InitFunc)     tt_cmap_init,
+    (FT_CMap_DoneFunc)     NULL,
+    (FT_CMap_CharIndexFunc)tt_cmap10_char_index,
+    (FT_CMap_CharNextFunc) tt_cmap10_char_next,
 
-      (FT_CMap_InitFunc)     tt_cmap_init,
-      (FT_CMap_DoneFunc)     NULL,
-      (FT_CMap_CharIndexFunc)tt_cmap10_char_index,
-      (FT_CMap_CharNextFunc) tt_cmap10_char_next,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
 
-      NULL, NULL, NULL, NULL, NULL
-    ,
     10,
-    (TT_CMap_ValidateFunc)   tt_cmap10_validate,
-    (TT_CMap_Info_GetFunc)   tt_cmap10_get_info
-  )
+    (TT_CMap_ValidateFunc)tt_cmap10_validate,
+    (TT_CMap_Info_GetFunc)tt_cmap10_get_info )
 
 #endif /* TT_CONFIG_CMAP_FORMAT_10 */
 
@@ -2258,20 +2282,24 @@
   }
 
 
-  FT_DEFINE_TT_CMAP(tt_cmap12_class_rec,
-      sizeof ( TT_CMap12Rec ),
+  FT_DEFINE_TT_CMAP(
+    tt_cmap12_class_rec,
+    sizeof ( TT_CMap12Rec ),
+
+    (FT_CMap_InitFunc)     tt_cmap12_init,
+    (FT_CMap_DoneFunc)     NULL,
+    (FT_CMap_CharIndexFunc)tt_cmap12_char_index,
+    (FT_CMap_CharNextFunc) tt_cmap12_char_next,
 
-      (FT_CMap_InitFunc)     tt_cmap12_init,
-      (FT_CMap_DoneFunc)     NULL,
-      (FT_CMap_CharIndexFunc)tt_cmap12_char_index,
-      (FT_CMap_CharNextFunc) tt_cmap12_char_next,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
 
-      NULL, NULL, NULL, NULL, NULL
-    ,
     12,
-    (TT_CMap_ValidateFunc)   tt_cmap12_validate,
-    (TT_CMap_Info_GetFunc)   tt_cmap12_get_info
-  )
+    (TT_CMap_ValidateFunc)tt_cmap12_validate,
+    (TT_CMap_Info_GetFunc)tt_cmap12_get_info )
 
 #endif /* TT_CONFIG_CMAP_FORMAT_12 */
 
@@ -2338,9 +2366,9 @@
   tt_cmap13_validate( FT_Byte*      table,
                       FT_Validator  valid )
   {
-    FT_Byte*   p;
-    FT_ULong   length;
-    FT_ULong   num_groups;
+    FT_Byte*  p;
+    FT_ULong  length;
+    FT_ULong  num_groups;
 
 
     if ( table + 16 > valid->limit )
@@ -2490,7 +2518,6 @@
 
       /* if `char_code' is not in any group, then `mid' is */
       /* the group nearest to `char_code'                  */
-      /*                                                   */
 
       if ( char_code > end )
       {
@@ -2574,20 +2601,24 @@
   }
 
 
-  FT_DEFINE_TT_CMAP(tt_cmap13_class_rec,
-      sizeof ( TT_CMap13Rec ),
+  FT_DEFINE_TT_CMAP(
+    tt_cmap13_class_rec,
+    sizeof ( TT_CMap13Rec ),
 
-      (FT_CMap_InitFunc)     tt_cmap13_init,
-      (FT_CMap_DoneFunc)     NULL,
-      (FT_CMap_CharIndexFunc)tt_cmap13_char_index,
-      (FT_CMap_CharNextFunc) tt_cmap13_char_next,
+    (FT_CMap_InitFunc)     tt_cmap13_init,
+    (FT_CMap_DoneFunc)     NULL,
+    (FT_CMap_CharIndexFunc)tt_cmap13_char_index,
+    (FT_CMap_CharNextFunc) tt_cmap13_char_next,
+
+    NULL,
+    NULL,
+    NULL,
+    NULL,
+    NULL,
 
-      NULL, NULL, NULL, NULL, NULL
-    ,
     13,
-    (TT_CMap_ValidateFunc)   tt_cmap13_validate,
-    (TT_CMap_Info_GetFunc)   tt_cmap13_get_info
-  )
+    (TT_CMap_ValidateFunc)tt_cmap13_validate,
+    (TT_CMap_Info_GetFunc)tt_cmap13_get_info )
 
 #endif /* TT_CONFIG_CMAP_FORMAT_13 */
 
@@ -2688,8 +2719,8 @@
                     FT_UInt32  num_results,
                     FT_Memory  memory )
   {
-    FT_UInt32 old_max = cmap->max_results;
-    FT_Error  error   = SFNT_Err_Ok;
+    FT_UInt32  old_max = cmap->max_results;
+    FT_Error   error   = SFNT_Err_Ok;
 
 
     if ( num_results > cmap->max_results )
@@ -2713,9 +2744,9 @@
     cmap->cmap.data = table;
 
     table               += 6;
-    cmap->num_selectors = FT_PEEK_ULONG( table );
-    cmap->max_results   = 0;
-    cmap->results       = NULL;
+    cmap->num_selectors  = FT_PEEK_ULONG( table );
+    cmap->max_results    = 0;
+    cmap->results        = NULL;
 
     return SFNT_Err_Ok;
   }
@@ -2791,7 +2822,7 @@
         {
           FT_Byte*  ndp         = table + nondefOff;
           FT_ULong  numMappings = TT_NEXT_ULONG( ndp );
-          FT_ULong  i, lastUni = 0;
+          FT_ULong  i, lastUni  = 0;
 
 
           if ( numMappings * 4 > (FT_ULong)( valid->limit - ndp ) )
@@ -2965,7 +2996,7 @@
   tt_cmap14_char_var_index( TT_CMap    cmap,
                             TT_CMap    ucmap,
                             FT_UInt32  charcode,
-                            FT_UInt32  variantSelector)
+                            FT_UInt32  variantSelector )
   {
     FT_Byte*  p = tt_cmap14_find_variant( cmap->data + 6, variantSelector );
     FT_ULong  defOff;
@@ -3106,9 +3137,9 @@
 
 
   static FT_UInt32*
-  tt_cmap14_get_def_chars( TT_CMap     cmap,
-                           FT_Byte*    p,
-                           FT_Memory   memory )
+  tt_cmap14_get_def_chars( TT_CMap    cmap,
+                           FT_Byte*   p,
+                           FT_Memory  memory )
   {
     TT_CMap14   cmap14 = (TT_CMap14) cmap;
     FT_UInt32   numRanges;
@@ -3124,7 +3155,7 @@
 
     for ( q = cmap14->results; numRanges > 0; --numRanges )
     {
-      FT_UInt32 uni = (FT_UInt32)TT_NEXT_UINT24( p );
+      FT_UInt32  uni = (FT_UInt32)TT_NEXT_UINT24( p );
 
 
       cnt = FT_NEXT_BYTE( p ) + 1;
@@ -3133,6 +3164,7 @@
         q[0]  = uni;
         uni  += 1;
         q    += 1;
+
       } while ( --cnt != 0 );
     }
     q[0] = 0;
@@ -3306,25 +3338,25 @@
   }
 
 
-  FT_DEFINE_TT_CMAP(tt_cmap14_class_rec,
-      sizeof ( TT_CMap14Rec ),
+  FT_DEFINE_TT_CMAP(
+    tt_cmap14_class_rec,
+    sizeof ( TT_CMap14Rec ),
 
-      (FT_CMap_InitFunc)     tt_cmap14_init,
-      (FT_CMap_DoneFunc)     tt_cmap14_done,
-      (FT_CMap_CharIndexFunc)tt_cmap14_char_index,
-      (FT_CMap_CharNextFunc) tt_cmap14_char_next,
+    (FT_CMap_InitFunc)     tt_cmap14_init,
+    (FT_CMap_DoneFunc)     tt_cmap14_done,
+    (FT_CMap_CharIndexFunc)tt_cmap14_char_index,
+    (FT_CMap_CharNextFunc) tt_cmap14_char_next,
+
+    /* Format 14 extension functions */
+    (FT_CMap_CharVarIndexFunc)    tt_cmap14_char_var_index,
+    (FT_CMap_CharVarIsDefaultFunc)tt_cmap14_char_var_isdefault,
+    (FT_CMap_VariantListFunc)     tt_cmap14_variants,
+    (FT_CMap_CharVariantListFunc) tt_cmap14_char_variants,
+    (FT_CMap_VariantCharListFunc) tt_cmap14_variant_chars,
 
-      /* Format 14 extension functions */
-      (FT_CMap_CharVarIndexFunc)    tt_cmap14_char_var_index,
-      (FT_CMap_CharVarIsDefaultFunc)tt_cmap14_char_var_isdefault,
-      (FT_CMap_VariantListFunc)     tt_cmap14_variants,
-      (FT_CMap_CharVariantListFunc) tt_cmap14_char_variants,
-      (FT_CMap_VariantCharListFunc) tt_cmap14_variant_chars
-    ,
     14,
     (TT_CMap_ValidateFunc)tt_cmap14_validate,
-    (TT_CMap_Info_GetFunc)tt_cmap14_get_info
-  )
+    (TT_CMap_Info_GetFunc)tt_cmap14_get_info )
 
 #endif /* TT_CONFIG_CMAP_FORMAT_14 */
 
@@ -3333,43 +3365,55 @@
 
   static const TT_CMap_Class  tt_cmap_classes[] =
   {
-#define TTCMAPCITEM(a) &a,
+#define TTCMAPCITEM( a )  &a,
 #include "ttcmapc.h"
     NULL,
   };
 
 #else /*FT_CONFIG_OPTION_PIC*/
 
-  void FT_Destroy_Class_tt_cmap_classes(FT_Library library, TT_CMap_Class* clazz)
+  void
+  FT_Destroy_Class_tt_cmap_classes( FT_Library      library,
+                                    TT_CMap_Class*  clazz )
   {
-    FT_Memory memory = library->memory;
+    FT_Memory  memory = library->memory;
+
+
     if ( clazz )
       FT_FREE( clazz );
   }
 
-  FT_Error FT_Create_Class_tt_cmap_classes(FT_Library library, TT_CMap_Class** output_class)
+
+  FT_Error
+  FT_Create_Class_tt_cmap_classes( FT_Library       library,
+                                   TT_CMap_Class**  output_class )
   {
-    TT_CMap_Class*  clazz;
-    TT_CMap_ClassRec* recs;
-    FT_Error          error;
-    FT_Memory memory = library->memory;
-    int i = 0;
+    TT_CMap_Class*     clazz;
+    TT_CMap_ClassRec*  recs;
+    FT_Error           error;
+    FT_Memory          memory = library->memory;
 
-#define TTCMAPCITEM(a) i++;
+    int  i = 0;
+
+
+#define TTCMAPCITEM( a ) i++;
 #include "ttcmapc.h"
 
-    /* allocate enough space for both the pointers +terminator and the class instances */
-    if ( FT_ALLOC( clazz, sizeof(*clazz)*(i+1)+sizeof(TT_CMap_ClassRec)*i ) )
+    /* allocate enough space for both the pointers */
+    /* plus terminator and the class instances     */
+    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * ( i + 1 ) +
+                          sizeof ( TT_CMap_ClassRec ) * i ) )
       return error;
 
     /* the location of the class instances follows the array of pointers */
-    recs = (TT_CMap_ClassRec*) (((char*)clazz)+(sizeof(*clazz)*(i+1)));
-    i=0;
+    recs = (TT_CMap_ClassRec*)( (char*)clazz +
+                                sizeof ( *clazz ) * ( i + 1 ) );
+    i    = 0;
 
 #undef TTCMAPCITEM
-#define TTCMAPCITEM(a)           \
-    FT_Init_Class_##a(&recs[i]); \
-    clazz[i] = &recs[i];         \
+#define  TTCMAPCITEM( a )             \
+    FT_Init_Class_ ## a( &recs[i] );  \
+    clazz[i] = &recs[i];              \
     i++;
 #include "ttcmapc.h"
 
@@ -3411,10 +3455,12 @@
     }
 
     num_cmaps = TT_NEXT_USHORT( p );
+
 #ifdef FT_MAX_CHARMAP_CACHEABLE
     if ( num_cmaps > FT_MAX_CHARMAP_CACHEABLE )
-      FT_ERROR(( "tt_face_build_cmaps: too many cmap subtables(%d) "
-                 "subtable#%d and later are loaded but cannot be searched\n",
+      FT_ERROR(( "tt_face_build_cmaps: too many cmap subtables (%d)\n"
+                 "                     subtable #%d and higher are loaded"
+                 "                     but cannot be searched\n",
                  num_cmaps, FT_MAX_CHARMAP_CACHEABLE + 1 ));
 #endif
 
@@ -3463,9 +3509,9 @@
               FT_CMap  ttcmap;
 
 
-              /* It might make sense to store the single variation selector */
-              /* cmap somewhere special.  But it would have to be in the    */
-              /* public FT_FaceRec, and we can't change that.               */
+              /* It might make sense to store the single variation         */
+              /* selector cmap somewhere special.  But it would have to be */
+              /* in the public FT_FaceRec, and we can't change that.       */
 
               if ( !FT_CMap_New( (FT_CMap_Class)clazz,
                                  cmap, &charmap, &ttcmap ) )