Commit 4e6dd8587e07137d24a3641f69b0654b0fd72e97

Werner Lemberg 2000-06-05T05:26:15

freetype.h: Adding ft_encoding_xxx values for some CJK encodings. Fixing copyright notice on many files. Changed some tracing levels. A lot of formatting, fixing documentation etc. as usual.

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
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index 633b2a8..919f092 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -310,7 +310,10 @@
     ft_encoding_unicode = FT_MAKE_TAG('u','n','i','c'),
     ft_encoding_latin_2 = FT_MAKE_TAG('l','a','t','2'),
     ft_encoding_sjis    = FT_MAKE_TAG('s','j','i','s'),
+    ft_encoding_gb2312  = FT_MAKE_TAG('g','b',' ',' '),
     ft_encoding_big5    = FT_MAKE_TAG('b','i','g','5'),
+    ft_encoding_wansung = FT_MAKE_TAG('w','a','n','s'),
+    ft_encoding_johab   = FT_MAKE_TAG('j','o','h','a'),
 
     ft_encoding_adobe_standard = FT_MAKE_TAG('a','d','o','b'),
     ft_encoding_adobe_expert   = FT_MAKE_TAG('a','d','b','e'),
diff --git a/src/base/ftbase.c b/src/base/ftbase.c
index 8b2f5b2..20e4199 100644
--- a/src/base/ftbase.c
+++ b/src/base/ftbase.c
@@ -7,8 +7,8 @@
 /*  Copyright 1996-2000 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
-/*  This file is part of the FreeType project, and may only be used        */
-/*  modified and distributed under the terms of the FreeType project       */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
 /*  this file you indicate that you have read the license and              */
 /*  understand and accept it fully.                                        */
diff --git a/src/base/ftcalc.c b/src/base/ftcalc.c
index 39cf6ac..f0dcf1e 100644
--- a/src/base/ftcalc.c
+++ b/src/base/ftcalc.c
@@ -7,8 +7,8 @@
 /*  Copyright 1996-2000 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
-/*  This file is part of the FreeType project, and may only be used        */
-/*  modified and distributed under the terms of the FreeType project       */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
 /*  this file you indicate that you have read the license and              */
 /*  understand and accept it fully.                                        */
diff --git a/src/base/ftdebug.c b/src/base/ftdebug.c
index 5fb000b..72c44a3 100644
--- a/src/base/ftdebug.c
+++ b/src/base/ftdebug.c
@@ -7,8 +7,8 @@
 /*  Copyright 1996-2000 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
-/*  This file is part of the FreeType project, and may only be used        */
-/*  modified and distributed under the terms of the FreeType project       */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
 /*  this file you indicate that you have read the license and              */
 /*  understand and accept it fully.                                        */
diff --git a/src/base/ftextend.c b/src/base/ftextend.c
index 24d8b0e..7269871 100644
--- a/src/base/ftextend.c
+++ b/src/base/ftextend.c
@@ -7,8 +7,8 @@
 /*  Copyright 1996-2000 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
-/*  This file is part of the FreeType project, and may only be used        */
-/*  modified and distributed under the terms of the FreeType project       */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
 /*  this file you indicate that you have read the license and              */
 /*  understand and accept it fully.                                        */
diff --git a/src/base/ftglyph.c b/src/base/ftglyph.c
index 6bbad90..d576b10 100644
--- a/src/base/ftglyph.c
+++ b/src/base/ftglyph.c
@@ -7,8 +7,8 @@
 /*  Copyright 1996-2000 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
-/*  This file is part of the FreeType project, and may only be used        */
-/*  modified and distributed under the terms of the FreeType project       */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
 /*  this file you indicate that you have read the license and              */
 /*  understand and accept it fully.                                        */
diff --git a/src/base/ftgrays.c b/src/base/ftgrays.c
index 44b240b..e006a35 100644
--- a/src/base/ftgrays.c
+++ b/src/base/ftgrays.c
@@ -7,8 +7,8 @@
 /*  Copyright 2000 by                                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
-/*  This file is part of the FreeType project, and may only be used        */
-/*  modified and distributed under the terms of the FreeType project       */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
 /*  this file you indicate that you have read the license and              */
 /*  understand and accept it fully.                                        */
diff --git a/src/base/ftinit.c b/src/base/ftinit.c
index 1c3ace6..3d524ac 100644
--- a/src/base/ftinit.c
+++ b/src/base/ftinit.c
@@ -7,8 +7,8 @@
 /*  Copyright 1996-2000 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
-/*  This file is part of the FreeType project, and may only be used        */
-/*  modified and distributed under the terms of the FreeType project       */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
 /*  this file you indicate that you have read the license and              */
 /*  understand and accept it fully.                                        */
diff --git a/src/base/ftlist.c b/src/base/ftlist.c
index 3842fcb..0158ba4 100644
--- a/src/base/ftlist.c
+++ b/src/base/ftlist.c
@@ -7,8 +7,8 @@
 /*  Copyright 1996-2000 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
-/*  This file is part of the FreeType project, and may only be used        */
-/*  modified and distributed under the terms of the FreeType project       */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
 /*  this file you indicate that you have read the license and              */
 /*  understand and accept it fully.                                        */
diff --git a/src/base/ftmm.c b/src/base/ftmm.c
index 78317a7..ea4aaee 100644
--- a/src/base/ftmm.c
+++ b/src/base/ftmm.c
@@ -7,8 +7,8 @@
 /*  Copyright 1996-2000 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
-/*  This file is part of the FreeType project, and may only be used        */
-/*  modified and distributed under the terms of the FreeType project       */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
 /*  this file you indicate that you have read the license and              */
 /*  understand and accept it fully.                                        */
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index ac89cf0..9598146 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -5,10 +5,10 @@
 /*    The FreeType private base classes (base).                            */
 /*                                                                         */
 /*  Copyright 1996-2000 by                                                 */
-/*  David Turner, Robert Wilhelm, and Werner Lemberg                       */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
-/*  This file is part of the FreeType project, and may only be used        */
-/*  modified and distributed under the terms of the FreeType project       */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
 /*  this file you indicate that you have read the license and              */
 /*  understand and accept it fully.                                        */
diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c
index 53cc301..93d8f45 100644
--- a/src/base/ftoutln.c
+++ b/src/base/ftoutln.c
@@ -7,8 +7,8 @@
 /*  Copyright 1996-2000 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
-/*  This file is part of the FreeType project, and may only be used        */
-/*  modified and distributed under the terms of the FreeType project       */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
 /*  this file you indicate that you have read the license and              */
 /*  understand and accept it fully.                                        */
diff --git a/src/base/ftraster.c b/src/base/ftraster.c
index d5f47bf..c450d0b 100644
--- a/src/base/ftraster.c
+++ b/src/base/ftraster.c
@@ -7,8 +7,8 @@
 /*  Copyright 1996-2000 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
-/*  This file is part of the FreeType project, and may only be used        */
-/*  modified and distributed under the terms of the FreeType project       */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
 /*  this file you indicate that you have read the license and              */
 /*  understand and accept it fully.                                        */
diff --git a/src/base/ftstream.c b/src/base/ftstream.c
index dd33ec7..286cc5f 100644
--- a/src/base/ftstream.c
+++ b/src/base/ftstream.c
@@ -7,8 +7,8 @@
 /*  Copyright 2000 by                                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
-/*  This file is part of the FreeType project, and may only be used        */
-/*  modified and distributed under the terms of the FreeType project       */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
 /*  this file you indicate that you have read the license and              */
 /*  understand and accept it fully.                                        */
diff --git a/src/base/ftsystem.c b/src/base/ftsystem.c
index f51a504..434a6db 100644
--- a/src/base/ftsystem.c
+++ b/src/base/ftsystem.c
@@ -7,8 +7,8 @@
 /*  Copyright 1996-2000 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
-/*  This file is part of the FreeType project, and may only be used        */
-/*  modified and distributed under the terms of the FreeType project       */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
 /*  this file you indicate that you have read the license and              */
 /*  understand and accept it fully.                                        */
diff --git a/src/base/rules.mk b/src/base/rules.mk
index e2617ac..404f4d1 100644
--- a/src/base/rules.mk
+++ b/src/base/rules.mk
@@ -6,7 +6,7 @@
 # Copyright 1996-2000 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
-# This file is part of the FreeType project, and may only be used modified
+# This file is part of the FreeType project, and may only be used, modified,
 # and distributed under the terms of the FreeType project license,
 # LICENSE.TXT.  By continuing to use, modify, or distribute this file you
 # indicate that you have read the license and understand and accept it
diff --git a/src/psnames/rules.mk b/src/psnames/rules.mk
index af226b7..56654b8 100644
--- a/src/psnames/rules.mk
+++ b/src/psnames/rules.mk
@@ -14,8 +14,6 @@
 
 
 ifndef PSNAMES_INCLUDE
-  PSNAMES_INCLUDED := 1
-
   # PSNAMES driver directory
   #
   PSNAMES_DIR  := $(SRC_)psnames
diff --git a/src/sfnt/rules.mk b/src/sfnt/rules.mk
index 14de2b6..395aab1 100644
--- a/src/sfnt/rules.mk
+++ b/src/sfnt/rules.mk
@@ -14,18 +14,16 @@
 
 
 ifndef SFNT_INCLUDE
-  SFNT_INCLUDED := 1
-
   # SFNT driver directory
   #
   SFNT_DIR  := $(SRC_)sfnt
   SFNT_DIR_ := $(SFNT_DIR)$(SEP)
 
+
   # additional include flags used when compiling the driver
   #
   SFNT_INCLUDE := $(SHARED) $(SFNT_DIR)
 
-
   # compilation flags for the driver
   #
   SFNT_CFLAGS  := $(SFNT_INCLUDE:%=$I%)
@@ -41,7 +39,6 @@ ifndef SFNT_INCLUDE
                   $(SFNT_DIR_)sfobjs.c   \
                   $(SFNT_DIR_)sfdriver.c
 
-
   # driver headers
   #
   SFNT_DRV_H := $(BASE_H)              \
diff --git a/src/sfnt/sfdriver.c b/src/sfnt/sfdriver.c
index abdc645..81bdb02 100644
--- a/src/sfnt/sfdriver.c
+++ b/src/sfnt/sfdriver.c
@@ -1,3 +1,21 @@
+/***************************************************************************/
+/*                                                                         */
+/*  sfdriver.c                                                             */
+/*                                                                         */
+/*    High-level SFNT driver interface (body).                             */
+/*                                                                         */
+/*  Copyright 1996-2000 by                                                 */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
 #include <freetype/internal/sfnt.h>
 #include <freetype/internal/ftobjs.h>
 #include <sfdriver.h>
@@ -7,24 +25,48 @@
 #include <ttcmap.h>
 #include <sfobjs.h>
 
+
   static
-  void*  get_sfnt_table( TT_Face  face, FT_Sfnt_Tag  tag )
+  void*  get_sfnt_table( TT_Face      face,
+                         FT_Sfnt_Tag  tag )
   {
     void*  table;
 
-    switch (tag)
+
+    switch ( tag )
     {
-      case ft_sfnt_head: table = &face->header; break;
-      case ft_sfnt_hhea: table = &face->horizontal; break;
-      case ft_sfnt_vhea: table = (face->vertical_info ? &face->vertical : 0 ); break;
-      case ft_sfnt_os2:  table = (face->os2.version == 0xFFFF ? 0 : &face->os2 ); break;
-      case ft_sfnt_post: table = &face->postscript; break;
-      case ft_sfnt_maxp: table = &face->max_profile; break;
-	  case ft_sfnt_pclt: table = face->pclt.Version ? &face->pclt : 0 ; break;
-
-      default:
-        table = 0;
+    case ft_sfnt_head:
+      table = &face->header;
+      break;
+
+    case ft_sfnt_hhea:
+      table = &face->horizontal;
+      break;
+
+    case ft_sfnt_vhea:
+      table = face->vertical_info ? &face->vertical : 0;
+      break;
+
+    case ft_sfnt_os2:
+      table = face->os2.version == 0xFFFF ? 0 : &face->os2;
+      break;
+
+    case ft_sfnt_post:
+      table = &face->postscript;
+      break;
+
+    case ft_sfnt_maxp:
+      table = &face->max_profile;
+      break;
+
+    case ft_sfnt_pclt:
+      table = face->pclt.Version ? &face->pclt : 0;
+      break;
+
+    default:
+      table = 0;
     }
+
     return table;
   }
 
@@ -33,9 +75,9 @@
   FTDriver_Interface  SFNT_Get_Interface( FT_Driver    driver,
                                           const char*  interface )
   {
-    UNUSED(driver);
+    UNUSED( driver );
 
-    if (strcmp(interface,"get_sfnt")==0)
+    if ( strcmp( interface, "get_sfnt" ) == 0 )
       return (FTDriver_Interface)get_sfnt_table;
 
     return 0;
@@ -70,27 +112,27 @@
 
     TT_Load_Kern,
     TT_Load_Gasp,
-	TT_Load_PCLT,
+    TT_Load_PCLT,
 
 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
     /* see `ttsbit.h' */
     TT_Load_SBit_Strikes,
     TT_Load_SBit_Image,
     TT_Free_SBit_Strikes,
-#else
+#else /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
     0,
     0,
     0,
-#endif
+#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
 
-    /* see `ttpost.h' */
 #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
+    /* see `ttpost.h' */
     TT_Get_PS_Name,
     TT_Free_Post_Names,
-#else
+#else /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */
     0,
     0,
-#endif
+#endif /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */
 
     /* see `ttcmap.h' */
     TT_CharMap_Load,
@@ -100,19 +142,20 @@
 
   const FT_DriverInterface  sfnt_driver_interface =
   {
-    sizeof(FT_DriverRec),
-    0,
-    0,
-    0,
+    sizeof ( FT_DriverRec ), 0, 0, 0,
 
-    "sfnt",     /* driver name                         */
-    1,          /* driver version                      */
-    2,          /* driver requires FreeType 2 or above */
+    "sfnt",     /* driver name                          */
+    1,          /* driver version                       */
+    2,          /* driver requires FreeType 2 or higher */
 
     (void*)&sfnt_interface,
+
+    0, 0, 0,
+    0, 0, 0,
     0, 0, 0, 0,
-    0, 0, 0, 0,
-    0, 0, 0, 0,
-    0, 0,
+    0, 0, 0,
+    0,
   };
 
+
+/* END */
diff --git a/src/sfnt/sfdriver.h b/src/sfnt/sfdriver.h
index 67fd3bd..44d5a55 100644
--- a/src/sfnt/sfdriver.h
+++ b/src/sfnt/sfdriver.h
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    High-level SFNT driver interface (specification).                    */
 /*                                                                         */
-/*  Copyright 1996-1999 by                                                 */
+/*  Copyright 1996-2000 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
diff --git a/src/sfnt/sfnt.c b/src/sfnt/sfnt.c
index 445cd6c..a9aa182 100644
--- a/src/sfnt/sfnt.c
+++ b/src/sfnt/sfnt.c
@@ -1,3 +1,21 @@
+/***************************************************************************/
+/*                                                                         */
+/*  sfnt.c                                                                 */
+/*                                                                         */
+/*    Single object library component.                                     */
+/*                                                                         */
+/*  Copyright 1996-2000 by                                                 */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
 #define FT_MAKE_OPTION_SINGLE_OBJECT
 
 #include <ttload.c>
@@ -15,3 +33,4 @@
 #include <sfdriver.c>
 
 
+/* END */
diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c
index d85d022..a71a451 100644
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -1,7 +1,26 @@
+/***************************************************************************/
+/*                                                                         */
+/*  sfobjs.c                                                               */
+/*                                                                         */
+/*    SFNT object management (base).                                       */
+/*                                                                         */
+/*  Copyright 1996-2000 by                                                 */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
 #include <freetype/internal/sfnt.h>
 #include <freetype/internal/psnames.h>
 #include <freetype/ttnameid.h>
 
+
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
@@ -16,7 +35,7 @@
   /*    nameid :: The name id of the name record to return.                */
   /*                                                                       */
   /* <Return>                                                              */
-  /*    Char string.  NULL if no name is present.                          */
+  /*    Character string.  NULL if no name is present.                     */
   /*                                                                       */
   static
   FT_String*  Get_Name( TT_Face    face,
@@ -27,7 +46,7 @@
     TT_NameRec*  rec;
     FT_Bool      wide_chars = 1;
 
-    /* first pass, look for a given name record */
+
     rec = face->name_table.names;
     for ( n = 0; n < face->name_table.numNameRecords; n++, rec++ )
     {
@@ -36,17 +55,18 @@
         /* found the name - now create an ASCII string from it */
         FT_Bool  found = 0;
 
-        /* Test for Microsoft English language */
+
+        /* test for Microsoft English language */
         if ( rec->platformID == TT_PLATFORM_MICROSOFT &&
              rec->encodingID <= TT_MS_ID_UNICODE_CS   &&
-             (rec->languageID & 0x3FF) == 0x009 )
+             ( rec->languageID & 0x3FF ) == 0x009     )
           found = 1;
 
-        /* Test for Apple Unicode encoding */
+        /* test for Apple Unicode encoding */
         else if ( rec->platformID == TT_PLATFORM_APPLE_UNICODE )
           found = 1;
 
-        /* Test for Apple Roman */
+        /* test for Apple Roman */
         else if ( rec->platformID == TT_PLATFORM_MACINTOSH &&
                   rec->languageID == TT_MAC_ID_ROMAN       )
         {
@@ -54,22 +74,24 @@
           wide_chars = 0;
         }
 
-        /* Found a Unicode Name */
+        /* found a Unicode name */
         if ( found )
         {
           FT_String*  string;
           FT_UInt     len;
 
+
           if ( wide_chars )
           {
             TT_UInt   m;
 
+
             len = (TT_UInt)rec->stringLength / 2;
             if ( MEM_Alloc( string, len + 1 ) )
               return NULL;
 
             for ( m = 0; m < len; m ++ )
-              string[m] = rec->string[2*m + 1];
+              string[m] = rec->string[2 * m + 1];
           }
           else
           {
@@ -85,13 +107,14 @@
         }
       }
     }
+
     return NULL;
   }
 
 
   static
-  FT_Encoding   find_encoding( int  platform_id,
-                               int  encoding_id )
+  FT_Encoding  find_encoding( int  platform_id,
+                              int  encoding_id )
   {
     typedef struct  TEncoding
     {
@@ -101,40 +124,42 @@
 
     } TEncoding;
 
-    static
-    const TEncoding   tt_encodings[] =
+    static const TEncoding  tt_encodings[] =
     {
-      { TT_PLATFORM_ISO,                         -1, ft_encoding_unicode },
+      { TT_PLATFORM_ISO,           -1,                  ft_encoding_unicode },
 
-      { TT_PLATFORM_APPLE_UNICODE,               -1, ft_encoding_unicode },
+      { TT_PLATFORM_APPLE_UNICODE, -1,                  ft_encoding_unicode },
 
-      { TT_PLATFORM_MACINTOSH,      TT_MAC_ID_ROMAN, ft_encoding_apple_roman },
+      { TT_PLATFORM_MACINTOSH,     TT_MAC_ID_ROMAN,     ft_encoding_apple_roman },
 
-      { TT_PLATFORM_MICROSOFT,  TT_MS_ID_UNICODE_CS, ft_encoding_unicode },
-      { TT_PLATFORM_MICROSOFT,  TT_MS_ID_SJIS,       ft_encoding_sjis },
-      { TT_PLATFORM_MICROSOFT,  TT_MS_ID_BIG_5,      ft_encoding_big5 }
+      { TT_PLATFORM_MICROSOFT,     TT_MS_ID_UNICODE_CS, ft_encoding_unicode },
+      { TT_PLATFORM_MICROSOFT,     TT_MS_ID_SJIS,       ft_encoding_sjis },
+      { TT_PLATFORM_MICROSOFT,     TT_MS_ID_GB2312,     ft_encoding_gb2312 },
+      { TT_PLATFORM_MICROSOFT,     TT_MS_ID_BIG_5,      ft_encoding_big5 },
+      { TT_PLATFORM_MICROSOFT,     TT_MS_ID_WANSUNG,    ft_encoding_wansung },
+      { TT_PLATFORM_MICROSOFT,     TT_MS_ID_JOHAB,      ft_encoding_johab }
     };
 
     const TEncoding  *cur, *limit;
 
+
     cur   = tt_encodings;
-    limit = cur + sizeof(tt_encodings)/sizeof(tt_encodings[0]);
+    limit = cur + sizeof ( tt_encodings ) / sizeof ( tt_encodings[0] );
 
     for ( ; cur < limit; cur++ )
     {
-      if (cur->platform_id == platform_id)
+      if ( cur->platform_id == platform_id )
       {
-        if (cur->encoding_id == encoding_id ||
-            cur->encoding_id == -1          )
+        if ( cur->encoding_id == encoding_id ||
+             cur->encoding_id == -1          )
           return cur->encoding;
       }
     }
+
     return ft_encoding_none;
   }
 
 
-
-
   LOCAL_FUNC
   FT_Error  SFNT_Init_Face( FT_Stream      stream,
                             TT_Face        face,
@@ -142,30 +167,32 @@
                             TT_Int         num_params,
                             FT_Parameter*  params )
   {
-    FT_Error           error;
-    SFNT_Interface*    sfnt;
-    PSNames_Interface* psnames;
-    SFNT_Header        sfnt_header;
+    FT_Error            error;
+    SFNT_Interface*     sfnt;
+    PSNames_Interface*  psnames;
+    SFNT_Header         sfnt_header;
 
     /* for now, parameters are unused */
-    UNUSED(num_params);
-    UNUSED(params);
+    UNUSED( num_params );
+    UNUSED( params );
+
 
     sfnt = (SFNT_Interface*)face->sfnt;
-    if (!sfnt)
+    if ( !sfnt )
     {
       /* look-up the SFNT driver */
       FT_Driver  sfnt_driver;
 
+
       sfnt_driver = FT_Get_Driver( face->root.driver->library, "sfnt" );
-      if (!sfnt_driver)
+      if ( !sfnt_driver )
       {
         error = FT_Err_Invalid_File_Format;
         goto Exit;
       }
 
-      sfnt = (SFNT_Interface*)(sfnt_driver->interface.format_interface);
-      if (!sfnt)
+      sfnt = (SFNT_Interface*)( sfnt_driver->interface.format_interface );
+      if ( !sfnt )
       {
         error = FT_Err_Invalid_File_Format;
         goto Exit;
@@ -176,27 +203,30 @@
     }
 
     psnames = (PSNames_Interface*)face->psnames;
-    if (!psnames)
+    if ( !psnames )
     {
       /* look-up the PSNames driver */
       FT_Driver  psnames_driver;
 
+
       psnames_driver = FT_Get_Driver( face->root.driver->library, "psnames" );
-      if (psnames_driver)
+      if ( psnames_driver )
         face->psnames = (PSNames_Interface*)
-                            (psnames_driver->interface.format_interface);
+                          ( psnames_driver->interface.format_interface );
     }
 
     /* check that we have a valid TrueType file */
     error = sfnt->load_sfnt_header( face, stream, face_index, &sfnt_header );
-    if (error) goto Exit;                                    
+    if ( error )
+      goto Exit;                                    
 
     face->format_tag = sfnt_header.format_tag;
     face->num_tables = sfnt_header.num_tables;
 
     /* Load font directory */
     error = sfnt->load_directory( face, stream, &sfnt_header );
-    if ( error ) goto Exit;
+    if ( error )
+      goto Exit;
 
     face->root.num_faces = face->ttc_header.DirCount;
     if ( face->root.num_faces < 1 )
@@ -207,9 +237,8 @@
   }
 
 
-
 #undef  LOAD_
-#define LOAD_(x)   ( (error = sfnt->load_##x( face, stream )) != FT_Err_Ok )
+#define LOAD_( x )  ( (error = sfnt->load_##x( face, stream )) != FT_Err_Ok )
 
 
   LOCAL_FUNC
@@ -219,18 +248,19 @@
                             TT_Int         num_params,
                             FT_Parameter*  params )
   {
-    FT_Error   error;
-    SFNT_Interface*    sfnt = (SFNT_Interface*)face->sfnt;
+    FT_Error         error;
+    SFNT_Interface*  sfnt = (SFNT_Interface*)face->sfnt;
+
 
     /* Load tables */
     if ( LOAD_( header )        ||
          LOAD_( max_profile )   ||
 
-         (error = sfnt->load_metrics( face, stream, 0 )) != FT_Err_Ok  ||
          /* load the `hhea' & `hmtx' tables at once */
+         ( error = sfnt->load_metrics( face, stream, 0 ) ) != FT_Err_Ok  ||
 
-         (error = sfnt->load_metrics( face, stream, 1 )) != FT_Err_Ok ||
          /* try to load the `vhea' & `vmtx' at once if present */
+         ( error = sfnt->load_metrics( face, stream, 1 ) ) != FT_Err_Ok  ||
 
          LOAD_( charmaps )      ||
          LOAD_( names )         ||
@@ -240,10 +270,11 @@
 
     /* the optional tables */
 
-    /* embedded bitmap support. */
 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
-    if (sfnt->load_sbits && LOAD_(sbits)) goto Exit;
-#endif
+    /* embedded bitmap support. */
+    if ( sfnt->load_sbits && LOAD_( sbits ) )
+      goto Exit;
+#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
 
     if ( LOAD_( hdmx )          ||
          LOAD_( gasp )          ||
@@ -267,21 +298,22 @@
       TT_Int      n;
       FT_Memory   memory;
 
+
       memory = root->memory;
 
-      /*****************************************************************/
-      /*                                                               */
-      /* Compute face flags.                                           */
-      /*                                                               */
+      /*********************************************************************/
+      /*                                                                   */
+      /* Compute face flags.                                               */
+      /*                                                                   */
       flags = FT_FACE_FLAG_SCALABLE  |    /* scalable outlines */
               FT_FACE_FLAG_SFNT      |    /* SFNT file format  */
               FT_FACE_FLAG_HORIZONTAL;    /* horizontal data   */
 
-      /* fixed width font ? */
+      /* fixed width font? */
       if ( face->postscript.isFixedPitch )
         flags |= FT_FACE_FLAG_FIXED_WIDTH;
 
-      /* vertical information ? */
+      /* vertical information? */
       if ( face->vertical_info )
         flags |= FT_FACE_FLAG_VERTICAL;
 
@@ -291,15 +323,15 @@
 
       root->face_flags = flags;
 
-      /*****************************************************************/
-      /*                                                               */
-      /* Compute style flags.                                          */
-      /*                                                               */
+      /*********************************************************************/
+      /*                                                                   */
+      /* Compute style flags.                                              */
+      /*                                                                   */
       flags = 0;
 
       if ( face->os2.version != 0xFFFF )
       {
-        /* We have an OS/2 table, use the `fsSelection' field */
+        /* we have an OS/2 table; use the `fsSelection' field */
         if ( face->os2.fsSelection & 1 )
           flags |= FT_STYLE_FLAG_ITALIC;
 
@@ -308,7 +340,7 @@
       }
       else
       {
-        /* This is an old Mac font, use the header field */
+        /* this is an old Mac font, use the header field */
         if ( face->header.Mac_Style & 1 )
           flags |= FT_STYLE_FLAG_BOLD;
 
@@ -318,13 +350,13 @@
 
       face->root.style_flags = flags;
 
-      /*****************************************************************/
-      /*                                                               */
-      /* Polish the charmaps.                                          */
-      /*                                                               */
-      /*   Try to set the charmap encoding according to the platform & */
-      /*   encoding ID of each charmap.                                */
-      /*                                                               */
+      /*********************************************************************/
+      /*                                                                   */
+      /* Polish the charmaps.                                              */
+      /*                                                                   */
+      /*   Try to set the charmap encoding according to the platform &     */
+      /*   encoding ID of each charmap.                                    */
+      /*                                                                   */
       charmap            = face->charmaps;
       root->num_charmaps = face->num_charmaps;
 
@@ -337,13 +369,16 @@
         FT_Int  platform = charmap->cmap.platformID;
         FT_Int  encoding = charmap->cmap.platformEncodingID;
 
+
         charmap->root.face        = (FT_Face)face;
         charmap->root.platform_id = platform;
         charmap->root.encoding_id = encoding;
-        charmap->root.encoding    = find_encoding(platform,encoding);
+        charmap->root.encoding    = find_encoding( platform, encoding );
 
-        /* now, set root->charmap with a unicode charmap wherever available */
-        if (!root->charmap && charmap->root.encoding == ft_encoding_unicode)
+        /* now, set root->charmap with a unicode charmap */
+        /* wherever available                            */
+        if ( !root->charmap                                &&
+             charmap->root.encoding == ft_encoding_unicode )
           root->charmap = (FT_CharMap)charmap;
 
         root->charmaps[n] = (FT_CharMap)charmap;
@@ -358,34 +393,34 @@
                          FT_Bitmap_Size ) )
          return error;
 
-       for ( n = 0 ; n < face->num_sbit_strikes ; n++ )
-       {
-         face->root.available_sizes[n].width =
-           face->sbit_strikes[n].x_ppem;
-         face->root.available_sizes[n].height =
-           face->sbit_strikes[n].y_ppem;
-       }
+        for ( n = 0 ; n < face->num_sbit_strikes ; n++ )
+        {
+          face->root.available_sizes[n].width =
+            face->sbit_strikes[n].x_ppem;
+          face->root.available_sizes[n].height =
+            face->sbit_strikes[n].y_ppem;
+        }
       }
       else
-#else
+#else /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
       {
        root->num_fixed_sizes = 0;
        root->available_sizes = 0;
       }
 #endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
 
-      /*****************************************************************/
-      /*                                                               */
-      /*  Set up metrics.                                              */
-      /*                                                               */
+      /*********************************************************************/
+      /*                                                                   */
+      /*  Set up metrics.                                                  */
+      /*                                                                   */
       root->bbox.xMin    = face->header.xMin;
       root->bbox.yMin    = face->header.yMin;
       root->bbox.xMax    = face->header.xMax;
       root->bbox.yMax    = face->header.yMax;
       root->units_per_EM = face->header.Units_Per_EM;
 
-      /* The ascender/descender/height are computed from the OS/2 table   */
-      /* when found.  Otherwise, they're taken from the horizontal header */
+      /* The ascender/descender/height are computed from the OS/2 table    */
+      /* when found.  Otherwise, they're taken from the horizontal header. */
       if ( face->os2.version != 0xFFFF )
       {
         root->ascender  =  face->os2.sTypoAscender;
@@ -401,11 +436,11 @@
                           face->horizontal.Line_Gap;
       }
 
-      root->max_advance_width  = face->horizontal.advance_Width_Max;
+      root->max_advance_width   = face->horizontal.advance_Width_Max;
 
-      root->max_advance_height = root->height;
-      if ( face->vertical_info )
-        root->max_advance_height = face->vertical.advance_Height_Max;
+      root->max_advance_height  = face->vertical_info
+                                    ? face->vertical.advance_Height_Max
+                                    : root->height;
 
       root->underline_position  = face->postscript.underlinePosition;
       root->underline_thickness = face->postscript.underlineThickness;
@@ -428,14 +463,15 @@
     FT_Memory        memory = face->root.memory;
     SFNT_Interface*  sfnt   = face->sfnt;
 
-    if (sfnt)
+
+    if ( sfnt )
     {
-      /* destroy the postscript names table if it is supported */
-      if (sfnt->free_psnames)
+      /* destroy the postscript names table if it is loaded */
+      if ( sfnt->free_psnames )
         sfnt->free_psnames( face );
 
-      /* destroy the embedded bitmaps table if it is supported */
-      if (sfnt->free_sbits)
+      /* destroy the embedded bitmaps table if it is loaded */
+      if ( sfnt->free_sbits )
         sfnt->free_sbits( face );
     }
 
@@ -455,6 +491,8 @@
     if (sfnt && sfnt->load_charmaps )
     {
       FT_UShort  n;
+
+
       for ( n = 0; n < face->num_charmaps; n++ )
         sfnt->free_charmap( face, &face->charmaps[n].cmap );
     }
@@ -500,3 +538,5 @@
     face->sfnt = 0;
   }
 
+
+/* END */
diff --git a/src/sfnt/sfobjs.h b/src/sfnt/sfobjs.h
index 193cc9b..380a1fc 100644
--- a/src/sfnt/sfobjs.h
+++ b/src/sfnt/sfobjs.h
@@ -2,9 +2,9 @@
 /*                                                                         */
 /*  sfobjs.h                                                               */
 /*                                                                         */
-/*    SFNT object management                                               */
+/*    SFNT object management (specification).                              */
 /*                                                                         */
-/*  Copyright 1996-1999 by                                                 */
+/*  Copyright 1996-2000 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -15,12 +15,14 @@
 /*                                                                         */
 /***************************************************************************/
 
+
 #ifndef SFOBJS_H
 #define SFOBJS_H
 
 #include <freetype/internal/sfnt.h>
 #include <freetype/internal/ftobjs.h>
 
+
   LOCAL_DEF
   FT_Error  SFNT_Init_Face( FT_Stream      stream,
                             TT_Face        face,
diff --git a/src/sfnt/ttcmap.c b/src/sfnt/ttcmap.c
index daeaccf..a5c32f2 100644
--- a/src/sfnt/ttcmap.c
+++ b/src/sfnt/ttcmap.c
@@ -4,11 +4,11 @@
 /*                                                                         */
 /*    TrueType character mapping table (cmap) support (body).              */
 /*                                                                         */
-/*  Copyright 1996-1999 by                                                 */
+/*  Copyright 1996-2000 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
-/*  This file is part of the FreeType project, and may only be used        */
-/*  modified and distributed under the terms of the FreeType project       */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
 /*  this file you indicate that you have read the license and              */
 /*  understand and accept it fully.                                        */
@@ -22,15 +22,26 @@
 #include <ttload.h>
 #include <ttcmap.h>
 
-/* required by the tracing mode */
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
+  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */
+  /* messages during execution.                                            */
+  /*                                                                       */
 #undef  FT_COMPONENT
-#define FT_COMPONENT      trace_ttcmap
+#define FT_COMPONENT  trace_ttcmap
+
 
+  static TT_UInt  code_to_index0( TT_CMapTable*  charmap,
+                                  TT_ULong       char_code );
+  static TT_UInt  code_to_index2( TT_CMapTable*  charmap,
+                                  TT_ULong       char_code );
+  static TT_UInt  code_to_index4( TT_CMapTable*  charmap,
+                                  TT_ULong       char_code );
+  static TT_UInt  code_to_index6( TT_CMapTable*  charmap,
+                                  TT_ULong       char_code );
 
-  static TT_UInt  code_to_index0( TT_CMapTable*  charmap, TT_ULong  char_code );
-  static TT_UInt  code_to_index2( TT_CMapTable*  charmap, TT_ULong  char_code );
-  static TT_UInt  code_to_index4( TT_CMapTable*  charmap, TT_ULong  char_code );
-  static TT_UInt  code_to_index6( TT_CMapTable*  charmap, TT_ULong  char_code );
 
   /*************************************************************************/
   /*                                                                       */
@@ -48,7 +59,7 @@
   /*    table  :: A pointer to a cmap object.                              */
   /*                                                                       */
   /* <Return>                                                              */
-  /*    Error code.  0 means success.                                      */
+  /*    TrueType error code.  0 means success.                             */
   /*                                                                       */
   /* <Note>                                                                */
   /*    The function assumes that the stream is already in use (i.e.,      */
@@ -119,7 +130,7 @@
       /* load subheaders */
 
       cmap2->numGlyphId = l =
-        ( ( cmap->length - 2L*(256+3) - num_SH*8L ) & 0xffff ) / 2;
+        ( ( cmap->length - 2L * ( 256 + 3 ) - num_SH * 8L ) & 0xffff ) / 2;
 
       if ( ALLOC_ARRAY( cmap2->subHeaders,
                         num_SH + 1,
@@ -177,8 +188,8 @@
 
       if ( ALLOC_ARRAY( cmap4->segments,
                         num_Seg,
-                        TT_CMap4Segment )         ||
-           ACCESS_Frame( (num_Seg * 4 + 1) * 2L ) )
+                        TT_CMap4Segment )           ||
+           ACCESS_Frame( ( num_Seg * 4 + 1 ) * 2L ) )
         goto Fail;
 
       segments = cmap4->segments;
@@ -200,12 +211,12 @@
       FORGET_Frame();
 
       cmap4->numGlyphId = l =
-        ( ( cmap->length - ( 16L + 8L * num_Seg ) ) & 0xFFFF ) /2;
+        ( ( cmap->length - ( 16L + 8L * num_Seg ) ) & 0xFFFF ) / 2;
 
       /* load IDs */
 
       if ( ALLOC_ARRAY( cmap4->glyphIdArray, l, TT_UShort ) ||
-           ACCESS_Frame( l*2L )                             )
+           ACCESS_Frame( l * 2L )                           )
         goto Fail;
 
       for ( i = 0; i < l; i++ )
@@ -248,6 +259,7 @@
       return TT_Err_Invalid_CharMap_Format;
 
     }
+
     return TT_Err_Ok;
 
   Fail:
@@ -269,7 +281,7 @@
   /*    cmap :: A handle to a cmap object.                                 */
   /*                                                                       */
   /* <Return>                                                              */
-  /*    Error code.  0 means success.                                      */
+  /*    TrueType error code.  0 means success.                             */
   /*                                                                       */
   LOCAL_FUNC
   TT_Error  TT_CharMap_Free( TT_Face        face,
@@ -316,7 +328,6 @@
   }
 
 
-
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
@@ -332,8 +343,7 @@
   /*    cmap0    :: A pointer to a cmap table in format 0.                 */
   /*                                                                       */
   /* <Return>                                                              */
-  /*    Glyph index into the glyphs array.  0 if the glyph does not        */
-  /*    exist.                                                             */
+  /*    Glyph index into the glyphs array.  0 if the glyph does not exist. */
   /*                                                                       */
   static
   TT_UInt code_to_index0( TT_CMapTable*  cmap,
@@ -341,6 +351,7 @@
   {
     TT_CMap0*  cmap0 = &cmap->c.cmap0;
 
+
     return ( charCode <= 0xFF ? cmap0->glyphIdArray[charCode] : 0 );
   }
 
@@ -358,54 +369,53 @@
   /*    cmap2    :: A pointer to a cmap table in format 2.                 */
   /*                                                                       */
   /* <Return>                                                              */
-  /*    Glyph index into the glyphs array.  0 if the glyph does not        */
-  /*    exist.                                                             */
+  /*    Glyph index into the glyphs array.  0 if the glyph does not exist. */
   /*                                                                       */
   static
   TT_UInt  code_to_index2( TT_CMapTable*  cmap,
                            TT_ULong       charCode )
   {
-    TT_UInt            result, index1, offset;
-    TT_UInt            char_lo;
-    TT_ULong           char_hi;
-    TT_CMap2SubHeader* sh2;
-    TT_CMap2*          cmap2;
+    TT_UInt             result, index1, offset;
+    TT_UInt             char_lo;
+    TT_ULong            char_hi;
+    TT_CMap2SubHeader*  sh2;
+    TT_CMap2*           cmap2;
+
 
     cmap2   = &cmap->c.cmap2;
     result  = 0;
-    char_lo = (TT_UInt)(charCode & 0xFF);
+    char_lo = (TT_UInt)( charCode & 0xFF );
     char_hi = charCode >> 8;
 
     if ( char_hi == 0 )
     {
       /* an 8-bit character code - we use the subHeader 0 in this case */
-      /* to test wether the character code is in the charmap           */
+      /* to test whether the character code is in the charmap          */
       if ( cmap2->subHeaderKeys[char_lo] == 0 )
-      {
         result = cmap2->glyphIdArray[char_lo];
-      }
     }
     else
     {
       /* a 16-bit character code */
-      index1 = cmap2->subHeaderKeys[ char_hi & 0xFF ];
-      if (index1)
+      index1 = cmap2->subHeaderKeys[char_hi & 0xFF];
+      if ( index1 )
       {
         sh2      = cmap2->subHeaders + index1;
         char_lo -= sh2->firstCode;
 
-        if (char_lo < sh2->entryCount)
+        if ( char_lo < sh2->entryCount )
         {
-          offset = sh2->idRangeOffset/2 + char_lo;
-          if (offset < cmap2->numGlyphId)
+          offset = sh2->idRangeOffset / 2 + char_lo;
+          if ( offset < cmap2->numGlyphId )
           {
             result = cmap2->glyphIdArray[offset];
-            if (result)
-              result = (result + sh2->idDelta) & 0xFFFF;
+            if ( result )
+              result = ( result + sh2->idDelta ) & 0xFFFF;
           }
         }
       }
     }
+
     return result;
   }
 
@@ -423,8 +433,7 @@
   /*    cmap4    :: A pointer to a cmap table in format 4.                 */
   /*                                                                       */
   /* <Return>                                                              */
-  /*    Glyph index into the glyphs array.  0 if the glyph does not        */
-  /*    exist.                                                             */
+  /*    Glyph index into the glyphs array.  0 if the glyph does not exist. */
   /*                                                                       */
   static
   TT_UInt  code_to_index4( TT_CMapTable*  cmap,
@@ -434,6 +443,7 @@
     TT_CMap4*        cmap4;
     TT_CMap4Segment  *seg4, *limit;
 
+
     cmap4    = &cmap->c.cmap4;
     result   = 0;
     segCount = cmap4->segCountX2 / 2;
@@ -448,8 +458,8 @@
 
     for ( seg4 = cmap4->segments; seg4 < limit; seg4++, segCount-- )
     {
-      /* the ranges are sorted in increasing order, if we're out of  */
-      /* the range here, the char code isn't in the charmap, so exit */
+      /* the ranges are sorted in increasing order.  If we are out of */
+      /* the range here, the char code isn't in the charmap, so exit. */
       if ( charCode > seg4->endCount )
         continue;
         
@@ -461,24 +471,23 @@
  Found:    
     cmap4->last_segment = seg4;
     
-    /* when the idRangeOffset is 0, we can compute the glyph index */
-    /* directly..                                                  */
+    /* if the idRangeOffset is 0, we can compute the glyph index */
+    /* directly                                                  */
     
     if ( seg4->idRangeOffset == 0 )
-      result = (charCode + seg4->idDelta) & 0xFFFF;
-      
+      result = ( charCode + seg4->idDelta ) & 0xFFFF;
     else
-    /* otherwise, we must use the glyphIdArray to do it            */
     {
-      index1 = seg4->idRangeOffset/2 + (charCode - seg4->startCount)
+      /* otherwise, we must use the glyphIdArray to do it */
+      index1 = seg4->idRangeOffset / 2
+               + ( charCode - seg4->startCount )
                - segCount;
 
       if ( index1 < cmap4->numGlyphId       &&
            cmap4->glyphIdArray[index1] != 0 )
-      {
-        result = (cmap4->glyphIdArray[index1] + seg4->idDelta) & 0xFFFF;
-      }
+        result = ( cmap4->glyphIdArray[index1] + seg4->idDelta ) & 0xFFFF;
     }
+
     return result;
   }
 
@@ -496,16 +505,16 @@
   /*    cmap6    :: A pointer to a cmap table in format 6.                 */
   /*                                                                       */
   /* <Return>                                                              */
-  /*    Glyph index into the glyphs array.  0 if the glyph does not        */
-  /*    exist.                                                             */
+  /*    Glyph index into the glyphs array.  0 if the glyph does not exist. */
   /*                                                                       */
   static
   TT_UInt  code_to_index6( TT_CMapTable*  cmap,
-                           TT_ULong   charCode )
+                           TT_ULong       charCode )
   {
     TT_CMap6*  cmap6;
     TT_UInt    result = 0;
 
+
     cmap6     = &cmap->c.cmap6;
     result    = 0;
     charCode -= cmap6->firstCode;
diff --git a/src/sfnt/ttcmap.h b/src/sfnt/ttcmap.h
index 49ac80d..3439469 100644
--- a/src/sfnt/ttcmap.h
+++ b/src/sfnt/ttcmap.h
@@ -4,11 +4,11 @@
 /*                                                                         */
 /*    TrueType character mapping table (cmap) support (specification).     */
 /*                                                                         */
-/*  Copyright 1996-1999 by                                                 */
+/*  Copyright 1996-2000 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
-/*  This file is part of the FreeType project, and may only be used        */
-/*  modified and distributed under the terms of the FreeType project       */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
 /*  this file you indicate that you have read the license and              */
 /*  understand and accept it fully.                                        */
@@ -26,50 +26,11 @@
 #endif
 
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    TT_CharMap_Load                                                    */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Loads a given TrueType character map into memory.                  */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    face   :: A handle to the parent face object.                      */
-  /*    stream :: A handle to the current stream object.                   */
-  /*                                                                       */
-  /* <InOut>                                                               */
-  /*    cmap   :: A pointer to a cmap object.                              */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*    Error code.  0 means success.                                      */
-  /*                                                                       */
-  /* <Note>                                                                */
-  /*    The function assumes that the stream is already in use (i.e.,      */
-  /*    opened).  In case of error, all partially allocated tables are     */
-  /*    released.                                                          */
-  /*                                                                       */
   LOCAL_DEF
   TT_Error  TT_CharMap_Load( TT_Face        face,
                              TT_CMapTable*  cmap,
                              FT_Stream      input );
 
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    TT_CharMap_Free                                                    */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    Destroys a character mapping table.                                */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    face :: A handle to the parent face object.                        */
-  /*    cmap :: A handle to a cmap object.                                 */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*    Error code.  0 means success.                                      */
-  /*                                                                       */
   LOCAL_DEF
   TT_Error  TT_CharMap_Free( TT_Face        face,
                              TT_CMapTable*  cmap );
diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c
index 8b1c7d9..595ed6d 100644
--- a/src/sfnt/ttload.c
+++ b/src/sfnt/ttload.c
@@ -2,22 +2,18 @@
 /*                                                                         */
 /*  ttload.c                                                               */
 /*                                                                         */
-/*    TrueType tables loader (body).                                       */
+/*    Load the basic TrueType tables, i.e., tables that can be either in   */
+/*    TTF or OTF fonts (body).                                             */
 /*                                                                         */
-/*  Copyright 1996-1999 by                                                 */
+/*  Copyright 1996-2000 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
-/*  This file is part of the FreeType project, and may only be used        */
-/*  modified and distributed under the terms of the FreeType project       */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
 /*  this file you indicate that you have read the license and              */
 /*  understand and accept it fully.                                        */
 /*                                                                         */
-/*                                                                         */
-/*  WARNING: This file should not be compiled directly; it is meant to be  */
-/*           included in the source of several font drivers (i.e., the TTF */
-/*           and OTF drivers).                                             */
-/*                                                                         */
 /***************************************************************************/
 
 
@@ -28,11 +24,15 @@
 #include <ttload.h>
 #include <ttcmap.h>
 
-/* required by the tracing mode */
-#undef  FT_COMPONENT
-#define FT_COMPONENT      trace_ttload
 
-#define READ_FIELDS
+  /*************************************************************************/
+  /*                                                                       */
+  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
+  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */
+  /* messages during execution.                                            */
+  /*                                                                       */
+#undef  FT_COMPONENT
+#define FT_COMPONENT  trace_ttload
 
 
   /*************************************************************************/
@@ -45,10 +45,10 @@
   /*                                                                       */
   /* <Input>                                                               */
   /*    face :: A face object handle.                                      */
-  /*    tag  :: The  searched tag.                                         */
+  /*    tag  :: The searched tag.                                          */
   /*                                                                       */
   /* <Return>                                                              */
-  /*    pointer to table directory entry. 0 if not found..                 */
+  /*    A pointer to the table directory entry.  0 if not found.           */
   /*                                                                       */
   LOCAL_FUNC
   TT_Table*  TT_LookUp_Table( TT_Face   face,
@@ -57,24 +57,28 @@
     TT_Table*  entry;
     TT_Table*  limit;
 
-    FT_TRACE4(( "TT_LookUp_Table( %08p, %c%c%c%c )\n",
+
+    FT_TRACE3(( "TT_LookUp_Table: %08p, `%c%c%c%c' )\n",
                   face,
-                  (TT_Char)(tag >> 24),
-                  (TT_Char)(tag >> 16),
-                  (TT_Char)(tag >> 8),
-                  (TT_Char)(tag) ));
+                  (TT_Char)( tag >> 24 ),
+                  (TT_Char)( tag >> 16 ),
+                  (TT_Char)( tag >> 8  ),
+                  (TT_Char)( tag )     ));
 
     entry = face->dir_tables;
     limit = entry + face->num_tables;
+
     for ( ; entry < limit; entry++ )
     {
       if ( entry->Tag == tag )
         return entry;
     }
-    FT_TRACE4(( "    Could not find table!\n" ));
+
+    FT_TRACE3(( "    Could not find table!\n" ));
     return 0;
   }
 
+
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
@@ -84,26 +88,30 @@
   /*    Looks for a TrueType table by name, then seek a stream to it.      */
   /*                                                                       */
   /* <Input>                                                               */
-  /*    face   :: a face object handle.                                    */
-  /*    tag    :: the  searched tag.                                       */
-  /*    stream :: the stream to seek when the table is found               */
+  /*    face   :: A face object handle.                                    */
+  /*    tag    :: The searched tag.                                        */
+  /*    stream :: The stream to seek when the table is found.              */
+  /*                                                                       */
+  /* <Output>                                                              */
+  /*    length :: The length of the table if found, undefined otherwise.   */
   /*                                                                       */
   /* <Return>                                                              */
-  /*    pointer to table directory entry. 0 if not found..                 */
+  /*    TrueType error code.  0 means success.                             */
   /*                                                                       */
   LOCAL_FUNC
-  TT_Error   TT_Goto_Table( TT_Face    face,
-                            TT_ULong   tag,
-                            FT_Stream  stream,
-                            TT_ULong  *length )
+  TT_Error  TT_Goto_Table( TT_Face    face,
+                           TT_ULong   tag,
+                           FT_Stream  stream,
+                           TT_ULong*  length )
   {
     TT_Table*  table;
     TT_Error   error;
 
+
     table = TT_LookUp_Table( face, tag );
-    if (table)
+    if ( table )
     {
-      if (length)
+      if ( length )
         *length = table->Length;
 
       (void)FILE_Seek( table->Offset );
@@ -117,54 +125,61 @@
 
   /*************************************************************************/
   /*                                                                       */
-  /* <FuncType>                                                            */
+  /* <Function>                                                            */
   /*    TT_Load_SFNT_Header                                                */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    Loads the header of a SFNT font file. Supports collections..       */
+  /*    Loads the header of a SFNT font file.  Supports collections.       */
   /*                                                                       */
   /* <Input>                                                               */
-  /*    face      :: A handle to the target face object.                   */
-  /*    stream    :: The input stream.                                     */
+  /*    face       :: A handle to the target face object.                  */
+  /*    stream     :: The input stream.                                    */
+  /*    face_index :: If the font is a collection, the number of the font  */
+  /*                  in the collection, ignored otherwise.                */
   /*                                                                       */
   /* <Output>                                                              */
-  /*    sfnt      :: the sfnt header                                       */
+  /*    sfnt       :: The SFNT header.                                     */
   /*                                                                       */
   /* <Return>                                                              */
   /*    TrueType error code.  0 means success.                             */
   /*                                                                       */
   /* <Note>                                                                */
-  /*    The stream cursor must be at the font file's origin                */
-  /*    This function recognizes fonts embedded in a "TrueType collection" */
+  /*    The stream cursor must be at the font file's origin.               */
   /*                                                                       */
-  /*    This function checks that the header is valid by looking at the    */
-  /*    values of "search_range", "entry_selector" and "range_shift"..     */
+  /*    This function recognizes fonts embedded in a `TrueType collection' */
+  /*                                                                       */
+  /*    The header will be checked whether it is valid by looking at the   */
+  /*    values of `search_range', `entry_selector', and `range_shift'.     */
   /*                                                                       */
   LOCAL_FUNC
-  TT_Error   TT_Load_SFNT_Header( TT_Face       face,
-                                  FT_Stream     stream,
-                                  TT_Long       face_index,
-                                  SFNT_Header*  sfnt )
+  TT_Error  TT_Load_SFNT_Header( TT_Face       face,
+                                 FT_Stream     stream,
+                                 TT_Long       face_index,
+                                 SFNT_Header*  sfnt )
   {
     TT_Error  error;
     TT_ULong  format_tag;
     FT_Memory memory = stream->memory;
     
-    const FT_Frame_Field  sfnt_header_fields[] = {
-                  FT_FRAME_START(8),
-                    FT_FRAME_USHORT( SFNT_Header, num_tables ),
-                    FT_FRAME_USHORT( SFNT_Header, search_range ),
-                    FT_FRAME_USHORT( SFNT_Header, entry_selector ),
-                    FT_FRAME_USHORT( SFNT_Header, range_shift ),
-                  FT_FRAME_END };
+    const FT_Frame_Field  sfnt_header_fields[] =
+    {
+      FT_FRAME_START( 8 ),
+        FT_FRAME_USHORT( SFNT_Header, num_tables ),
+        FT_FRAME_USHORT( SFNT_Header, search_range ),
+        FT_FRAME_USHORT( SFNT_Header, entry_selector ),
+        FT_FRAME_USHORT( SFNT_Header, range_shift ),
+      FT_FRAME_END
+    };
                   
-    const FT_Frame_Field  ttc_header_fields[] = {
-           FT_FRAME_START(8),  /* frame of 8 bytes */
-             FT_FRAME_LONG( TTC_Header, version  ),
-             FT_FRAME_LONG( TTC_Header, DirCount ),
-           FT_FRAME_END };
+    const FT_Frame_Field  ttc_header_fields[] =
+    {
+      FT_FRAME_START( 8 ),
+        FT_FRAME_LONG( TTC_Header, version  ),
+        FT_FRAME_LONG( TTC_Header, DirCount ),
+      FT_FRAME_END };
+
 
-    FT_TRACE2(( "TT_Load_SFNT_Header(%08p, %ld )\n",
+    FT_TRACE2(( "TT_Load_SFNT_Header: %08p, %ld\n",
                 face, face_index ));
 
     face->ttc_header.Tag      = 0;
@@ -173,25 +188,25 @@
 
     face->num_tables = 0;
 
-    /* first of all, read the  first 4 bytes. If it's `ttcf', then the */
+    /* first of all, read the first 4 bytes.  If it's `ttcf', then the */
     /* file is a TrueType collection, otherwise it can be any other    */
-    /* kind of font..                                                  */
-    if ( READ_ULong(format_tag) ) goto Exit;
+    /* kind of font.                                                   */
+    if ( READ_ULong( format_tag ) )
+      goto Exit;
 
     if ( format_tag == TTAG_ttcf )
     {
       TT_Int  n;
 
-      FT_TRACE4(( "TT_Load_SFNT_Header: file is a collection\n" ));
+
+      FT_TRACE3(( "TT_Load_SFNT_Header: file is a collection\n" ));
 
       /* it's a TrueType collection, i.e. a file containing several */
-      /* font files. Read the font directory now                    */
-      /*                                                            */
+      /* font files.  Read the font directory now                   */
       if ( READ_Fields( ttc_header_fields, &face->ttc_header ) )
         goto Exit;
 
-      /* now read the offsets of each font in the file         */
-      /*                                                       */
+      /* now read the offsets of each font in the file */
       if ( ALLOC_ARRAY( face->ttc_header.TableDirectory,
                         face->ttc_header.DirCount,
                         TT_ULong )                        ||
@@ -204,7 +219,7 @@
       FORGET_Frame();
 
       /* check face index */
-      if (face_index >= face->ttc_header.DirCount)
+      if ( face_index >= face->ttc_header.DirCount )
       {
         error = TT_Err_Bad_Argument;
         goto Exit;
@@ -221,19 +236,20 @@
     if ( READ_Fields( sfnt_header_fields, sfnt ) )
       goto Exit;
       
-    /* now, check the values of "num_tables", "seach_range", etc.. */
+    /* now, check the values of `num_tables', `seach_range', etc. */
     {
       TT_UInt  num_tables     = sfnt->num_tables;
       TT_ULong entry_selector = 1L << sfnt->entry_selector;
 
-      /* IMPORTANT: Many fonts have an incorrect "search_range" value, so    */
-      /*            we only check the "entry_selector" correctness here..    */
-      /*                                                                     */
-      if ( num_tables == 0                ||
-           entry_selector > num_tables    ||
-           entry_selector*2 <= num_tables )
+
+      /* IMPORTANT: Many fonts have an incorrect `search_range' value, so */
+      /*            we only check the `entry_selector' correctness here.  */
+      /*                                                                  */
+      if ( num_tables == 0                  ||
+           entry_selector > num_tables      ||
+           entry_selector * 2 <= num_tables )
       {
-        FT_TRACE2(( "TT_Load_SFNT_Header: file is not SFNT !\n" ));
+        FT_TRACE2(( "TT_Load_SFNT_Header: file is not SFNT!\n" ));
         error = FT_Err_Unknown_File_Format;
       }
     }
@@ -243,7 +259,6 @@
   }                                  
 
 
-
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
@@ -252,16 +267,18 @@
   /* <Description>                                                         */
   /*    Loads the table directory into a face object.                      */
   /*                                                                       */
+  /* <InOut>                                                               */
+  /*    face   :: A handle to the target face object.                      */
+  /*                                                                       */
   /* <Input>                                                               */
-  /*    face      :: A handle to the target face object.                   */
-  /*    stream    :: The input stream.                                     */
-  /*    sfnt      :: sfnt directory header                                 */
+  /*    stream :: The input stream.                                        */
+  /*    sfnt   :: The SFNT directory header.                               */
   /*                                                                       */
   /* <Return>                                                              */
   /*    TrueType error code.  0 means success.                             */
   /*                                                                       */
   /* <Note>                                                                */
-  /*    The stream cursor must be at the font file's origin                */
+  /*    The stream cursor must be at the font file's origin.               */
   /*                                                                       */
   LOCAL_FUNC
   TT_Error  TT_Load_Directory( TT_Face       face,
@@ -273,11 +290,11 @@
 
     TT_Table *entry, *limit;
 
-    FT_TRACE2(( "TT_Load_Directory( %08p )\n",
-                face ));
 
-    FT_TRACE2(( "-- Tables count   : %12u\n",  sfnt->num_tables ));
-    FT_TRACE2(( "-- Format version : %08lx\n", sfnt->format_tag ));
+    FT_TRACE2(( "TT_Load_Directory: %08p\n", face ));
+
+    FT_TRACE2(( "-- Tables count:   %12u\n",  sfnt->num_tables ));
+    FT_TRACE2(( "-- Format version: %08lx\n", sfnt->format_tag ));
 
     face->num_tables = sfnt->num_tables;
 
@@ -300,12 +317,12 @@
       entry->Length   = GET_Long();
 
       FT_TRACE2(( "  %c%c%c%c  -  %08lx  -  %08lx\n",
-                (TT_Char)(entry->Tag >> 24),
-                (TT_Char)(entry->Tag >> 16),
-                (TT_Char)(entry->Tag >> 8 ),
-                (TT_Char)(entry->Tag),
-                entry->Offset,
-                entry->Length ));
+                  (TT_Char)( entry->Tag >> 24 ),
+                  (TT_Char)( entry->Tag >> 16 ),
+                  (TT_Char)( entry->Tag >> 8  ),
+                  (TT_Char)( entry->Tag       ),
+                  entry->Offset,
+                  entry->Length ));
     }
 
     FORGET_Frame();
@@ -329,7 +346,7 @@
   /* <Input>                                                               */
   /*    face   :: The face object to look for.                             */
   /*                                                                       */
-  /*    tag    :: The tag of table to load.  Use the value 0 if you  want  */
+  /*    tag    :: The tag of table to load.  Use the value 0 if you want   */
   /*              to access the whole font file, else set this parameter   */
   /*              to a valid TrueType table tag that you can forge with    */
   /*              the MAKE_TT_TAG macro.                                   */
@@ -370,6 +387,7 @@
     TT_Table*  table;
     TT_ULong   size;
 
+
     if ( tag != 0 )
     {
       /* look for tag in font directory */
@@ -384,14 +402,13 @@
       size    = table->Length;
     }
     else
-    /* tag = 0 -- the use want to access the font file directly */
-    {
+      /* tag == 0 -- the user wants to access the font file directly */
       size = face->root.stream->size;
-    }
 
     if ( length && *length == 0 )
     {
       *length = size;
+
       return TT_Err_Ok;
     }
 
@@ -428,30 +445,33 @@
     TT_Error    error;
     TT_Header*  header;
 
-    static const FT_Frame_Field  header_fields[] = {
-            FT_FRAME_START(54),
-              FT_FRAME_ULONG(  TT_Header, Table_Version ),
-              FT_FRAME_ULONG(  TT_Header, Font_Revision ),
-              FT_FRAME_LONG(   TT_Header, CheckSum_Adjust ),
-              FT_FRAME_LONG(   TT_Header, Magic_Number ),
-              FT_FRAME_USHORT( TT_Header, Flags ),
-              FT_FRAME_USHORT( TT_Header, Units_Per_EM ),
-              FT_FRAME_LONG(   TT_Header, Created[0] ),
-              FT_FRAME_LONG(   TT_Header, Created[1] ),
-              FT_FRAME_LONG(   TT_Header, Modified[0] ),
-              FT_FRAME_LONG(   TT_Header, Modified[1] ),
-              FT_FRAME_SHORT(  TT_Header, xMin ),
-              FT_FRAME_SHORT(  TT_Header, yMin ),
-              FT_FRAME_SHORT(  TT_Header, xMax ),
-              FT_FRAME_SHORT(  TT_Header, yMax ),
-              FT_FRAME_USHORT( TT_Header, Mac_Style ),
-              FT_FRAME_USHORT( TT_Header, Lowest_Rec_PPEM ),
-              FT_FRAME_SHORT(  TT_Header, Font_Direction ),
-              FT_FRAME_SHORT(  TT_Header, Index_To_Loc_Format ),
-              FT_FRAME_SHORT(  TT_Header, Glyph_Data_Format ),
-            FT_FRAME_END };
-
-    FT_TRACE2(( "Load_TT_Header( %08p )\n", face ));
+    static const FT_Frame_Field  header_fields[] =
+    {
+      FT_FRAME_START( 54 ),
+        FT_FRAME_ULONG(  TT_Header, Table_Version ),
+        FT_FRAME_ULONG(  TT_Header, Font_Revision ),
+        FT_FRAME_LONG(   TT_Header, CheckSum_Adjust ),
+        FT_FRAME_LONG(   TT_Header, Magic_Number ),
+        FT_FRAME_USHORT( TT_Header, Flags ),
+        FT_FRAME_USHORT( TT_Header, Units_Per_EM ),
+        FT_FRAME_LONG(   TT_Header, Created[0] ),
+        FT_FRAME_LONG(   TT_Header, Created[1] ),
+        FT_FRAME_LONG(   TT_Header, Modified[0] ),
+        FT_FRAME_LONG(   TT_Header, Modified[1] ),
+        FT_FRAME_SHORT(  TT_Header, xMin ),
+        FT_FRAME_SHORT(  TT_Header, yMin ),
+        FT_FRAME_SHORT(  TT_Header, xMax ),
+        FT_FRAME_SHORT(  TT_Header, yMax ),
+        FT_FRAME_USHORT( TT_Header, Mac_Style ),
+        FT_FRAME_USHORT( TT_Header, Lowest_Rec_PPEM ),
+        FT_FRAME_SHORT(  TT_Header, Font_Direction ),
+        FT_FRAME_SHORT(  TT_Header, Index_To_Loc_Format ),
+        FT_FRAME_SHORT(  TT_Header, Glyph_Data_Format ),
+      FT_FRAME_END
+    };
+
+
+    FT_TRACE2(( "Load_TT_Header: %08p\n", face ));
 
     error = face->goto_table( face, TTAG_head, stream, 0 );
     if ( error )
@@ -465,8 +485,8 @@
     if ( READ_Fields( header_fields, header ) )
       goto Exit;
 
-    FT_TRACE2(( "    Units per EM : %8u\n", header->Units_Per_EM ));
-    FT_TRACE2(( "    IndexToLoc   : %8d\n", header->Index_To_Loc_Format ));
+    FT_TRACE2(( "    Units per EM: %8u\n", header->Units_Per_EM ));
+    FT_TRACE2(( "    IndexToLoc:   %8d\n", header->Index_To_Loc_Format ));
     FT_TRACE2(( "Font Header Loaded.\n" ));
 
   Exit:
@@ -496,31 +516,35 @@
     TT_Error        error;
     TT_MaxProfile*  maxProfile = &face->max_profile;
 
-    const FT_Frame_Field  maxp_fields[] = {
-              FT_FRAME_START(32),
-                FT_FRAME_ULONG(  TT_MaxProfile, version ),
-                FT_FRAME_USHORT( TT_MaxProfile, numGlyphs ),
-                FT_FRAME_USHORT( TT_MaxProfile, maxPoints ),
-                FT_FRAME_USHORT( TT_MaxProfile, maxContours ),
-                FT_FRAME_USHORT( TT_MaxProfile, maxCompositePoints ),
-                FT_FRAME_USHORT( TT_MaxProfile, maxCompositeContours ),
-                FT_FRAME_USHORT( TT_MaxProfile, maxZones ),
-                FT_FRAME_USHORT( TT_MaxProfile, maxTwilightPoints ),
-                FT_FRAME_USHORT( TT_MaxProfile, maxStorage ),
-                FT_FRAME_USHORT( TT_MaxProfile, maxFunctionDefs ),
-                FT_FRAME_USHORT( TT_MaxProfile, maxInstructionDefs ),
-                FT_FRAME_USHORT( TT_MaxProfile, maxStackElements ),
-                FT_FRAME_USHORT( TT_MaxProfile, maxSizeOfInstructions ),
-                FT_FRAME_USHORT( TT_MaxProfile, maxComponentElements ),
-                FT_FRAME_USHORT( TT_MaxProfile, maxComponentDepth ),
-              FT_FRAME_END };
-
-    FT_TRACE2(( "Load_TT_MaxProfile( %08p )\n", face ));
+    const FT_Frame_Field  maxp_fields[] =
+    {
+      FT_FRAME_START( 32 ),
+        FT_FRAME_ULONG(  TT_MaxProfile, version ),
+        FT_FRAME_USHORT( TT_MaxProfile, numGlyphs ),
+        FT_FRAME_USHORT( TT_MaxProfile, maxPoints ),
+        FT_FRAME_USHORT( TT_MaxProfile, maxContours ),
+        FT_FRAME_USHORT( TT_MaxProfile, maxCompositePoints ),
+        FT_FRAME_USHORT( TT_MaxProfile, maxCompositeContours ),
+        FT_FRAME_USHORT( TT_MaxProfile, maxZones ),
+        FT_FRAME_USHORT( TT_MaxProfile, maxTwilightPoints ),
+        FT_FRAME_USHORT( TT_MaxProfile, maxStorage ),
+        FT_FRAME_USHORT( TT_MaxProfile, maxFunctionDefs ),
+        FT_FRAME_USHORT( TT_MaxProfile, maxInstructionDefs ),
+        FT_FRAME_USHORT( TT_MaxProfile, maxStackElements ),
+        FT_FRAME_USHORT( TT_MaxProfile, maxSizeOfInstructions ),
+        FT_FRAME_USHORT( TT_MaxProfile, maxComponentElements ),
+        FT_FRAME_USHORT( TT_MaxProfile, maxComponentDepth ),
+      FT_FRAME_END };
+
+
+    FT_TRACE2(( "Load_TT_MaxProfile: %08p\n", face ));
 
     error = face->goto_table( face, TTAG_maxp, stream, 0 );
-    if (error) goto Exit;
+    if ( error )
+      goto Exit;
 
-    if ( READ_Fields( maxp_fields, maxProfile ) ) goto Exit;
+    if ( READ_Fields( maxp_fields, maxProfile ) )
+      goto Exit;
 
     /* XXX: an adjustment that is necessary to load certain */
     /*       broken fonts like `Keystrokes MT' :-(          */
@@ -553,6 +577,7 @@
     face->root.max_contours += 4;
 
     FT_TRACE2(( "MAXP loaded.\n" ));
+
   Exit:
     return error;
   }
@@ -588,8 +613,8 @@
     TT_LongMetrics**   longs;
     TT_ShortMetrics**  shorts;
 
-    FT_TRACE2(( "TT_Load_%s_Metrics( %08p )\n",
-              vertical ? "Vertical" : "Horizontal", face ));
+    FT_TRACE2(( "TT_Load_%s_Metrics: %08p\n",
+                  vertical ? "Vertical" : "Horizontal", face ));
 
     if ( vertical )
     {
@@ -603,7 +628,7 @@
       error = face->goto_table( face, TTAG_vmtx, stream, &table_len );
       if ( error )
       {
-        /* Set the number_Of_VMetrics to 0! */
+        /* Set number_Of_VMetrics to 0! */
         FT_TRACE2(( "  no vertical header in file.\n" ));
         face->vertical.number_Of_VMetrics = 0;
         error = TT_Err_Ok;
@@ -617,7 +642,7 @@
     else
     {
       error = face->goto_table( face, TTAG_hmtx, stream, &table_len );
-      if (error)
+      if ( error )
       {
         FT_ERROR(( " no horizontal metrics in file!\n" ));
         error = TT_Err_Hmtx_Table_Missing;
@@ -632,17 +657,18 @@
     /* never trust derived values */
 
     num_shorts         = face->max_profile.numGlyphs - num_longs;
-    num_shorts_checked = ( table_len - num_longs*4L )/2;
+    num_shorts_checked = ( table_len - num_longs * 4L ) / 2;
 
     if ( num_shorts < 0 )
     {
       FT_ERROR(( "!! more metrics than glyphs!\n" ));
-      error = ( vertical ? TT_Err_Invalid_Vert_Metrics
-                         : TT_Err_Invalid_Horiz_Metrics );
+
+      error = vertical ? TT_Err_Invalid_Vert_Metrics
+                       : TT_Err_Invalid_Horiz_Metrics;
       goto Exit;
     }
 
-    if ( ALLOC_ARRAY( *longs,  num_longs,  TT_LongMetrics ) ||
+    if ( ALLOC_ARRAY( *longs,  num_longs,  TT_LongMetrics )  ||
          ALLOC_ARRAY( *shorts, num_shorts, TT_ShortMetrics ) )
       goto Exit;
 
@@ -653,6 +679,7 @@
       TT_LongMetrics*  cur   = *longs;
       TT_LongMetrics*  limit = cur + num_longs;
 
+
       for ( ; cur < limit; cur++ )
       {
         cur->advance = GET_UShort();
@@ -660,20 +687,22 @@
       }
     }
 
-    /* do we have an inconsistent number of metric values ? */
+    /* do we have an inconsistent number of metric values? */
     {
       TT_ShortMetrics*  cur   = *shorts;
       TT_ShortMetrics*  limit = cur + MIN( num_shorts, num_shorts_checked );
 
+
       for ( ; cur < limit; cur++ )
         *cur = GET_Short();
 
-      /* we fill up the missing left side bearings with the    */
-      /* last valid value. Since this will occur for buggy CJK */
-      /* fonts usually, nothing serious will happen            */
+      /* we fill up the missing left side bearings with the     */
+      /* last valid value.  Since this will occur for buggy CJK */
+      /* fonts usually only, nothing serious will happen        */
       if ( num_shorts > num_shorts_checked && num_shorts_checked > 0 )
       {
-        TT_Short  val = *(shorts)[num_shorts_checked-1];
+        TT_Short  val = *(shorts)[num_shorts_checked - 1];
+
 
         limit = *shorts + num_shorts;
         for ( ; cur < limit; cur++ )
@@ -714,26 +743,29 @@
     TT_Error        error;
     TT_HoriHeader*  header;
 
-    const FT_Frame_Field  metrics_header_fields[] = {
-              FT_FRAME_START(36),
-                FT_FRAME_ULONG(  TT_HoriHeader, Version ),
-                FT_FRAME_SHORT(  TT_HoriHeader, Ascender ),
-                FT_FRAME_SHORT(  TT_HoriHeader, Descender ),
-                FT_FRAME_SHORT(  TT_HoriHeader, Line_Gap ),
-                FT_FRAME_USHORT( TT_HoriHeader, advance_Width_Max ),
-                FT_FRAME_SHORT(  TT_HoriHeader, min_Left_Side_Bearing ),
-                FT_FRAME_SHORT(  TT_HoriHeader, min_Right_Side_Bearing ),
-                FT_FRAME_SHORT(  TT_HoriHeader, xMax_Extent ),
-                FT_FRAME_SHORT(  TT_HoriHeader, caret_Slope_Rise ),
-                FT_FRAME_SHORT(  TT_HoriHeader, caret_Slope_Run ),
-                FT_FRAME_SHORT(  TT_HoriHeader, Reserved[0] ),
-                FT_FRAME_SHORT(  TT_HoriHeader, Reserved[1] ),
-                FT_FRAME_SHORT(  TT_HoriHeader, Reserved[2] ),
-                FT_FRAME_SHORT(  TT_HoriHeader, Reserved[3] ),
-                FT_FRAME_SHORT(  TT_HoriHeader, Reserved[4] ),
-                FT_FRAME_SHORT(  TT_HoriHeader, metric_Data_Format ),
-                FT_FRAME_USHORT( TT_HoriHeader, number_Of_HMetrics ),
-              FT_FRAME_END };
+    const FT_Frame_Field  metrics_header_fields[] =
+    {
+      FT_FRAME_START( 36 ),
+        FT_FRAME_ULONG(  TT_HoriHeader, Version ),
+        FT_FRAME_SHORT(  TT_HoriHeader, Ascender ),
+        FT_FRAME_SHORT(  TT_HoriHeader, Descender ),
+        FT_FRAME_SHORT(  TT_HoriHeader, Line_Gap ),
+        FT_FRAME_USHORT( TT_HoriHeader, advance_Width_Max ),
+        FT_FRAME_SHORT(  TT_HoriHeader, min_Left_Side_Bearing ),
+        FT_FRAME_SHORT(  TT_HoriHeader, min_Right_Side_Bearing ),
+        FT_FRAME_SHORT(  TT_HoriHeader, xMax_Extent ),
+        FT_FRAME_SHORT(  TT_HoriHeader, caret_Slope_Rise ),
+        FT_FRAME_SHORT(  TT_HoriHeader, caret_Slope_Run ),
+        FT_FRAME_SHORT(  TT_HoriHeader, Reserved[0] ),
+        FT_FRAME_SHORT(  TT_HoriHeader, Reserved[1] ),
+        FT_FRAME_SHORT(  TT_HoriHeader, Reserved[2] ),
+        FT_FRAME_SHORT(  TT_HoriHeader, Reserved[3] ),
+        FT_FRAME_SHORT(  TT_HoriHeader, Reserved[4] ),
+        FT_FRAME_SHORT(  TT_HoriHeader, metric_Data_Format ),
+        FT_FRAME_USHORT( TT_HoriHeader, number_Of_HMetrics ),
+      FT_FRAME_END
+    };
+
 
     FT_TRACE2(( vertical ? "Vertical header " : "Horizontal header " ));
 
@@ -744,7 +776,7 @@
       /* The vertical header table is optional, so return quietly if */
       /* we don't find it.                                           */
       error = face->goto_table( face, TTAG_vhea, stream, 0 );
-      if (error)
+      if ( error )
       {
         error = TT_Err_Ok;
         goto Exit;
@@ -758,7 +790,7 @@
       /* The horizontal header is mandatory, return an error if we */
       /* don't find it.                                            */
       error = face->goto_table( face, TTAG_hhea, stream, 0 );
-      if (error)
+      if ( error )
       {
         error = TT_Err_Horiz_Header_Missing;
         goto Exit;
@@ -767,7 +799,8 @@
       header = &face->horizontal;
     }
 
-    if ( READ_Fields( metrics_header_fields, header ) ) goto Exit;
+    if ( READ_Fields( metrics_header_fields, header ) )
+      goto Exit;
 
     header->long_metrics  = NULL;
     header->short_metrics = NULL;
@@ -777,6 +810,7 @@
     /* Now try to load the corresponding metrics */
 
     error = TT_Load_Metrics( face, stream, vertical );
+
   Exit:
     return error;
   }
@@ -798,7 +832,8 @@
   /*    TrueType error code.  0 means success.                             */
   /*                                                                       */
   LOCAL_FUNC
-  TT_Error  TT_Load_Names( TT_Face  face, FT_Stream  stream )
+  TT_Error  TT_Load_Names( TT_Face    face,
+                           FT_Stream  stream )
   {
     TT_Error   error;
     FT_Memory  memory = stream->memory;
@@ -808,27 +843,32 @@
 
     TT_NameTable*  names;
 
-    const FT_Frame_Field  name_table_fields[] = {
-              FT_FRAME_START(6),
-                FT_FRAME_USHORT( TT_NameTable, format ),
-                FT_FRAME_USHORT( TT_NameTable, numNameRecords ),
-                FT_FRAME_USHORT( TT_NameTable, storageOffset ),
-              FT_FRAME_END };
-
-    const FT_Frame_Field  name_record_fields[] = {
-                FT_FRAME_USHORT( TT_NameRec, platformID ),
-                FT_FRAME_USHORT( TT_NameRec, encodingID ),
-                FT_FRAME_USHORT( TT_NameRec, languageID ),
-                FT_FRAME_USHORT( TT_NameRec, nameID ),
-                FT_FRAME_USHORT( TT_NameRec, stringLength ),
-                FT_FRAME_USHORT( TT_NameRec, stringOffset ),
-              FT_FRAME_END };
+    const FT_Frame_Field  name_table_fields[] =
+    {
+      FT_FRAME_START( 6 ),
+        FT_FRAME_USHORT( TT_NameTable, format ),
+        FT_FRAME_USHORT( TT_NameTable, numNameRecords ),
+        FT_FRAME_USHORT( TT_NameTable, storageOffset ),
+      FT_FRAME_END
+    };
+
+    const FT_Frame_Field  name_record_fields[] =
+    {
+      /* no FT_FRAME_START */
+        FT_FRAME_USHORT( TT_NameRec, platformID ),
+        FT_FRAME_USHORT( TT_NameRec, encodingID ),
+        FT_FRAME_USHORT( TT_NameRec, languageID ),
+        FT_FRAME_USHORT( TT_NameRec, nameID ),
+        FT_FRAME_USHORT( TT_NameRec, stringLength ),
+        FT_FRAME_USHORT( TT_NameRec, stringOffset ),
+      FT_FRAME_END
+    };
 
 
     FT_TRACE2(( "Names " ));
 
     error = face->goto_table( face, TTAG_name, stream, &table_len );
-    if (error)
+    if ( error )
     {
       /* The name table is required so indicate failure. */
       FT_TRACE2(( "is missing!\n" ));
@@ -840,7 +880,8 @@
 
     names = &face->name_table;
 
-    if ( READ_Fields( name_table_fields, names ) ) goto Exit;
+    if ( READ_Fields( name_table_fields, names ) )
+      goto Exit;
 
     /* Allocate the array of name records. */
     if ( ALLOC_ARRAY( names->names,
@@ -852,8 +893,9 @@
     /* Load the name records and determine how much storage is needed */
     /* to hold the strings themselves.                                */
     {
-      TT_NameRec*    cur   = names->names;
-      TT_NameRec*    limit = cur + names->numNameRecords;
+      TT_NameRec*  cur   = names->names;
+      TT_NameRec*  limit = cur + names->numNameRecords;
+
 
       storageSize = 0;
 
@@ -861,19 +903,21 @@
       {
         TT_ULong  upper;
 
+
         (void)READ_Fields( name_record_fields, cur );
 
-        upper = (TT_ULong)(cur->stringOffset + cur->stringLength);
-        if ( upper > storageSize ) storageSize = upper;
+        upper = (TT_ULong)( cur->stringOffset + cur->stringLength );
+        if ( upper > storageSize )
+          storageSize = upper;
       }
     }
 
     FORGET_Frame();
 
-    if (storageSize > 0)
+    if ( storageSize > 0 )
     {
       /* allocate the name storage area in memory, then read it */
-      if ( ALLOC( names->storage, storageSize )  ||
+      if ( ALLOC( names->storage, storageSize )               ||
            FILE_Read_At( table_pos + names->storageOffset,
                          (void*)names->storage, storageSize ) )
         goto Exit;
@@ -883,21 +927,25 @@
         TT_NameRec*  cur   = names->names;
         TT_NameRec*  limit = cur + names->numNameRecords;
 
+
         for ( ; cur < limit; cur++ )
           cur->string = names->storage + cur->stringOffset;
       }
 
 #ifdef FT_DEBUG_LEVEL_TRACE
+
       /* Print Name Record Table in case of debugging */
       {
         TT_NameRec*  cur   = names->names;
         TT_NameRec*  limit = cur + names->numNameRecords;
 
+
         for ( ; cur < limit; cur++ )
         {
           TT_UInt  j;
 
-          FT_TRACE2(( "%d %d %x %d ",
+
+          FT_TRACE3(( "%d %d %x %d\n  ",
                        cur->platformID,
                        cur->encodingID,
                        cur->languageID,
@@ -910,13 +958,16 @@
             {
               TT_Char  c = *(cur->string + j);
 
+
               if ( (TT_Byte)c < 128 )
-                FT_TRACE2(( "%c", c ));
+                FT_TRACE3(( "%c", c ));
             }
         }
       }
-      FT_TRACE2(( "\n" ));
-#endif
+      FT_TRACE3(( "\n" ));
+
+#endif /* FT_DEBUG_LEVEL_TRACE */
+
     }
     FT_TRACE2(( "loaded\n" ));
 
@@ -965,8 +1016,8 @@
   /*    loaded on demand in the `ttcmap.c' module.                         */
   /*                                                                       */
   /* <Input>                                                               */
-  /*    face    :: A handle to the target face object.                     */
-  /*    stream  :: A handle to the input stream.                           */
+  /*    face   :: A handle to the target face object.                      */
+  /*    stream :: A handle to the input stream.                            */
   /*                                                                       */
   /* <Return>                                                              */
   /*     TrueType error code.  0 means success.                            */
@@ -980,23 +1031,28 @@
     TT_Long     table_start;
     TT_CMapDir  cmap_dir;
 
-    const FT_Frame_Field  cmap_fields[] = {
-              FT_FRAME_START(4),
-                FT_FRAME_USHORT( TT_CMapDir, tableVersionNumber ),
-                FT_FRAME_USHORT( TT_CMapDir, numCMaps ),
-              FT_FRAME_END };
+    const FT_Frame_Field  cmap_fields[] =
+    {
+      FT_FRAME_START( 4 ),
+        FT_FRAME_USHORT( TT_CMapDir, tableVersionNumber ),
+        FT_FRAME_USHORT( TT_CMapDir, numCMaps ),
+      FT_FRAME_END
+    };
+
+    const FT_Frame_Field  cmap_rec_fields[] =
+    {
+      FT_FRAME_START( 6 ),
+        FT_FRAME_USHORT( TT_CMapTable, format ),
+        FT_FRAME_USHORT( TT_CMapTable, length ),
+        FT_FRAME_USHORT( TT_CMapTable, version ),
+      FT_FRAME_END
+    };
 
-    const FT_Frame_Field  cmap_rec_fields[] = {
-              FT_FRAME_START(6),
-                FT_FRAME_USHORT( TT_CMapTable, format ),
-                FT_FRAME_USHORT( TT_CMapTable, length ),
-                FT_FRAME_USHORT( TT_CMapTable, version ),
-              FT_FRAME_END };
 
     FT_TRACE2(( "CMaps " ));
 
     error = face->goto_table( face, TTAG_cmap, stream, 0 );
-    if (error)
+    if ( error )
     {
       error = TT_Err_CMap_Table_Missing;
       goto Exit;
@@ -1004,7 +1060,8 @@
 
     table_start = FILE_Pos();
 
-    if ( READ_Fields( cmap_fields, &cmap_dir ) ) goto Exit;
+    if ( READ_Fields( cmap_fields, &cmap_dir ) )
+      goto Exit;
 
     /* save space in face table for cmap tables */
     if ( ALLOC_ARRAY( face->charmaps,
@@ -1017,12 +1074,16 @@
       TT_CharMap  charmap = face->charmaps;
       TT_CharMap  limit   = charmap + face->num_charmaps;
 
+
       /* read the header of each charmap first */
-      if ( ACCESS_Frame( face->num_charmaps*8L ) ) goto Exit;
+      if ( ACCESS_Frame( face->num_charmaps * 8L ) )
+        goto Exit;
+
       for ( ; charmap < limit; charmap++ )
       {
         TT_CMapTable*  cmap;
 
+
         charmap->root.face = (FT_Face)face;
         cmap               = &charmap->cmap;
 
@@ -1031,6 +1092,7 @@
         cmap->platformEncodingID = GET_UShort();
         cmap->offset             = (TT_ULong)GET_Long();
       }
+
       FORGET_Frame();
 
       /* now read the rest of each table */
@@ -1038,6 +1100,7 @@
       {
         TT_CMapTable* cmap = &charmap->cmap;
 
+
         if ( FILE_Seek( table_start + (TT_Long)cmap->offset ) ||
              READ_Fields( cmap_rec_fields, cmap )             )
           goto Exit;
@@ -1047,6 +1110,7 @@
     }
 
     FT_TRACE2(( "loaded\n" ));
+
   Exit:
     return error;
   }
@@ -1074,67 +1138,74 @@
     TT_Error  error;
     TT_OS2*   os2;
 
-    const FT_Frame_Field  os2_fields[] = {
-              FT_FRAME_START(78),
-                FT_FRAME_USHORT( TT_OS2, version ),
-                FT_FRAME_SHORT(  TT_OS2, xAvgCharWidth ),
-                FT_FRAME_USHORT( TT_OS2, usWeightClass ),
-                FT_FRAME_USHORT( TT_OS2, usWidthClass ),
-                FT_FRAME_SHORT(  TT_OS2, fsType ),
-                FT_FRAME_SHORT(  TT_OS2, ySubscriptXSize ),
-                FT_FRAME_SHORT(  TT_OS2, ySubscriptYSize ),
-                FT_FRAME_SHORT(  TT_OS2, ySubscriptXOffset ),
-                FT_FRAME_SHORT(  TT_OS2, ySubscriptYOffset ),
-                FT_FRAME_SHORT(  TT_OS2, ySuperscriptXSize ),
-                FT_FRAME_SHORT(  TT_OS2, ySuperscriptYSize ),
-                FT_FRAME_SHORT(  TT_OS2, ySuperscriptXOffset ),
-                FT_FRAME_SHORT(  TT_OS2, ySuperscriptYOffset ),
-                FT_FRAME_SHORT(  TT_OS2, yStrikeoutSize ),
-                FT_FRAME_SHORT(  TT_OS2, yStrikeoutPosition ),
-                FT_FRAME_SHORT(  TT_OS2, sFamilyClass ),
-                FT_FRAME_BYTE(   TT_OS2, panose[0] ),
-                FT_FRAME_BYTE(   TT_OS2, panose[1] ),
-                FT_FRAME_BYTE(   TT_OS2, panose[2] ),
-                FT_FRAME_BYTE(   TT_OS2, panose[3] ),
-                FT_FRAME_BYTE(   TT_OS2, panose[4] ),
-                FT_FRAME_BYTE(   TT_OS2, panose[5] ),
-                FT_FRAME_BYTE(   TT_OS2, panose[6] ),
-                FT_FRAME_BYTE(   TT_OS2, panose[7] ),
-                FT_FRAME_BYTE(   TT_OS2, panose[8] ),
-                FT_FRAME_BYTE(   TT_OS2, panose[9] ),
-                FT_FRAME_ULONG(  TT_OS2, ulUnicodeRange1 ),
-                FT_FRAME_ULONG(  TT_OS2, ulUnicodeRange2 ),
-                FT_FRAME_ULONG(  TT_OS2, ulUnicodeRange3 ),
-                FT_FRAME_ULONG(  TT_OS2, ulUnicodeRange4 ),
-                FT_FRAME_BYTE(   TT_OS2, achVendID[0] ),
-                FT_FRAME_BYTE(   TT_OS2, achVendID[1] ),
-                FT_FRAME_BYTE(   TT_OS2, achVendID[2] ),
-                FT_FRAME_BYTE(   TT_OS2, achVendID[3] ),
-
-                FT_FRAME_USHORT( TT_OS2, fsSelection ),
-                FT_FRAME_USHORT( TT_OS2, usFirstCharIndex ),
-                FT_FRAME_USHORT( TT_OS2, usLastCharIndex ),
-                FT_FRAME_SHORT(  TT_OS2, sTypoAscender ),
-                FT_FRAME_SHORT(  TT_OS2, sTypoDescender ),
-                FT_FRAME_SHORT(  TT_OS2, sTypoLineGap ),
-                FT_FRAME_USHORT( TT_OS2, usWinAscent ),
-                FT_FRAME_USHORT( TT_OS2, usWinDescent ),
-              FT_FRAME_END };
-
-    const FT_Frame_Field  os2_fields_extra[] = {
-              FT_FRAME_START(8),
-                FT_FRAME_ULONG( TT_OS2, ulCodePageRange1 ),
-                FT_FRAME_ULONG( TT_OS2, ulCodePageRange2 ),
-              FT_FRAME_END };
-
-    const FT_Frame_Field  os2_fields_extra2[] = {
-              FT_FRAME_START(10),
-                FT_FRAME_SHORT( TT_OS2,  sxHeight ),
-                FT_FRAME_SHORT( TT_OS2,  sCapHeight ),
-                FT_FRAME_USHORT( TT_OS2, usDefaultChar ),
-                FT_FRAME_USHORT( TT_OS2, usBreakChar ),
-                FT_FRAME_USHORT( TT_OS2, usMaxContext ),
-              FT_FRAME_END };
+    const FT_Frame_Field  os2_fields[] =
+    {
+      FT_FRAME_START( 78 ),
+        FT_FRAME_USHORT( TT_OS2, version ),
+        FT_FRAME_SHORT(  TT_OS2, xAvgCharWidth ),
+        FT_FRAME_USHORT( TT_OS2, usWeightClass ),
+        FT_FRAME_USHORT( TT_OS2, usWidthClass ),
+        FT_FRAME_SHORT(  TT_OS2, fsType ),
+        FT_FRAME_SHORT(  TT_OS2, ySubscriptXSize ),
+        FT_FRAME_SHORT(  TT_OS2, ySubscriptYSize ),
+        FT_FRAME_SHORT(  TT_OS2, ySubscriptXOffset ),
+        FT_FRAME_SHORT(  TT_OS2, ySubscriptYOffset ),
+        FT_FRAME_SHORT(  TT_OS2, ySuperscriptXSize ),
+        FT_FRAME_SHORT(  TT_OS2, ySuperscriptYSize ),
+        FT_FRAME_SHORT(  TT_OS2, ySuperscriptXOffset ),
+        FT_FRAME_SHORT(  TT_OS2, ySuperscriptYOffset ),
+        FT_FRAME_SHORT(  TT_OS2, yStrikeoutSize ),
+        FT_FRAME_SHORT(  TT_OS2, yStrikeoutPosition ),
+        FT_FRAME_SHORT(  TT_OS2, sFamilyClass ),
+        FT_FRAME_BYTE(   TT_OS2, panose[0] ),
+        FT_FRAME_BYTE(   TT_OS2, panose[1] ),
+        FT_FRAME_BYTE(   TT_OS2, panose[2] ),
+        FT_FRAME_BYTE(   TT_OS2, panose[3] ),
+        FT_FRAME_BYTE(   TT_OS2, panose[4] ),
+        FT_FRAME_BYTE(   TT_OS2, panose[5] ),
+        FT_FRAME_BYTE(   TT_OS2, panose[6] ),
+        FT_FRAME_BYTE(   TT_OS2, panose[7] ),
+        FT_FRAME_BYTE(   TT_OS2, panose[8] ),
+        FT_FRAME_BYTE(   TT_OS2, panose[9] ),
+        FT_FRAME_ULONG(  TT_OS2, ulUnicodeRange1 ),
+        FT_FRAME_ULONG(  TT_OS2, ulUnicodeRange2 ),
+        FT_FRAME_ULONG(  TT_OS2, ulUnicodeRange3 ),
+        FT_FRAME_ULONG(  TT_OS2, ulUnicodeRange4 ),
+        FT_FRAME_BYTE(   TT_OS2, achVendID[0] ),
+        FT_FRAME_BYTE(   TT_OS2, achVendID[1] ),
+        FT_FRAME_BYTE(   TT_OS2, achVendID[2] ),
+        FT_FRAME_BYTE(   TT_OS2, achVendID[3] ),
+
+        FT_FRAME_USHORT( TT_OS2, fsSelection ),
+        FT_FRAME_USHORT( TT_OS2, usFirstCharIndex ),
+        FT_FRAME_USHORT( TT_OS2, usLastCharIndex ),
+        FT_FRAME_SHORT(  TT_OS2, sTypoAscender ),
+        FT_FRAME_SHORT(  TT_OS2, sTypoDescender ),
+        FT_FRAME_SHORT(  TT_OS2, sTypoLineGap ),
+        FT_FRAME_USHORT( TT_OS2, usWinAscent ),
+        FT_FRAME_USHORT( TT_OS2, usWinDescent ),
+      FT_FRAME_END
+    };
+
+    const FT_Frame_Field  os2_fields_extra[] =
+    {
+      FT_FRAME_START( 8 ),
+        FT_FRAME_ULONG( TT_OS2, ulCodePageRange1 ),
+        FT_FRAME_ULONG( TT_OS2, ulCodePageRange2 ),
+      FT_FRAME_END
+    };
+
+    const FT_Frame_Field  os2_fields_extra2[] =
+    {
+      FT_FRAME_START( 10 ),
+        FT_FRAME_SHORT( TT_OS2,  sxHeight ),
+        FT_FRAME_SHORT( TT_OS2,  sCapHeight ),
+        FT_FRAME_USHORT( TT_OS2, usDefaultChar ),
+        FT_FRAME_USHORT( TT_OS2, usBreakChar ),
+        FT_FRAME_USHORT( TT_OS2, usMaxContext ),
+      FT_FRAME_END
+    };
+
 
     FT_TRACE2(( "OS/2 Table " ));
 
@@ -1142,7 +1213,7 @@
     /* exist.  Simply put, we set the `version' field to 0xFFFF   */
     /* and test this value each time we need to access the table. */
     error = face->goto_table( face, TTAG_OS2, stream, 0 );
-    if (error)
+    if ( error )
     {
       FT_TRACE2(( "is missing\n!" ));
       face->os2.version = 0xFFFF;
@@ -1152,7 +1223,8 @@
 
     os2 = &face->os2;
 
-    if ( READ_Fields( os2_fields, os2 ) ) goto Exit;
+    if ( READ_Fields( os2_fields, os2 ) )
+      goto Exit;
 
     os2->ulCodePageRange1 = 0;
     os2->ulCodePageRange2 = 0;
@@ -1160,12 +1232,14 @@
     if ( os2->version >= 0x0001 )
     {
       /* only version 1 tables */
-      if ( READ_Fields( os2_fields_extra, os2 ) ) goto Exit;
+      if ( READ_Fields( os2_fields_extra, os2 ) )
+        goto Exit;
 
       if ( os2->version >= 0x0002 )
       {
         /* only version 2 tables */
-        if ( READ_Fields( os2_fields_extra2, os2 ) ) goto Exit;
+        if ( READ_Fields( os2_fields_extra2, os2 ) )
+          goto Exit;
       }
     }
 
@@ -1198,26 +1272,30 @@
     TT_Error        error;
     TT_Postscript*  post = &face->postscript;
 
-    static const FT_Frame_Field  post_fields[] = {
-              FT_FRAME_START(32),
-                FT_FRAME_ULONG( TT_Postscript, FormatType ),
-                FT_FRAME_ULONG( TT_Postscript, italicAngle ),
-                FT_FRAME_SHORT( TT_Postscript, underlinePosition ),
-                FT_FRAME_SHORT( TT_Postscript, underlineThickness ),
-                FT_FRAME_ULONG( TT_Postscript, isFixedPitch ),
-                FT_FRAME_ULONG( TT_Postscript, minMemType42 ),
-                FT_FRAME_ULONG( TT_Postscript, maxMemType42 ),
-                FT_FRAME_ULONG( TT_Postscript, minMemType1 ),
-                FT_FRAME_ULONG( TT_Postscript, maxMemType1 ),
-              FT_FRAME_END };
+    static const FT_Frame_Field  post_fields[] =
+    {
+      FT_FRAME_START( 32 ),
+        FT_FRAME_ULONG( TT_Postscript, FormatType ),
+        FT_FRAME_ULONG( TT_Postscript, italicAngle ),
+        FT_FRAME_SHORT( TT_Postscript, underlinePosition ),
+        FT_FRAME_SHORT( TT_Postscript, underlineThickness ),
+        FT_FRAME_ULONG( TT_Postscript, isFixedPitch ),
+        FT_FRAME_ULONG( TT_Postscript, minMemType42 ),
+        FT_FRAME_ULONG( TT_Postscript, maxMemType42 ),
+        FT_FRAME_ULONG( TT_Postscript, minMemType1 ),
+        FT_FRAME_ULONG( TT_Postscript, maxMemType1 ),
+      FT_FRAME_END
+    };
+
 
     FT_TRACE2(( "PostScript " ));
 
     error = face->goto_table( face, TTAG_post, stream, 0 );
-    if (error)
+    if ( error )
       return TT_Err_Post_Table_Missing;
 
-    if ( READ_Fields( post_fields, post ) ) return error;
+    if ( READ_Fields( post_fields, post ) )
+      return error;
 
     /* we don't load the glyph names, we do that in another */
     /* module (ttpost).                                     */
@@ -1246,50 +1324,57 @@
   TT_Error  TT_Load_PCLT( TT_Face    face,
                           FT_Stream  stream )
   {
-    static const FT_Frame_Field  pclt_fields[] = {
-	               FT_FRAME_START( 20 ),
-				      FT_FRAME_ULONG ( TT_PCLT, Version ),
-					  FT_FRAME_ULONG ( TT_PCLT, FontNumber ),
-					  FT_FRAME_USHORT( TT_PCLT, Pitch ),
-					  FT_FRAME_USHORT( TT_PCLT, xHeight ),
-					  FT_FRAME_USHORT( TT_PCLT, Style ),
-					  FT_FRAME_USHORT( TT_PCLT, TypeFamily ),
-					  FT_FRAME_USHORT( TT_PCLT, CapHeight ),
-				   FT_FRAME_END };
+    static const FT_Frame_Field  pclt_fields[] =
+    {
+      FT_FRAME_START( 20 ),
+        FT_FRAME_ULONG ( TT_PCLT, Version ),
+        FT_FRAME_ULONG ( TT_PCLT, FontNumber ),
+        FT_FRAME_USHORT( TT_PCLT, Pitch ),
+        FT_FRAME_USHORT( TT_PCLT, xHeight ),
+        FT_FRAME_USHORT( TT_PCLT, Style ),
+        FT_FRAME_USHORT( TT_PCLT, TypeFamily ),
+        FT_FRAME_USHORT( TT_PCLT, CapHeight ),
+      FT_FRAME_END
+    };
   
-    static const FT_Frame_Field  pclt_fields2[] = {
-	               FT_FRAME_START( 4 ),
-				     FT_FRAME_CHAR( TT_PCLT, StrokeWeight ),
-					 FT_FRAME_CHAR( TT_PCLT, WidthType ),
-					 FT_FRAME_BYTE( TT_PCLT, SerifStyle ),
-					 FT_FRAME_BYTE( TT_PCLT, Reserved ),
-	               FT_FRAME_END };
+    static const FT_Frame_Field  pclt_fields2[] =
+    {
+      FT_FRAME_START( 4 ),
+        FT_FRAME_CHAR( TT_PCLT, StrokeWeight ),
+        FT_FRAME_CHAR( TT_PCLT, WidthType ),
+        FT_FRAME_BYTE( TT_PCLT, SerifStyle ),
+        FT_FRAME_BYTE( TT_PCLT, Reserved ),
+      FT_FRAME_END
+    };
   
-    TT_Error    error;
-	TT_PCLT*    pclt = &face->pclt;
-	
+    TT_Error  error;
+    TT_PCLT*  pclt = &face->pclt;
+
+    
     FT_TRACE2(( "PCLT " ));
 
-	/* optional table */
-	error = face->goto_table( face, TTAG_PCLT, stream, 0 );
-	if (error)
-	{
-	  FT_TRACE2(( "missing (optional)\n" ));
-	  pclt->Version = 0;
-	  return 0;
-	}
-	
-	if ( READ_Fields( pclt_fields, pclt )            ||
-	     FILE_Read  ( pclt->TypeFace, 16 )           ||
-		 FILE_Read  ( pclt->CharacterComplement, 8 ) ||
-		 FILE_Read  ( pclt->FileName, 6 )            ||
-		 READ_Fields( pclt_fields2, pclt )           )
+    /* optional table */
+    error = face->goto_table( face, TTAG_PCLT, stream, 0 );
+    if ( error )
+    {
+      FT_TRACE2(( "missing (optional)\n" ));
+      pclt->Version = 0;
+      return TT_Err_Ok;
+    }
+    
+    if ( READ_Fields( pclt_fields, pclt )            ||
+         FILE_Read  ( pclt->TypeFace, 16 )           ||
+         FILE_Read  ( pclt->CharacterComplement, 8 ) ||
+         FILE_Read  ( pclt->FileName, 6 )            ||
+         READ_Fields( pclt_fields2, pclt )           )
       goto Exit;
-	
-	FT_TRACE2(( "loaded\n" ));
-  Exit:	
-	return error;
-  }						  
+    
+    FT_TRACE2(( "loaded\n" ));
+
+  Exit:    
+    return error;
+  }
+
 
   /*************************************************************************/
   /*                                                                       */
@@ -1317,11 +1402,12 @@
     TT_GaspRange*  gaspranges;
 
 
-    FT_TRACE2(( "TT_Load_Gasp( %08p )\n", face ));
+    FT_TRACE2(( "TT_Load_Gasp: %08p\n", face ));
 
     /* the gasp table is optional */
     error = face->goto_table( face, TTAG_gasp, stream, 0 );
-    if (error) return TT_Err_Ok;
+    if ( error )
+      return TT_Err_Ok;
 
     if ( ACCESS_Frame( 4L ) )
       goto Exit;
@@ -1335,7 +1421,7 @@
     FT_TRACE3(( "number of ranges = %d\n", num_ranges ));
 
     if ( ALLOC_ARRAY( gaspranges, num_ranges, TT_GaspRange ) ||
-         ACCESS_Frame( num_ranges * 4L ) )
+         ACCESS_Frame( num_ranges * 4L )                     )
       goto Exit;
 
     face->gasp.gaspRanges = gaspranges;
@@ -1346,8 +1432,8 @@
       gaspranges[j].gaspFlag = GET_UShort();
 
       FT_TRACE3(( " [max:%d flag:%d]",
-                gaspranges[j].maxPPEM,
-                gaspranges[j].gaspFlag ));
+                    gaspranges[j].maxPPEM,
+                    gaspranges[j].gaspFlag ));
     }
     FT_TRACE3(( "\n" ));
 
@@ -1386,11 +1472,14 @@
 
     TT_UInt    n, num_tables, version;
 
-    /* the kern table is optional. exit silently if it's missing */
+
+    /* the kern table is optional. exit silently if it is missing */
     error = face->goto_table( face, TTAG_kern, stream, 0 );
-    if ( error ) return TT_Err_Ok;
+    if ( error )
+      return TT_Err_Ok;
 
-    if ( ACCESS_Frame( 4L ) ) goto Exit;
+    if ( ACCESS_Frame( 4L ) )
+      goto Exit;
 
     version    = GET_UShort();
     num_tables = GET_UShort();
@@ -1402,7 +1491,9 @@
       TT_UInt  coverage;
       TT_UInt  length;
 
-      if ( ACCESS_Frame( 6L ) ) goto Exit;
+
+      if ( ACCESS_Frame( 6L ) )
+        goto Exit;
 
       version  = GET_UShort();      /* version                 */
       length   = GET_UShort() - 6;  /* substract header length */
@@ -1416,11 +1507,13 @@
         TT_Kern_0_Pair*  pair;
         TT_Kern_0_Pair*  limit;
 
-        /* found a horizontal format 0 kerning table ! */
-        if ( ACCESS_Frame(8L) )
+
+        /* found a horizontal format 0 kerning table! */
+        if ( ACCESS_Frame( 8L ) )
           goto Exit;
 
         num_pairs = GET_UShort();
+
         /* skip the rest */
 
         FORGET_Frame();
@@ -1482,9 +1575,10 @@
     TT_Error  error;
     FT_Memory memory = stream->memory;
 
-    TT_Hdmx*     hdmx = &face->hdmx;
-    TT_Long      num_glyphs;
-    TT_Long      record_size;
+    TT_Hdmx*  hdmx = &face->hdmx;
+    TT_Long   num_glyphs;
+    TT_Long   record_size;
+
 
     hdmx->version     = 0;
     hdmx->num_records = 0;
@@ -1492,9 +1586,11 @@
 
     /* this table is optional */
     error = face->goto_table( face, TTAG_hdmx, stream, 0 );
-    if (error) return TT_Err_Ok;
+    if ( error )
+      return TT_Err_Ok;
 
-    if ( ACCESS_Frame( 8L ) ) goto Exit;
+    if ( ACCESS_Frame( 8L ) )
+      goto Exit;
 
     hdmx->version     = GET_UShort();
     hdmx->num_records = GET_Short();
@@ -1516,6 +1612,7 @@
       TT_HdmxRec*  cur   = hdmx->records;
       TT_HdmxRec*  limit = cur + hdmx->num_records;
 
+
       for ( ; cur < limit; cur++ )
       {
         /* read record */
@@ -1523,12 +1620,12 @@
              READ_Byte( cur->max_width ) )
           goto Exit;
 
-        if ( ALLOC( cur->widths, num_glyphs )  ||
+        if ( ALLOC( cur->widths, num_glyphs )     ||
              FILE_Read( cur->widths, num_glyphs ) )
           goto Exit;
 
         /* skip padding bytes */
-        if ( record_size > 0 && FILE_Skip(record_size) )
+        if ( record_size > 0 && FILE_Skip( record_size ) )
             goto Exit;
       }
     }
@@ -1557,6 +1654,7 @@
       TT_Int     n;
       FT_Memory  memory = face->root.driver->memory;
 
+
       for ( n = 0; n < face->hdmx.num_records; n++ )
         FREE( face->hdmx.records[n].widths );
 
diff --git a/src/sfnt/ttload.h b/src/sfnt/ttload.h
index 37efb41..02bf369 100644
--- a/src/sfnt/ttload.h
+++ b/src/sfnt/ttload.h
@@ -5,11 +5,11 @@
 /*    Load the basic TrueType tables, i.e., tables that can be either in   */
 /*    TTF or OTF font (specification).                                     */
 /*                                                                         */
-/*  Copyright 1996-1999 by                                                 */
+/*  Copyright 1996-2000 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
-/*  This file is part of the FreeType project, and may only be used        */
-/*  modified and distributed under the terms of the FreeType project       */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
 /*  this file you indicate that you have read the license and              */
 /*  understand and accept it fully.                                        */
@@ -23,9 +23,10 @@
 
 #include <freetype/internal/ftstream.h>
 #include <freetype/internal/tttypes.h>
-/*
+
+#if 0
 #include <ttobjs.h>
-*/
+#endif
 
 #ifdef __cplusplus
   extern "C" {
@@ -37,17 +38,17 @@
                               TT_ULong  tag );
 
   LOCAL_DEF
-  TT_Error   TT_Goto_Table( TT_Face    face,
-                            TT_ULong   tag,
-                            FT_Stream  stream,
-                            TT_ULong  *length );
+  TT_Error  TT_Goto_Table( TT_Face    face,
+                           TT_ULong   tag,
+                           FT_Stream  stream,
+                           TT_ULong*  length );
 
 
   LOCAL_DEF
-  TT_Error   TT_Load_SFNT_Header( TT_Face       face,
-                                  FT_Stream     stream,
-                                  TT_Long       face_index,
-                                  SFNT_Header*  sfnt );
+  TT_Error  TT_Load_SFNT_Header( TT_Face       face,
+                                 FT_Stream     stream,
+                                 TT_Long       face_index,
+                                 SFNT_Header*  sfnt );
   LOCAL_DEF
   TT_Error  TT_Load_Directory( TT_Face       face,
                                FT_Stream     stream,