Commit deb4e9839608a996ff7bb54fcddba93ff1ec0544

Werner Lemberg 2000-06-29T03:14:25

Formatting... Preprocessor lines now always start the line. Improved error handling in `base' module. Fixed a out-of-bounds error in ttgload.

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
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h
index a15bab4..a1ed6c2 100644
--- a/include/freetype/internal/ftobjs.h
+++ b/include/freetype/internal/ftobjs.h
@@ -106,25 +106,25 @@
   } FT_ModuleRec;
 
   /* typecast an object to a FT_Module */
-  #define  FT_MODULE(x)          ((FT_Module)(x))
-  #define  FT_MODULE_CLASS(x)    FT_MODULE(x)->clazz
-  #define  FT_MODULE_LIBRARY(x)  FT_MODULE(x)->library
-  #define  FT_MODULE_MEMORY(x)   FT_MODULE(x)->memory
+#define  FT_MODULE(x)          ((FT_Module)(x))
+#define  FT_MODULE_CLASS(x)    FT_MODULE(x)->clazz
+#define  FT_MODULE_LIBRARY(x)  FT_MODULE(x)->library
+#define  FT_MODULE_MEMORY(x)   FT_MODULE(x)->memory
 
-  #define  FT_MODULE_IS_DRIVER(x)  (FT_MODULE_CLASS(x)->module_flags & \
-                                        ft_module_font_driver )
+#define  FT_MODULE_IS_DRIVER(x)  (FT_MODULE_CLASS(x)->module_flags & \
+                                   ft_module_font_driver )
 
-  #define  FT_MODULE_IS_DRIVER(x)  (FT_MODULE_CLASS(x)->module_flags & \
-                                        ft_module_font_driver )
+#define  FT_MODULE_IS_DRIVER(x)  (FT_MODULE_CLASS(x)->module_flags & \
+                                   ft_module_font_driver )
 
-  #define  FT_MODULE_IS_RENDERER(x)  (FT_MODULE_CLASS(x)->module_flags & \
-                                        ft_module_renderer )
+#define  FT_MODULE_IS_RENDERER(x)  (FT_MODULE_CLASS(x)->module_flags & \
+                                     ft_module_renderer )
 
-  #define  FT_DRIVER_IS_SCALABLE(x)  (FT_MODULE_CLASS(x)->module_flags & \
-                                        ft_module_driver_scalable )
+#define  FT_DRIVER_IS_SCALABLE(x)  (FT_MODULE_CLASS(x)->module_flags & \
+                                     ft_module_driver_scalable )
 
-  #define  FT_DRIVER_USES_OUTLINES(x)  !(FT_MODULE_CLASS(x)->module_flags & \
-                                         ft_module_driver_no_outlines )
+#define  FT_DRIVER_USES_OUTLINES(x)  !(FT_MODULE_CLASS(x)->module_flags & \
+                                       ft_module_driver_no_outlines )
 
 
   /*************************************************************************/
@@ -141,19 +141,19 @@
 
   /* a few macros used to perform easy typecasts with minimal brain damage */
 
-  #define  FT_FACE(x)  ((FT_Face)x)
-  #define  FT_SIZE(x)  ((FT_Size)x)
-  #define  FT_SLOT(x)  ((FT_GlyphSlot)x)
+#define  FT_FACE(x)  ((FT_Face)x)
+#define  FT_SIZE(x)  ((FT_Size)x)
+#define  FT_SLOT(x)  ((FT_GlyphSlot)x)
   
-  #define  FT_FACE_DRIVER(x)   FT_FACE(x)->driver
-  #define  FT_FACE_LIBRARY(x)  FT_FACE_DRIVER(x)->root.library
-  #define  FT_FACE_MEMORY(x)   FT_FACE(x)->memory
+#define  FT_FACE_DRIVER(x)   FT_FACE(x)->driver
+#define  FT_FACE_LIBRARY(x)  FT_FACE_DRIVER(x)->root.library
+#define  FT_FACE_MEMORY(x)   FT_FACE(x)->memory
 
-  #define  FT_SIZE_FACE(x)  FT_SIZE(x)->face
-  #define  FT_SLOT_FACE(x)  FT_SLOT(x)->face
+#define  FT_SIZE_FACE(x)  FT_SIZE(x)->face
+#define  FT_SLOT_FACE(x)  FT_SLOT(x)->face
 
-  #define  FT_FACE_SLOT(x)  FT_FACE(x)->glyph
-  #define  FT_FACE_SIZE(x)  FT_FACE(x)->size
+#define  FT_FACE_SLOT(x)  FT_FACE(x)->glyph
+#define  FT_FACE_SIZE(x)  FT_FACE(x)->size
 
 
   /* this must be kept exported - this will be used later in our own */
@@ -248,7 +248,7 @@
   /*************************************************************************/
   /*************************************************************************/
 
-  #define FT_RENDERER(x)  ((FT_Renderer)(x))
+#define FT_RENDERER(x)  ((FT_Renderer)(x))
 
   typedef struct FT_RendererRec_
   {
@@ -275,10 +275,10 @@
   /*************************************************************************/
 
   /* typecast a module into a driver easily */
-  #define FT_DRIVER(x)  ((FT_Driver)(x))
+#define FT_DRIVER(x)  ((FT_Driver)(x))
 
   /* typecast a module as a driver, and get its driver class */
-  #define FT_DRIVER_CLASS(x)  FT_DRIVER(x)->clazz
+#define FT_DRIVER_CLASS(x)  FT_DRIVER(x)->clazz
 
   /*************************************************************************/
   /*                                                                       */
diff --git a/include/freetype/internal/t2types.h b/include/freetype/internal/t2types.h
index 2b01589..39608a0 100644
--- a/include/freetype/internal/t2types.h
+++ b/include/freetype/internal/t2types.h
@@ -175,8 +175,8 @@
   } CFF_SubFont;
 
 
- /* maximum number of sub-fonts in a CID-keyed file */
-  #define CFF_MAX_CID_FONTS  16
+  /* maximum number of sub-fonts in a CID-keyed file */
+#define CFF_MAX_CID_FONTS  16
   
   typedef struct CFF_Font_
   {
diff --git a/include/freetype/t1tables.h b/include/freetype/t1tables.h
index 479c2d5..77feb9d 100644
--- a/include/freetype/t1tables.h
+++ b/include/freetype/t1tables.h
@@ -140,13 +140,13 @@
   } T1_Blend_Flags;
 
   /* maximum number of multiple-masters designs, per-se the spec */
-  #define T1_MAX_MM_DESIGNS      16
+#define T1_MAX_MM_DESIGNS      16
   
   /* maximum number of multiple-masters axis, per-se the spec */
-  #define T1_MAX_MM_AXIS         4
+#define T1_MAX_MM_AXIS         4
 
   /* maximum number of elements in a design map */
-  #define T1_MAX_MM_MAP_POINTS   20
+#define T1_MAX_MM_MAP_POINTS   20
 
   /* this structure is used to store the BlendDesignMap entry for an axis */
   typedef struct T1_DesignMap_
diff --git a/src/base/ftcalc.c b/src/base/ftcalc.c
index e0fdb74..4d8bae6 100644
--- a/src/base/ftcalc.c
+++ b/src/base/ftcalc.c
@@ -50,19 +50,19 @@
 
   static const FT_Long  ft_square_roots[63] =
   {
-       1,    1,    2,     3,     4,     5,     8,    11,
-      16,   22,   32,    45,    64,    90,   128,   181,
-     256,  362,  512,   724,  1024,  1448,  2048,  2896,
-    4096, 5892, 8192, 11585, 16384, 23170, 32768, 46340,
-
-      65536,   92681,  131072,   185363,   262144,   370727,
-     524288,  741455, 1048576,  1482910,  2097152,  2965820,
-    4194304, 5931641, 8388608, 11863283, 16777216, 23726566,
-
-      33554432,   47453132,   67108864,   94906265,
-     134217728,  189812531,  268435456,  379625062,
-     536870912,  759250125, 1073741824, 1518500250,
-    2147483647
+       1L,    1L,    2L,     3L,     4L,     5L,     8L,    11L,
+      16L,   22L,   32L,    45L,    64L,    90L,   128L,   181L,
+     256L,  362L,  512L,   724L,  1024L,  1448L,  2048L,  2896L,
+    4096L, 5892L, 8192L, 11585L, 16384L, 23170L, 32768L, 46340L,
+
+      65536L,   92681L,  131072L,   185363L,   262144L,   370727L,
+     524288L,  741455L, 1048576L,  1482910L,  2097152L,  2965820L,
+    4194304L, 5931641L, 8388608L, 11863283L, 16777216L, 23726566L,
+
+      33554432L,   47453132L,   67108864L,   94906265L,
+     134217728L,  189812531L,  268435456L,  379625062L,
+     536870912L,  759250125L, 1073741824L, 1518500250L,
+    2147483647L
   };
 
 #else
@@ -102,8 +102,8 @@
 
       root >>= 1;
       mask >>= 2;
-    }
-    while ( mask != 0 );
+
+    } while ( mask != 0 );
 
     return root;
   }
@@ -289,8 +289,8 @@
     {
       s = r;
       r = ( r + l / r ) >> 1;
-    }
-    while ( r > s || r * r > l );
+
+    } while ( r > s || r * r > l );
 
     return r;
   }
@@ -487,14 +487,14 @@
     }
     else
     {
-      /* we need more bits, we'll have to do it by hand */
+      /* we need more bits; we have to do it by hand */
       FT_Word32  c;
 
 
       q  = ( a / b ) << 16;
       c  = a % b;
 
-      /* we must compute C*0x10000/B; we simply shift C and B so */
+      /* we must compute C*0x10000/B: we simply shift C and B so */
       /* C becomes smaller than 16 bits                          */
       while ( c >> 16 )
       {
@@ -601,7 +601,7 @@
     if ( s < 0 )
     {
       z->lo = (FT_Word32)-(FT_Int32)z->lo;
-      z->hi = ~z->hi + !(z->lo);
+      z->hi = ~z->hi + !( z->lo );
     }
   }
 
@@ -636,7 +636,7 @@
     if ( s < 0 )
     {
       x->lo = (FT_Word32)-(FT_Int32)x->lo;
-      x->hi = ~x->hi + !(x->lo);
+      x->hi = ~x->hi + !( x->lo );
     }
     s ^= y;  y = ABS( y );
 
@@ -759,8 +759,8 @@
       r = ( r + FT_Div64by32( l, r ) ) >> 1;
       FT_MulTo64( r, r,   &l2 );
       FT_Sub64  ( l, &l2, &l2 );
-    }
-    while ( r > s || (FT_Int32)l2.hi < 0 );
+
+    } while ( r > s || (FT_Int32)l2.hi < 0 );
 
     return r;
   }
diff --git a/src/base/ftdebug.c b/src/base/ftdebug.c
index 72c44a3..32da789 100644
--- a/src/base/ftdebug.c
+++ b/src/base/ftdebug.c
@@ -103,7 +103,7 @@
     if ( component >= trace_max )
       return;
 
-    /* if component is `trace_any', then change _all_ levels at once */
+    /* if component is `trace_any', change _all_ levels at once */
     if ( component == trace_any )
     {
       int  n;
diff --git a/src/base/ftextend.c b/src/base/ftextend.c
index 0ac9501..782bb3e 100644
--- a/src/base/ftextend.c
+++ b/src/base/ftextend.c
@@ -152,7 +152,8 @@
       cur->offset  = registry->cur_offset;
 
       registry->num_extensions++;
-      registry->cur_offset += ( cur->size + FT_ALIGNMENT-1 ) & -FT_ALIGNMENT;
+      registry->cur_offset +=
+        ( cur->size + FT_ALIGNMENT - 1 ) & -FT_ALIGNMENT;
 
       FT_TRACE1(( "FT_Register_Extension: `%s' successfully registered\n",
                   cur->id ));
@@ -180,12 +181,12 @@
   /*                           extension interface.                        */
   /*                                                                       */
   /* <Return>                                                              */
-  /*    A pointer to the extension block.                                  */
+  /*    A generic pointer to the extension block.                          */
   /*                                                                       */
   FT_EXPORT_FUNC( void* )  FT_Get_Extension(
                              FT_Face      face,
                              const char*  extension_id,
-                             void*       *extension_interface )
+                             void**       extension_interface )
   {
     FT_Extension_Registry*  registry;
 
@@ -296,7 +297,7 @@
 
     face->extensions = 0;
 
-    /* load extensions registry, exit successfully if none is there */
+    /* load extensions registry; exit successfully if none is there */
 
     registry = (FT_Extension_Registry*)face->driver->extensions;
     if ( !registry )
diff --git a/src/base/ftglyph.c b/src/base/ftglyph.c
index 472143c..7d9f443 100644
--- a/src/base/ftglyph.c
+++ b/src/base/ftglyph.c
@@ -42,6 +42,7 @@
 #define FT_COMPONENT  trace_glyph
 
 
+  /* a helper function to avoid duplication of code */
   static
   void  ft_prepare_glyph( FT_Glyph  glyph,
                           FT_Face   face,
@@ -122,13 +123,13 @@
                                 FT_Vector*       origin,
                                 FT_BitmapGlyph*  abitglyph )
   {
-    FT_Error         error;
-    FT_Memory        memory;
+    FT_Error        error;
+    FT_Memory       memory;
 
-    FT_BitmapGlyph   bitglyph;
-    FT_Glyph         glyph;
-    FT_Pos           origin_x = 0;
-    FT_Pos           origin_y = 0;
+    FT_BitmapGlyph  bitglyph;
+    FT_Glyph        glyph;
+    FT_Pos          origin_x = 0;
+    FT_Pos          origin_y = 0;
 
 
     if ( !face )
@@ -171,6 +172,7 @@
 
     /* now, handle bitmap and outline glyph images */
     memory = face->memory;
+
     switch ( face->glyph->format )
     {
     case ft_glyph_format_bitmap:
@@ -230,7 +232,7 @@
         else
           pitch = ( width + 7 ) >> 3;
 
-        size  = pitch * height;
+        size = pitch * height;
         if ( ALLOC( bitglyph, sizeof ( *bitglyph ) ) )
           goto Exit;
 
@@ -318,7 +320,7 @@
     FT_OutlineGlyph  glyph;
 
 
-    /* test for valid face delayed to FT_Load_Glyph() */
+    /* test for valid `face' delayed to FT_Load_Glyph() */
 
     if ( !vecglyph )
       return FT_Err_Invalid_Argument;
@@ -529,7 +531,7 @@
       v = d;
     }
 
-    /* check that we're not trying to normalize zero! */
+    /* check that we are not trying to normalize zero! */
     if ( u == 0 )
       return 0;
 
@@ -630,8 +632,8 @@
 
   /* Compute the orientation of path filling.  It differs between TrueType */
   /* and Type1 formats.  We could use the `ft_outline_reverse_fill' flag,  */
-  /* but it's better to re-compute it directly (it seems that this flag    */
-  /* isn't correctly set for some weird composite glyphs for now).         */
+  /* but it is better to re-compute it directly (it seems that this flag   */
+  /* isn't correctly set for some weird composite glyphs currently).       */
   /*                                                                       */
   /* We do this by computing bounding box points, and computing their      */
   /* curvature.                                                            */
@@ -645,6 +647,7 @@
     FT_BBox  indices;
     int      n, last;
 
+
     indices.xMin = -1;
     indices.yMin = -1;
     indices.xMax = -1;
@@ -756,7 +759,7 @@
 
         d = distance;
 
-        if ( (outline->flags[n] & FT_Curve_Tag_On) == 0 )
+        if ( ( outline->flags[n] & FT_Curve_Tag_On ) == 0 )
           d *= 2;
 
         /* Check discriminant for parallel vectors */
@@ -781,6 +784,7 @@
           /* Vectors are nearly parallel */
           FT_Pos  x, y;
 
+
           x = distance + cur.x + FT_MulFix( d, u.x + v.x ) / 2;
           y = distance + cur.y + FT_MulFix( d, u.y + v.y ) / 2;
 
diff --git a/src/base/ftinit.c b/src/base/ftinit.c
index 1a6e440..702f2c9 100644
--- a/src/base/ftinit.c
+++ b/src/base/ftinit.c
@@ -84,7 +84,8 @@ const FT_Module_Class*  ft_default_modules[] =
     FT_Error                 error;
     const FT_Module_Class**  cur;
 
-    /* test for valid library delayed to FT_Add_Module() */
+
+    /* test for valid `library' delayed to FT_Add_Module() */
 
     cur = ft_default_modules;
     while ( *cur )
@@ -114,7 +115,7 @@ const FT_Module_Class*  ft_default_modules[] =
   /*    library :: A handle to a new library object.                       */
   /*                                                                       */
   /* <Return>                                                              */
-  /*    FreeTyoe error code.  0 means success.                             */
+  /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
   FT_EXPORT_FUNC( FT_Error )  FT_Init_FreeType( FT_Library*  library )
   {
@@ -128,13 +129,12 @@ const FT_Module_Class*  ft_default_modules[] =
     memory = FT_New_Memory();
     if ( !memory )
     {
-      FT_ERROR(( "FT_Init_FreeType:" ));
-      FT_ERROR(( " cannot find memory manager\n" ));
+      FT_ERROR(( "FT_Init_FreeType: cannot find memory manager\n" ));
       return FT_Err_Unimplemented_Feature;
     }
 
-    /* builds a library out of it, then fill it with the set of */
-    /* default drivers.                                         */
+    /* build a library out of it, then fill it with the set of */
+    /* default drivers.                                        */
 
     error = FT_New_Library( memory, library );
     if ( !error )
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index aa12993..e4b7271 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -201,6 +201,7 @@
     }
   }
 
+
   /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
@@ -224,6 +225,7 @@
   /*                                                                       */
   /* <Note>                                                                */
   /*    The function expects a valid `astream' parameter.                  */
+  /*                                                                       */
   static
   FT_Error  ft_new_input_stream( FT_Library     library,
                                  FT_Open_Args*  args,
@@ -315,6 +317,7 @@
 #undef  FT_COMPONENT
 #define FT_COMPONENT  trace_objs
 
+
   /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
@@ -416,14 +419,15 @@
       FT_Memory memory = loader->memory;
 
 
-      FT_GlyphLoader_Reset(loader);
+      FT_GlyphLoader_Reset( loader );
       FREE( loader );
     }
   }
 
 
   /* re-adjust the `current' outline fields */
-  static void  FT_GlyphLoader_Adjust_Points( FT_GlyphLoader*  loader )
+  static
+  void  FT_GlyphLoader_Adjust_Points( FT_GlyphLoader*  loader )
   {
     FT_Outline*  base    = &loader->base.outline;
     FT_Outline*  current = &loader->current.outline;
@@ -432,7 +436,7 @@
     current->points   = base->points   + base->n_points;
     current->tags     = base->tags     + base->n_points;
     current->contours = base->contours + base->n_contours;
-    
+
     /* handle extra points table - if any */
     if ( loader->use_extra )
       loader->current.extra_points =
@@ -440,13 +444,13 @@
   }
 
 
-
-  BASE_FUNC(FT_Error)  FT_GlyphLoader_Create_Extra( FT_GlyphLoader*  loader )
+  BASE_FUNC( FT_Error )  FT_GlyphLoader_Create_Extra(
+                           FT_GlyphLoader*  loader )
   {
     FT_Error   error;
     FT_Memory  memory = loader->memory;
 
-    
+
     if ( !ALLOC_ARRAY( loader->base.extra_points,
                        loader->max_points, FT_Vector ) )
     {
@@ -458,7 +462,8 @@
 
 
   /* re-adjust the `current' subglyphs field */
-  static void  FT_GlyphLoader_Adjust_Subglyphs( FT_GlyphLoader*  loader )
+  static
+  void  FT_GlyphLoader_Adjust_Subglyphs( FT_GlyphLoader*  loader )
   {
     FT_GlyphLoad* base    = &loader->base;
     FT_GlyphLoad* current = &loader->current;
@@ -471,6 +476,7 @@
   /* Ensure that we can add `n_points' and `n_contours' to our glyph. this */
   /* function reallocates its outline tables if necessary.  Note that it   */
   /* DOESN'T change the number of points within the loader!                */
+  /*                                                                       */
   BASE_FUNC( FT_Error ) FT_GlyphLoader_Check_Points(
                           FT_GlyphLoader*  loader,
                           FT_UInt          n_points,
@@ -482,7 +488,7 @@
     FT_Outline*  current = &loader->current.outline;
     FT_Bool      adjust  = 1;
 
-    FT_UInt  new_max;
+    FT_UInt      new_max;
 
 
     /* check points & tags */
@@ -530,6 +536,7 @@
   /* Ensure that we can add `n_subglyphs' to our glyph. this function */
   /* reallocates its subglyphs table if necessary.  Note that it DOES */
   /* NOT change the number of subglyphs within the loader!            */
+  /*                                                                  */
   BASE_FUNC( FT_Error )  FT_GlyphLoader_Check_Subglyphs(
                            FT_GlyphLoader*  loader,
                            FT_UInt          n_subs )
@@ -599,42 +606,41 @@
   }
 
 
-  BASE_FUNC( FT_Error )   FT_GlyphLoader_Copy_Points(
-                            FT_GlyphLoader*  target,
-                            FT_GlyphLoader*  source )
+  BASE_FUNC( FT_Error )  FT_GlyphLoader_Copy_Points( FT_GlyphLoader*  target,
+                                                     FT_GlyphLoader*  source )
   {
     FT_Error  error;
     FT_UInt   num_points   = source->base.outline.n_points;
     FT_UInt   num_contours = source->base.outline.n_contours;
 
-    
+
     error = FT_GlyphLoader_Check_Points( target, num_points, num_contours );
     if ( !error )
     {
       FT_Outline*  out = &target->base.outline;
       FT_Outline*  in  = &source->base.outline;
 
-      
+
       MEM_Copy( out->points, in->points,
                 num_points * sizeof ( FT_Vector ) );
       MEM_Copy( out->tags, in->tags,
                 num_points * sizeof ( char ) );
       MEM_Copy( out->contours, in->contours,
                 num_contours * sizeof ( short ) );
-      
+
       /* do we need to copy the extra points? */
       if ( target->use_extra && source->use_extra )
         MEM_Copy( target->base.extra_points, source->base.extra_points,
                   num_points * sizeof ( FT_Vector ) );
-                  
+
       out->n_points   = num_points;
       out->n_contours = num_contours;
-      
+
       FT_GlyphLoader_Adjust_Points( target );
     }
 
-    return error;                                         
-  }                                           
+    return error;
+  }
 
 
   /*************************************************************************/
@@ -649,7 +655,9 @@
   /*************************************************************************/
   /*************************************************************************/
 
-  static  FT_Error  ft_glyphslot_init( FT_GlyphSlot  slot )
+
+  static
+  FT_Error  ft_glyphslot_init( FT_GlyphSlot  slot )
   {
     FT_Driver         driver = slot->face->driver;
     FT_Driver_Class*  clazz  = driver->clazz;
@@ -667,9 +675,11 @@
   }
 
 
-  static void  ft_glyphslot_clear( FT_GlyphSlot  slot )
+  static
+  void  ft_glyphslot_clear( FT_GlyphSlot  slot )
   {
     /* clear all public fields in the glyph slot */
+
     MEM_Set( &slot->metrics, 0, sizeof ( slot->metrics ) );
     MEM_Set( &slot->outline, 0, sizeof ( slot->outline ) );
     MEM_Set( &slot->bitmap,  0, sizeof ( slot->bitmap )  );
@@ -688,7 +698,8 @@
   }
 
 
-  static void  ft_glyphslot_done( FT_GlyphSlot  slot )
+  static
+  void  ft_glyphslot_done( FT_GlyphSlot  slot )
   {
     FT_Driver         driver = slot->face->driver;
     FT_Driver_Class*  clazz  = driver->clazz;
@@ -741,11 +752,11 @@
     FT_GlyphSlot      slot;
 
 
-    *aslot = 0;
-
     if ( !face || !aslot || !face->driver )
       return FT_Err_Invalid_Argument;
 
+    *aslot = 0;
+
     driver = face->driver;
     clazz  = driver->clazz;
     memory = driver->root.memory;
@@ -814,10 +825,6 @@
   }
 
 
-  /* forward declaration */
-  static FT_Renderer  ft_lookup_glyph_renderer( FT_GlyphSlot  slot );
-
-
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
@@ -852,8 +859,8 @@
     if ( !matrix )
     {
       face->transform_matrix.xx = 0x10000L;
-      face->transform_matrix.xy = 0L;
-      face->transform_matrix.yx = 0L;
+      face->transform_matrix.xy = 0;
+      face->transform_matrix.yx = 0;
       face->transform_matrix.yy = 0x10000L;
       matrix = &face->transform_matrix;
     }
@@ -881,8 +888,9 @@
   }
 
 
-  static  FT_Renderer  ft_lookup_glyph_renderer( FT_GlyphSlot  slot );
-  
+  static FT_Renderer  ft_lookup_glyph_renderer( FT_GlyphSlot  slot );
+
+
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
@@ -964,17 +972,17 @@
     {
       /* get renderer */
       FT_Renderer  renderer = ft_lookup_glyph_renderer( slot );
-      
+
 
       if ( renderer )
         error = renderer->clazz->transform_glyph( renderer, slot,
                                                   &face->transform_matrix,
                                                   &face->transform_delta );
-      /* transform advance */                                            
-      FT_Vector_Transform( &slot->advance, &face->transform_matrix );                                                  
+      /* transform advance */
+      FT_Vector_Transform( &slot->advance, &face->transform_matrix );
     }
 
-  Exit:                                       
+  Exit:
     return error;
   }
 
@@ -1021,7 +1029,7 @@
                                             FT_ULong  char_code,
                                             FT_Int    load_flags )
   {
-    FT_UInt    glyph_index;
+    FT_UInt  glyph_index;
 
 
     if ( !face )
@@ -1092,14 +1100,15 @@
   }
 
 
-  static  void  Destroy_Driver( FT_Driver  driver )
+  static
+  void  Destroy_Driver( FT_Driver  driver )
   {
     FT_List_Finalize( &driver->faces_list,
                       (FT_List_Destructor)destroy_face,
                       driver->root.memory,
                       driver );
 
-    /* see if we need to drop the driver's glyph loader */
+    /* check whether we need to drop the driver's glyph loader */
     if ( FT_DRIVER_USES_OUTLINES( driver ) )
       FT_GlyphLoader_Done( driver->glyph_loader );
   }
@@ -1130,7 +1139,7 @@
     clazz  = driver->clazz;
     memory = driver->root.memory;
 
-    /* allocate the face object, and perform basic initialization */
+    /* allocate the face object and perform basic initialization */
     if ( ALLOC( face, clazz->face_object_size ) )
       goto Fail;
 
@@ -1257,11 +1266,11 @@
   /*    `*face'.  Its return value should be 0 if the resource is          */
   /*    recognized, or non-zero if not.                                    */
   /*                                                                       */
-  FT_EXPORT_FUNC( FT_Error )  FT_New_Memory_Face( FT_Library   library,
-                                                  void*        file_base,
-                                                  FT_Long      file_size,
-                                                  FT_Long      face_index,
-                                                  FT_Face*     face )
+  FT_EXPORT_FUNC( FT_Error )  FT_New_Memory_Face( FT_Library  library,
+                                                  void*       file_base,
+                                                  FT_Long     file_size,
+                                                  FT_Long     face_index,
+                                                  FT_Face*    face )
   {
     FT_Open_Args  args;
 
@@ -1341,12 +1350,13 @@
 
     /* create input stream */
     error = ft_new_input_stream( library, args, &stream );
-    if ( error ) goto Exit;
+    if ( error )
+      goto Exit;
 
     memory = library->memory;
 
     /* If the font driver is specified in the `args' structure, use */
-    /* it.  Otherwise, we'll scan the list of registered drivers.   */
+    /* it.  Otherwise, we scan the list of registered drivers.      */
     if ( args->flags & ft_open_driver && args->driver )
     {
       driver = FT_DRIVER( args->driver );
@@ -1390,6 +1400,7 @@
           FT_Int         num_params = 0;
           FT_Parameter*  params     = 0;
 
+
           driver = FT_DRIVER( cur[0] );
 
           if ( args->flags & ft_open_params )
@@ -1418,7 +1429,7 @@
   Success:
     FT_TRACE4(( "FT_New_Face: New face object, adding to list\n" ));
 
-    /* set the EXTERNAL_STREAM bit for FT_Done_Face */
+    /* set the FT_FACE_FLAG_EXTERNAL_STREAM bit for FT_Done_Face */
     if ( args->flags & ft_open_stream && args->stream )
       face->face_flags |= FT_FACE_FLAG_EXTERNAL_STREAM;
 
@@ -1437,9 +1448,11 @@
 
 
       FT_TRACE4(( "FT_Open_Face: Creating glyph slot\n" ));
+
       error = FT_New_GlyphSlot( face, &slot );
-      if ( error ) goto Fail;
-      
+      if ( error )
+        goto Fail;
+
       face->glyph = slot;
     }
 
@@ -1449,9 +1462,11 @@
 
 
       FT_TRACE4(( "FT_Open_Face: Creating size object\n" ));
+
       error = FT_New_Size( face, &size );
-      if ( error ) goto Fail;
-      
+      if ( error )
+        goto Fail;
+
       face->size = size;
     }
 
@@ -1472,6 +1487,7 @@
 
   Exit:
     FT_TRACE4(( "FT_Open_Face: Return %d\n", error ));
+
     return error;
   }
 
@@ -1552,8 +1568,8 @@
   /*    when invoking this function.  Most drivers simply do not implement */
   /*    file attachments.                                                  */
   /*                                                                       */
-  FT_EXPORT_FUNC( FT_Error )  FT_Attach_Stream( FT_Face       face,
-                                                FT_Open_Args* parameters )
+  FT_EXPORT_FUNC( FT_Error )  FT_Attach_Stream( FT_Face        face,
+                                                FT_Open_Args*  parameters )
   {
     FT_Stream  stream;
     FT_Error   error;
@@ -1620,7 +1636,7 @@
     {
       driver = face->driver;
       memory = driver->root.memory;
-  
+
       /* find face in driver's list */
       node = FT_List_Find( &driver->faces_list, face );
       if ( node )
@@ -1628,7 +1644,7 @@
         /* remove face object from the driver's list */
         FT_List_Remove( &driver->faces_list, node );
         FREE( node );
-  
+
         /* now destroy the object proper */
         destroy_face( memory, face, driver );
         error = FT_Err_Ok;
@@ -1667,11 +1683,11 @@
     FT_ListNode       node = 0;
 
 
-    *asize = 0;
-
     if ( !face || !asize || !face->driver )
       return FT_Err_Invalid_Handle;
 
+    *asize = 0;
+
     driver = face->driver;
     clazz  = driver->clazz;
     memory = face->memory;
@@ -1764,10 +1780,12 @@
   }
 
 
-  static void  ft_recompute_scaled_metrics( FT_Face           face,
-                                            FT_Size_Metrics*  metrics )
-  {                                              
+  static
+  void  ft_recompute_scaled_metrics( FT_Face           face,
+                                     FT_Size_Metrics*  metrics )
+  {
     /* Compute root ascender, descender, test height, and max_advance */
+
     metrics->ascender    = ( FT_MulFix( face->ascender,
                                         metrics->y_scale ) + 32 ) & -64;
 
@@ -1838,13 +1856,13 @@
 
     if ( !char_width )
       char_width = char_height;
-      
+
     else if ( !char_height )
       char_height = char_width;
 
     if ( !horz_resolution )
       horz_resolution = 72;
-      
+
     if ( !vert_resolution )
       vert_resolution = 72;
 
@@ -1853,15 +1871,17 @@
     memory = driver->root.memory;
 
     /* default processing -- this can be overridden by the driver */
-    if ( char_width  < 1 * 64 ) char_width  = 1 * 64;
-    if ( char_height < 1 * 64 ) char_height = 1 * 64;
+    if ( char_width  < 1 * 64 )
+      char_width  = 1 * 64;
+    if ( char_height < 1 * 64 )
+      char_height = 1 * 64;
 
     /* Compute pixel sizes in 26.6 units */
     dim_x = ( ( ( char_width  * horz_resolution ) / 72 ) + 32 ) & -64;
     dim_y = ( ( ( char_height * vert_resolution ) / 72 ) + 32 ) & -64;
 
-    metrics->x_ppem  = (FT_UShort)(dim_x >> 6);
-    metrics->y_ppem  = (FT_UShort)(dim_y >> 6);
+    metrics->x_ppem  = (FT_UShort)( dim_x >> 6 );
+    metrics->y_ppem  = (FT_UShort)( dim_y >> 6 );
 
     metrics->x_scale = 0x10000L;
     metrics->y_scale = 0x10000L;
@@ -1932,8 +1952,10 @@
     else if ( pixel_height == 0 )
       pixel_height = pixel_width;
 
-    if ( pixel_width  < 1 ) pixel_width  = 1;
-    if ( pixel_height < 1 ) pixel_height = 1;
+    if ( pixel_width  < 1 )
+      pixel_width  = 1;
+    if ( pixel_height < 1 )
+      pixel_height = 1;
 
     metrics->x_ppem = pixel_width;
     metrics->y_ppem = pixel_height;
@@ -2067,6 +2089,7 @@
         return 0;
       }
     }
+
     return FT_Err_Invalid_Argument;
   }
 
@@ -2088,8 +2111,8 @@
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
   /* <Note>                                                                */
-  /*    This function will return an error when the charmap is not part    */
-  /*    of the face (i.e., if it is not listed in the face->charmaps[]     */
+  /*    This function will return an error if the charmap is not part of   */
+  /*    the face (i.e., if it is not listed in the face->charmaps[]        */
   /*    table).                                                            */
   /*                                                                       */
   FT_EXPORT_FUNC( FT_Error )  FT_Set_Charmap( FT_Face     face,
@@ -2213,75 +2236,86 @@
   /*************************************************************************/
   /*************************************************************************/
 
- /* lookup a renderer by glyph format in the library's list */
-  BASE_FUNC(FT_Renderer)  FT_Lookup_Renderer( FT_Library       library,
-                                              FT_Glyph_Format  format,
-                                              FT_ListNode     *node )
+  /* lookup a renderer by glyph format in the library's list */
+  BASE_FUNC( FT_Renderer )  FT_Lookup_Renderer( FT_Library       library,
+                                                FT_Glyph_Format  format,
+                                                FT_ListNode*     node )
   {
-    FT_ListNode   cur    = library->renderers.head;
+    FT_ListNode   cur;
     FT_Renderer   result = 0;
 
-    
-    if (node)
+
+    if ( !library )
+      goto Exit;
+
+    cur = library->renderers.head;
+
+    if ( node )
     {
-      if (*node)
+      if ( *node )
         cur = (*node)->next;
       *node = 0;
     }
-      
+
     while ( cur )
     {
       FT_Renderer  renderer = FT_RENDERER( cur->data );
-      
+
 
       if ( renderer->glyph_format == format )
       {
         if ( node )
           *node = cur;
-        
+
         result = renderer;
         break;
       }
       cur = cur->next;
     }
 
+  Exit:
     return result;
   }
 
-  
-  static FT_Renderer  ft_lookup_glyph_renderer( FT_GlyphSlot  slot )
+
+  static
+  FT_Renderer  ft_lookup_glyph_renderer( FT_GlyphSlot  slot )
   {
-    FT_Face     face    = slot->face;
-    FT_Library  library = FT_FACE_LIBRARY( face );
-    FT_Renderer result  = library->cur_renderer;
+    FT_Face      face    = slot->face;
+    FT_Library   library = FT_FACE_LIBRARY( face );
+    FT_Renderer  result  = library->cur_renderer;
+
 
-    
     if ( !result || result->glyph_format != slot->format )
       result = FT_Lookup_Renderer( library, slot->format, 0 );
     
     return result;
   }
 
-  
-  static  void  ft_set_current_renderer( FT_Library  library )
+
+  static
+  void  ft_set_current_renderer( FT_Library  library )
   {
     FT_Renderer  renderer;
 
+
     renderer = FT_Lookup_Renderer( library, ft_glyph_format_outline, 0 );
     library->cur_renderer = renderer;
   }
 
 
-  static  FT_Error  ft_add_renderer( FT_Module  module )
+  static
+  FT_Error  ft_add_renderer( FT_Module  module )
   {
     FT_Library   library = module->library;
     FT_Memory    memory  = library->memory;
     FT_Error     error;
     FT_ListNode  node;
-    
+
+
     if ( ALLOC( node, sizeof ( *node ) ) )
       goto Exit;
-      
+
     {
       FT_Renderer         render = FT_RENDERER( module );
       FT_Renderer_Class*  clazz  = (FT_Renderer_Class*)module->clazz;
@@ -2289,7 +2323,7 @@
 
       render->clazz        = clazz;
       render->glyph_format = clazz->glyph_format;
-      
+
       /* allocate raster object if needed */
       if ( clazz->glyph_format == ft_glyph_format_outline &&
            clazz->raster_class->raster_new )
@@ -2297,11 +2331,11 @@
         error = clazz->raster_class->raster_new( memory, &render->raster );
         if ( error )
           goto Fail;
-        
+
         render->raster_render = clazz->raster_class->raster_render;
         render->render        = clazz->render_glyph;
-      }           
-      
+      }
+
       /* add to list */
       node->data = module;
       FT_List_Add( &library->renderers, node );
@@ -2315,10 +2349,11 @@
 
   Exit:
     return error;
-  }                                 
+  }
 
 
-  static void  ft_remove_renderer( FT_Module  module )
+  static
+  void  ft_remove_renderer( FT_Module  module )
   {
     FT_Library   library = module->library;
     FT_Memory    memory  = library->memory;
@@ -2329,16 +2364,16 @@
     if ( node )
     {
       FT_Renderer  render = FT_RENDERER( module );
-      
+
 
       /* release raster object, if any */
       if ( render->raster )
         render->clazz->raster_class->raster_done( render->raster );
-      
+
       /* remove from list */
       FT_List_Remove( &library->renderers, node );
       FREE( node );
-      
+
       ft_set_current_renderer( library );
     }
   }
@@ -2370,8 +2405,10 @@
   FT_EXPORT_FUNC( FT_Renderer )  FT_Get_Renderer( FT_Library       library,
                                                   FT_Glyph_Format  format )
   {
+    /* test for valid `library' delayed to FT_Lookup_Renderer() */
+
     return  FT_Lookup_Renderer( library, format, 0 );
-  }                                               
+  }
 
 
   /*************************************************************************/
@@ -2400,14 +2437,20 @@
   /*                                                                       */
   /*    This doesn't change the current renderer for other formats.        */
   /*                                                                       */
-  FT_EXPORT_DEF( FT_Error ) FT_Set_Renderer( FT_Library     library,
-                                             FT_Renderer    renderer,
-                                             FT_UInt        num_params,
-                                             FT_Parameter*  parameters )
+  FT_EXPORT_DEF( FT_Error )  FT_Set_Renderer( FT_Library     library,
+                                              FT_Renderer    renderer,
+                                              FT_UInt        num_params,
+                                              FT_Parameter*  parameters )
   {
     FT_ListNode  node;
     FT_Error     error = FT_Err_Ok;
-    
+
+
+    if ( !library )
+      return FT_Err_Invalid_Library_Handle;
+
+    if ( !renderer )
+      return FT_Err_Invalid_Argument;
 
     node = FT_List_Find( &library->renderers, renderer );
     if ( !node )
@@ -2417,14 +2460,14 @@
     }
 
     FT_List_Up( &library->renderers, node );
-    
+
     if ( renderer->glyph_format == ft_glyph_format_outline )
       library->cur_renderer = renderer;
-      
+
     if ( num_params > 0 )
     {
       FTRenderer_setMode  set_mode = renderer->clazz->set_mode;
-      
+
 
       for ( ; num_params > 0; num_params-- )
       {
@@ -2433,66 +2476,35 @@
           break;
       }
     }
-    
+
   Exit:
     return error;
-  }                                           
-
-
- /*************************************************************************
-  *
-  *  <Function>
-  *     FT_Render_Glyph
-  *
-  *  <Description>
-  *     Converts a given glyph image to a bitmap. It does so by inspecting
-  *     the glyph image format, find the relevant renderer, and invoke it
-  *
-  *  <Input>
-  *     slot        :: handle to the glyph slot containing the image to
-  *                    convert
-  *
-  *     render_mode :: a set of bit flags indicating which kind of bitmap
-  *                    to render. For now, only 'ft_render_mode_anti_alias'
-  *                    is supported by the available renderers, but others
-  *                    could appear later (e.g. LCD or TV optimised)
-  *
-  *  <Return>
-  *     Error code. 0 means success.
-  *
-  *  <Note>
-  *     in case of success, the renderer will be used to convert glyph
-  *     images in the renderer's known format into bitmaps.
-  *
-  *     This doesn't change the current renderer for other formats..
-  *
-  *     The slot's native image should be considered lost after the
-  *     conversion..
-  *
-  *************************************************************************/
+  }
+
 
   LOCAL_FUNC
-  FT_Error   FT_Render_Glyph_Internal( FT_Library    library,
-                                       FT_GlyphSlot  slot,
-                                       FT_UInt       render_mode )
+  FT_Error  FT_Render_Glyph_Internal( FT_Library    library,
+                                      FT_GlyphSlot  slot,
+                                      FT_UInt       render_mode )
   {
     FT_Error     error = FT_Err_Ok;
     FT_Renderer  renderer;
 
-      
-    /* if it's already a bitmap, no need to do anything */
-    switch (slot->format)
+
+    /* if it is already a bitmap, no need to do anything */
+    switch ( slot->format )
     {
-      case ft_glyph_format_bitmap:   /* already a bitmap, don't do anything */
-        break;
-      
-      default:
+    case ft_glyph_format_bitmap:   /* already a bitmap, don't do anything */
+      break;
+
+    default:
       {
         FT_ListNode  node   = 0;
         FT_Bool      update = 0;
-        
+
+
         /* small shortcut for the very common case */
-        if (slot->format == ft_glyph_format_outline)
+        if ( slot->format == ft_glyph_format_outline )
         {
           renderer = library->cur_renderer;
           node     = library->renderers.head;
@@ -2501,46 +2513,80 @@
           renderer = FT_Lookup_Renderer( library, slot->format, &node );
 
         error = FT_Err_Unimplemented_Feature;
-        while (renderer)
+        while ( renderer )
         {
           error = renderer->render( renderer, slot, render_mode, 0 );
-          if (!error || error != FT_Err_Cannot_Render_Glyph) break;
+          if ( !error || error != FT_Err_Cannot_Render_Glyph )
+            break;
 
-          /* FT_Err_Cannot_Render_Glyph is returned when the render mode */
+          /* FT_Err_Cannot_Render_Glyph is returned if the render mode   */
           /* is unsupported by the current renderer for this glyph image */
-          /* format..                                                    */
-          
-          /* now, look for another renderer that supports the same  */
-          /* format..                                              */
+          /* format.                                                     */
+
+          /* now, look for another renderer that supports the same */
+          /* format.                                               */
           renderer = FT_Lookup_Renderer( library, slot->format, &node );
           update   = 1;
         }
 
         /* if we changed the current renderer for the glyph image format */
-        /* we need to select it as the next current one..                */
-        if (!error && update && renderer)
+        /* we need to select it as the next current one                  */
+        if ( !error && update && renderer )
           FT_Set_Renderer( library, renderer, 0, 0 );
       }
     }
-    
+
     return error;
   }
 
 
-
-  FT_EXPORT_FUNC(FT_Error)  FT_Render_Glyph( FT_GlyphSlot  slot,
-                                             FT_UInt       render_mode )
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
+  /*    FT_Render_Glyph                                                    */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Converts a given glyph image to a bitmap.  It does so by           */
+  /*    inspecting the glyph image format, find the relevant renderer, and */
+  /*    invoke it.                                                         */
+  /*                                                                       */
+  /* <Input>                                                               */
+  /*    slot        :: A handle to the glyph slot containing the image to  */
+  /*                   convert.                                            */
+  /*                                                                       */
+  /*    render_mode :: A set of bit flags indicating which kind of bitmap  */
+  /*                   to render.  For now, only                           */
+  /*                   `ft_render_mode_anti_alias' is supported by the     */
+  /*                   available renderers, but others could appear later  */
+  /*                   (e.g. optimized for TV or LCD).                     */
+  /*                                                                       */
+  /* <Return>                                                              */
+  /*    FreeType error code.  0 means success.                             */
+  /*                                                                       */
+  /* <Note>                                                                */
+  /*    In case of success, the renderer will be used to convert glyph     */
+  /*    images in the renderer's known format into bitmaps.                */
+  /*                                                                       */
+  /*    This doesn't change the current renderer for other formats.        */
+  /*                                                                       */
+  /*    The slot's native image should be considered lost after the        */
+  /*    conversion.                                                        */
+  /*                                                                       */
+  FT_EXPORT_FUNC( FT_Error )  FT_Render_Glyph( FT_GlyphSlot  slot,
+                                               FT_UInt       render_mode )
   {
     FT_Library   library;
-    
-    if (!slot)
+
+
+    if ( !slot )
       return FT_Err_Invalid_Argument;
-      
-    library = FT_FACE_LIBRARY(slot->face);
+
+    library = FT_FACE_LIBRARY( slot->face );
+
     return FT_Render_Glyph_Internal( library, slot, render_mode );
   }
 
-  
+
   /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
@@ -2625,10 +2671,13 @@
     FT_UInt    nn;
 
 
-#define FREETYPE_VER_FIXED ( ( (FT_Long)FREETYPE_MAJOR << 16 ) | \
-                               FREETYPE_MINOR                  )
+#define FREETYPE_VER_FIXED  ( ( (FT_Long)FREETYPE_MAJOR << 16 ) | \
+                                FREETYPE_MINOR                  )
 
-    if ( !library || !clazz )
+    if ( !library )
+      return FT_Err_Invalid_Library_Handle;
+
+    if ( !clazz )
       return FT_Err_Invalid_Argument;
 
     /* check freetype version */
@@ -2665,13 +2714,13 @@
     if ( ALLOC( module,clazz->module_size ) )
       goto Exit;
 
-    /* base initialisation */
+    /* base initialization */
     module->library = library;
     module->memory  = memory;
     module->clazz   = (FT_Module_Class*)clazz;
 
-    /* if the module is a renderer - this must be performed before */
-    /* the normal module initialization.                           */
+    /* check whether the module is a renderer - this must be performed */
+    /* before the normal module initialization                         */
     if ( FT_MODULE_IS_RENDERER( module ) )
     {
       /* add to the renderers list */
@@ -2686,7 +2735,7 @@
       /* allocate glyph loader if needed */
       FT_Driver   driver = FT_DRIVER( module );
 
-      
+
       driver->clazz = (FT_Driver_Class*)module->clazz;
       if ( FT_DRIVER_USES_OUTLINES( driver ) )
       {
@@ -2705,20 +2754,20 @@
 
     /* add module to the library's table */
     library->modules[library->num_modules++] = module;
-      
+
   Exit:
     return error;
-    
+
   Fail:
     if ( FT_MODULE_IS_DRIVER( module ) )
     {
       FT_Driver  driver = FT_DRIVER( module );
-      
+
 
       if ( FT_DRIVER_USES_OUTLINES( driver ) )
         FT_GlyphLoader_Done( driver->glyph_loader );
     }
-    
+
     if ( FT_MODULE_IS_RENDERER( module ) )
     {
       FT_Renderer  renderer = FT_RENDERER( module );
@@ -2756,11 +2805,17 @@
   FT_EXPORT_FUNC( FT_Module ) FT_Get_Module( FT_Library   library,
                                              const char*  module_name )
   {
-    FT_Module  result = 0;
-    FT_Module* cur    = library->modules;
-    FT_Module* limit  = cur + library->num_modules;
+    FT_Module   result = 0;
+    FT_Module*  cur;
+    FT_Module*  limit;
 
 
+    if ( !library || !module_name )
+      return result;
+
+    cur   = library->modules;
+    limit = cur + library->num_modules;
+
     for ( ; cur < limit; cur++ )
       if ( strcmp( cur[0]->clazz->module_name, module_name ) == 0 )
       {
@@ -2793,17 +2848,19 @@
   /*    You should better be familiar with FreeType internals to know      */
   /*    which module to look for, and what its interface is :-)            */
   /*                                                                       */
-  FT_EXPORT_FUNC(const void*)  FT_Get_Module_Interface(
-                                 FT_Library   library,
-                                 const char*  mod_name )
+  FT_EXPORT_FUNC( const void* )  FT_Get_Module_Interface(
+                                   FT_Library   library,
+                                   const char*  mod_name )
   {
     FT_Module  module;
-    
+
+
+    /* test for valid `library' delayed to FT_Get_Module() */
 
     module = FT_Get_Module( library, mod_name );
 
     return module ? module->clazz->module_interface : 0;
-  }                                                 
+  }
 
 
   /*************************************************************************/
@@ -2815,9 +2872,9 @@
   /*    Removes a given module from a library instance.                    */
   /*                                                                       */
   /* <Input>                                                               */
-  /*    library  :: A handle to a library object.                          */
+  /*    library :: A handle to a library object.                           */
   /*                                                                       */
-  /*    module   :: A handle to a module object.                           */
+  /*    module  :: A handle to a module object.                            */
   /*                                                                       */
   /* <Return>                                                              */
   /*    FreeType error code.  0 means success.                             */
@@ -2829,7 +2886,11 @@
                                                 FT_Module   module )
   {
     /* try to find the module from the table, then remove it from there */
-    if ( library && module )
+
+    if ( !library )
+      return FT_Err_Invalid_Library_Handle;
+
+    if ( module )
     {
       FT_Module*  cur   = library->modules;
       FT_Module*  limit = cur + library->num_modules;
@@ -2837,7 +2898,7 @@
 
       for ( ; cur < limit; cur++ )
       {
-        if (cur[0] == module)
+        if ( cur[0] == module )
         {
           /* remove it from the table */
           library->num_modules--;
diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c
index b9a4c21..76497d3 100644
--- a/src/base/ftoutln.c
+++ b/src/base/ftoutln.c
@@ -174,50 +174,48 @@
           }
 
         case FT_Curve_Tag_Conic:  /* consume conic arcs */
-          {
-            v_control.x = SCALED( point->x );
-            v_control.y = SCALED( point->y );
-
-          Do_Conic:
-            if ( point < limit )
-            {
-              FT_Vector  vec;
-              FT_Vector  v_middle;
-
+          v_control.x = SCALED( point->x );
+          v_control.y = SCALED( point->y );
 
-              point++;
-              tags++;
-              tag = FT_CURVE_TAG( tags[0] );
-
-              vec.x = SCALED( point->x );
-              vec.y = SCALED( point->y );
+        Do_Conic:
+          if ( point < limit )
+          {
+            FT_Vector  vec;
+            FT_Vector  v_middle;
 
-              if ( tag == FT_Curve_Tag_On )
-              {
-                error = interface->conic_to( &v_control, &vec, user );
-                if ( error )
-                  goto Exit;
-                continue;
-              }
 
-              if ( tag != FT_Curve_Tag_Conic )
-                goto Invalid_Outline;
+            point++;
+            tags++;
+            tag = FT_CURVE_TAG( tags[0] );
 
-              v_middle.x = ( v_control.x + vec.x ) / 2;
-              v_middle.y = ( v_control.y + vec.y ) / 2;
+            vec.x = SCALED( point->x );
+            vec.y = SCALED( point->y );
 
-              error = interface->conic_to( &v_control, &v_middle, user );
+            if ( tag == FT_Curve_Tag_On )
+            {
+              error = interface->conic_to( &v_control, &vec, user );
               if ( error )
                 goto Exit;
-
-              v_control = vec;
-              goto Do_Conic;
+              continue;
             }
 
-            error = interface->conic_to( &v_control, &v_start, user );
-            goto Close;
+            if ( tag != FT_Curve_Tag_Conic )
+              goto Invalid_Outline;
+
+            v_middle.x = ( v_control.x + vec.x ) / 2;
+            v_middle.y = ( v_control.y + vec.y ) / 2;
+
+            error = interface->conic_to( &v_control, &v_middle, user );
+            if ( error )
+              goto Exit;
+
+            v_control = vec;
+            goto Do_Conic;
           }
 
+          error = interface->conic_to( &v_control, &v_start, user );
+          goto Close;
+
         default:  /* FT_Curve_Tag_Cubic */
           {
             FT_Vector  vec1, vec2;
@@ -256,7 +254,7 @@
       /* close the contour with a line segment */
       error = interface->line_to( &v_start, user );
 
-   Close:
+    Close:
       if ( error )
         goto Exit;
 
@@ -549,6 +547,7 @@
         char*  q = outline->tags + last;
         char   swap;
 
+
         while ( p < q )
         {
           swap = *p;
@@ -604,34 +603,46 @@
                                                  FT_Outline*        outline,
                                                  FT_Raster_Params*  params )
   {
-    FT_Error         error;
-    FT_Bool          update   = 0;
-    FT_Renderer      renderer = library->cur_renderer;
-    FT_ListNode      node     = library->renderers.head;
+    FT_Error     error;
+    FT_Bool      update = 0;
+    FT_Renderer  renderer;
+    FT_ListNode  node;
+
+
+    if ( !library )
+      return FT_Err_Invalid_Library_Handle;
+
+    if ( !params )
+      return FT_Err_Invalid_Argument;
+
+    renderer = library->cur_renderer;
+    node     = library->renderers.head;
 
     params->source = (void*)outline;
-        
+
     error = FT_Err_Cannot_Render_Glyph;
-    while (renderer)
+    while ( renderer )
     {
       error = renderer->raster_render( renderer->raster, params );
-      if (!error || error != FT_Err_Cannot_Render_Glyph) break;
+      if ( !error || error != FT_Err_Cannot_Render_Glyph )
+        break;
 
       /* FT_Err_Cannot_Render_Glyph is returned when the render mode */
       /* is unsupported by the current renderer for this glyph image */
-      /* format..                                                    */
-      
-      /* now, look for another renderer that supports the same  */
-      /* format..                                              */
-      renderer = FT_Lookup_Renderer( library, ft_glyph_format_outline, &node );
+      /* format                                                      */
+
+      /* now, look for another renderer that supports the same */
+      /* format                                                */
+      renderer = FT_Lookup_Renderer( library, ft_glyph_format_outline,
+                                     &node );
       update   = 1;
     }
 
     /* if we changed the current renderer for the glyph image format */
-    /* we need to select it as the next current one..                */
-    if (!error && update && renderer)
+    /* we need to select it as the next current one                  */
+    if ( !error && update && renderer )
       FT_Set_Renderer( library, renderer, 0, 0 );
-      
+
     return error;
   }
 
@@ -675,7 +686,7 @@
     if ( !bitmap )
       return FT_Err_Invalid_Argument;
 
-    /* other checks are delayed to FT_Outline_Render */
+    /* other checks are delayed to FT_Outline_Render() */
 
     params.target = bitmap;
     params.flags  = 0;
@@ -713,6 +724,9 @@
     FT_Pos xz, yz;
 
 
+    if ( !vector || !matrix )
+      return;
+
     xz = FT_MulFix( vector->x, matrix->xx ) +
          FT_MulFix( vector->y, matrix->xy );
 
@@ -750,7 +764,7 @@
   {
     FT_Vector*  vec = outline->points;
     FT_Vector*  limit = vec + outline->n_points;
-    
+
 
     for ( ; vec < limit; vec++ )
       FT_Vector_Transform( vec, matrix );
diff --git a/src/base/ftstream.c b/src/base/ftstream.c
index f2fc2ee..c1cb122 100644
--- a/src/base/ftstream.c
+++ b/src/base/ftstream.c
@@ -374,9 +374,9 @@
   BASE_FUNC( FT_Short )  FT_Read_Short( FT_Stream  stream,
                                         FT_Error*  error )
   {
-    char     reads[2];
-    char*    p = 0;
-    FT_Short result = 0;
+    char      reads[2];
+    char*     p = 0;
+    FT_Short  result = 0;
 
 
     FT_Assert( stream );
@@ -645,27 +645,24 @@
         *(FT_UShort*)p = (FT_UShort)value;
         break;
 
-     /* A slight note regarding the following:                    */
-     /*                                                           */
-     /*  SIZEOF_INT is defined in <freetype/config/ftconfig.h>    */
-     /*  and gives the size in bytes of the "int" type on the     */
-     /*  current platform..                                       */
-     /*                                                           */
-     /*  Only on 16-bit systems can the value of SIZEOF_INT be    */
-     /*  less than 4. In this case SIZEOF_LONG is always 4        */
-     /*                                                           */
-     /*  On a 64-bit system, SIZEOF_LONG can be 8, which is       */
-     /*  handled by the default case..                            */
-     /*                                                           */
-
+        /* SIZEOF_INT is defined in <freetype/config/ftconfig.h> */
+        /* and gives the size in bytes of the `int' type on the  */
+        /* current platform.                                     */
+        /*                                                       */
+        /* Only on 16-bit systems the value of SIZEOF_INT can be */
+        /* less than 4.  In this case SIZEOF_LONG is always 4.   */
+        /*                                                       */
+        /* On a 64-bit system, SIZEOF_LONG can be 8, which is    */
+        /* handled by the default case.                          */
+        /*                                                       */
 #if SIZEOF_INT == 4
       case 4:
-         *(FT_UInt*)p = (FT_UInt)value;
-         break;
+        *(FT_UInt*)p = (FT_UInt)value;
+        break;
 #endif
 
       default:
-         *(FT_ULong*)p = (FT_ULong)value;
+        *(FT_ULong*)p = (FT_ULong)value;
       }
 
       /* go to next field */
diff --git a/src/base/ftsystem.c b/src/base/ftsystem.c
index 434a6db..1249402 100644
--- a/src/base/ftsystem.c
+++ b/src/base/ftsystem.c
@@ -44,8 +44,9 @@
 
   /*************************************************************************/
   /*                                                                       */
-  /* It is not necessary to do any error checking here.  This will be done */
-  /* by the higher level routines like FT_Alloc() or FT_Realloc().         */
+  /* It is not necessary to do any error checking for the                  */
+  /* allocation-related functions.  This will be done by the higher level  */
+  /* routines like FT_Alloc() or FT_Realloc().                             */
   /*                                                                       */
   /*************************************************************************/
 
@@ -234,6 +235,9 @@
     FILE*  file;
 
 
+    if ( !stream )
+      return FT_Err_Invalid_Stream_Handle;
+
     file = fopen( filepathname, "rb" );
     if ( !file )
     {
diff --git a/src/cff/t2driver.c b/src/cff/t2driver.c
index cf3149a..9864058 100644
--- a/src/cff/t2driver.c
+++ b/src/cff/t2driver.c
@@ -303,12 +303,12 @@
       0x20000L,
 
       0,   /* module-specific interface */
-      
+
       (FT_Module_Constructor)T2_Init_Driver,
       (FT_Module_Destructor) T2_Done_Driver,
       (FT_Module_Requester)  t2_get_interface,
     },
-    
+
     /* now the specific driver fields */
     sizeof( TT_FaceRec ),
     sizeof( FT_SizeRec ),
@@ -323,7 +323,7 @@
 
     (FTDriver_setCharSizes) 0,
     (FTDriver_setPixelSizes)0,
-    
+
     (FTDriver_loadGlyph)    Load_Glyph,
     (FTDriver_getCharIndex) Get_Char_Index,
 
diff --git a/src/cff/t2gload.c b/src/cff/t2gload.c
index b4eb7d9..75c8eba 100644
--- a/src/cff/t2gload.c
+++ b/src/cff/t2gload.c
@@ -233,7 +233,7 @@
     {
       FT_GlyphLoader*  loader = glyph->root.loader;
 
-      
+
       builder->loader  = loader;
       builder->base    = &loader->base.outline;
       builder->current = &loader->current.outline;
@@ -351,29 +351,31 @@
   }
 
 
- /* this function is used to select the locals subrs array */
+  /* this function is used to select the locals subrs array */
   LOCAL_DEF
-  void   T2_Prepare_Decoder( T2_Decoder*  decoder,
-                             FT_UInt      glyph_index )
+  void  T2_Prepare_Decoder( T2_Decoder*  decoder,
+                            FT_UInt      glyph_index )
   {
     CFF_Font*     cff = (CFF_Font*)decoder->builder.face->extra.data;
     CFF_SubFont*  sub = &cff->top_font;
-    
+
+
     /* manage CID fonts */
-    if (cff->num_subfonts >= 1)
+    if ( cff->num_subfonts >= 1 )
     {
       FT_Byte  fd_index = CFF_Get_FD( &cff->fd_select, glyph_index );
+
+
       sub = cff->subfonts[fd_index];
     }
-    
-    decoder->num_locals  = sub->num_local_subrs;
-    decoder->locals      = sub->local_subrs;
-    decoder->locals_bias = t2_compute_bias( decoder->num_locals );
+
+    decoder->num_locals    = sub->num_local_subrs;
+    decoder->locals        = sub->local_subrs;
+    decoder->locals_bias   = t2_compute_bias( decoder->num_locals );
 
     decoder->glyph_width   = sub->private_dict.default_width;
     decoder->nominal_width = sub->private_dict.nominal_width;
-  }                                 
-
+  }
 
 
   /* check that there is enough room for `count' more points */
@@ -382,7 +384,7 @@
                           FT_Int       count )
   {
     return FT_GlyphLoader_Check_Points( builder->loader, count, 0 );
-  }                                         
+  }
 
 
   /* add a new point, do not check space */
@@ -447,7 +449,7 @@
     {
       if ( outline->n_contours > 0 )
         outline->contours[outline->n_contours - 1] = outline->n_points - 1;
-  
+
       outline->n_contours++;
     }
 
@@ -528,6 +530,7 @@
     FT_Fixed            seed;
     FT_Fixed*           stack;
 
+
     /* set default width */
     decoder->num_hints  = 0;
     decoder->read_width = 1;
@@ -1087,10 +1090,12 @@
 
         case t2_op_rlinecurve:
           {
-            FT_Int    num_lines = (num_args-6)/2;
+            FT_Int  num_lines = ( num_args - 6 ) / 2;
+
+
             FT_TRACE4(( " rlinecurve" ));
             
-            if ( num_args < 8 || (num_args-6) & 1)
+            if ( num_args < 8 || ( num_args - 6 ) & 1 )
               goto Stack_Underflow;
               
             if ( start_point( builder, x, y )           ||
@@ -1100,7 +1105,7 @@
             args = stack;
             
             /* first, add the line segments */
-            while (num_lines > 0)
+            while ( num_lines > 0 )
             {
               x += args[0];
               y += args[1];
@@ -1109,7 +1114,7 @@
               num_lines--;
             }
             
-            /* then, the curve */
+            /* then the curve */
             x += args[0];
             y += args[1];
             add_point( builder, x, y, 0 );
@@ -1125,12 +1130,12 @@
           
         case t2_op_rcurveline:
           {
-            FT_Int  num_curves = (num_args-2)/6;
+            FT_Int  num_curves = ( num_args - 2 ) / 6;
 
 
             FT_TRACE4(( " rcurveline" ));
 
-            if ( num_args < 8 || (num_args-2) % 6  )
+            if ( num_args < 8 || ( num_args - 2 ) % 6 )
               goto Stack_Underflow;
 
             if ( start_point ( builder, x, y )             ||
@@ -1138,8 +1143,9 @@
               goto Memory_Error;
 
             args = stack;
+
             /* first, add the curves */
-            while (num_curves > 0)
+            while ( num_curves > 0 )
             {
               x += args[0];
               y += args[1];
@@ -1153,6 +1159,7 @@
               args += 6;
               num_curves--;
             }
+
             /* then the final line */
             x += args[0];
             y += args[1];
@@ -1549,15 +1556,15 @@
     return error;
 
   Syntax_Error:
-    FT_TRACE4(( "** Syntax Error **" ));
+    FT_TRACE4(( "T2_Parse_CharStrings: syntax error!" ));
     return T2_Err_Invalid_File_Format;
 
   Stack_Underflow:
-    FT_TRACE4(( "** Stack underflow **" ));
+    FT_TRACE4(( "T2_Parse_CharStrings: stack underflow!" ));
     return T2_Err_Too_Few_Arguments;
 
   Stack_Overflow:
-    FT_TRACE4(( "** Stack overflow**" ));
+    FT_TRACE4(( "T2_Parse_CharStrings: stack overflow!" ));
     return T2_Err_Stack_Overflow;
 
   Memory_Error:
diff --git a/src/cff/t2gload.h b/src/cff/t2gload.h
index 605ba5e..5117f34 100644
--- a/src/cff/t2gload.h
+++ b/src/cff/t2gload.h
@@ -167,8 +167,8 @@
                          T2_GlyphSlot  slot );
 
   LOCAL_DEF
-  void   T2_Prepare_Decoder( T2_Decoder*  decoder,
-                             FT_UInt     glyph_index );
+  void  T2_Prepare_Decoder( T2_Decoder*  decoder,
+                            FT_UInt      glyph_index );
 
 #if 0  /* unused until we support pure CFF fonts */
 
diff --git a/src/cff/t2load.c b/src/cff/t2load.c
index 95015a6..7040489 100644
--- a/src/cff/t2load.c
+++ b/src/cff/t2load.c
@@ -318,26 +318,27 @@
 
 #endif /* 0 */
 
- /**********************************************************************/
- /**********************************************************************/
- /***                                                                ***/
- /***   FD Select table support                                      ***/
- /***                                                                ***/
- /***                                                                ***/
- /**********************************************************************/
- /**********************************************************************/
+
+  /*************************************************************************/
+  /*************************************************************************/
+  /***                                                                   ***/
+  /***   FD Select table support                                         ***/
+  /***                                                                   ***/
+  /*************************************************************************/
+  /*************************************************************************/
+
 
   static
   void  CFF_Done_FD_Select( CFF_FD_Select*  select,
                             FT_Stream       stream )
   {
-    if (select->data)
+    if ( select->data )
       RELEASE_Frame( select->data );
-      
+
     select->data_size   = 0;
     select->format      = 0;
     select->range_count = 0;
-  }                            
+  }
 
 
   static
@@ -349,42 +350,44 @@
     FT_Error       error;
     FT_Byte        format;
     FT_UInt        num_ranges;
-    
+
+
     /* read format */
-    if ( FILE_Seek(offset) || READ_Byte(format) )
+    if ( FILE_Seek( offset ) || READ_Byte( format ) )
       goto Exit;
     
     select->format      = format;
     select->cache_count = 0;   /* clear cache */
-    switch (format)
+
+    switch ( format )
     {
-      case 0:  /* format 0, that's simple */
-         {
-           select->data_size = num_glyphs;
-           goto Load_Data;
-         }
-         
-         
-      case 3:  /* format 3, a tad more complex */
-         {
-           if ( READ_UShort(num_ranges) )
-             goto Exit;
-             
-           select->data_size = num_ranges*3+2;
-           
-         Load_Data:  
-           if ( EXTRACT_Frame( select->data_size, select->data ) )
-             goto Exit;
-         }
-         break;
-         
-         
-      default: /* humm.. that's wrong */
-        error = FT_Err_Invalid_File_Format;
+    case 0:     /* format 0, that's simple */
+      {
+        select->data_size = num_glyphs;
+        goto Load_Data;
+      }
+
+    case 3:     /* format 3, a tad more complex */
+      {
+        if ( READ_UShort( num_ranges ) )
+          goto Exit;
+
+        select->data_size = num_ranges * 3 + 2;
+
+      Load_Data:
+        if ( EXTRACT_Frame( select->data_size, select->data ) )
+          goto Exit;
+      }
+      break;
+
+
+    default:    /* humm... that's wrong */
+      error = FT_Err_Invalid_File_Format;
     }
+
   Exit:
     return error;
-  }                                
+  }
 
 
   LOCAL_FUNC
@@ -392,68 +395,70 @@
                        FT_UInt         glyph_index )
   {
     FT_Byte  fd = 0;
-    
-    switch (select->format)
+
+
+    switch ( select->format )
     {
-      case 0:
-        fd = select->data[glyph_index];
+    case 0:
+      fd = select->data[glyph_index];
+      break;
+
+    case 3:
+      /* first, compare to cache */
+      if ( (FT_UInt)(glyph_index-select->cache_first) < select->cache_count )
+      {
+        fd = select->cache_fd;
         break;
-        
-      case 3:
-        /* first, compare to cache */
-        if ((FT_UInt)(glyph_index-select->cache_first) < select->cache_count)
-        {
-          fd = select->cache_fd;
-          break;
-        }
-        
-        /* then, lookup the ranges array */
+      }
+
+      /* then, lookup the ranges array */
+      {
+        FT_Byte*  p       = select->data;
+        FT_Byte*  p_limit = p + select->data_size;
+        FT_Byte   fd2;
+        FT_UInt   first, limit;
+
+
+        first = NEXT_UShort( p );
+        do
         {
-          FT_Byte*  p       = select->data;
-          FT_Byte*  p_limit = p + select->data_size;
-          FT_Byte   fd2;
-          FT_UInt   first, limit;
-          
-          first = NEXT_UShort(p);
-          do
+          if ( glyph_index < first )
+            break;
+
+          fd2   = *p++;
+          limit = NEXT_UShort( p );
+
+          if ( glyph_index < limit )
           {
-            if (glyph_index < first)
-              break;
-              
-            fd2   = *p++;
-            limit = NEXT_UShort(p);
-            
-            if (glyph_index < limit)
-            {
-              fd = fd2;
-              
-              /* update cache */
-              select->cache_first = first;
-              select->cache_count = limit-first;
-              select->cache_fd    = fd2;
-              break;
-            }
-            first = limit;
+            fd = fd2;
+
+            /* update cache */
+            select->cache_first = first;
+            select->cache_count = limit-first;
+            select->cache_fd    = fd2;
+            break;
           }
-          while (p < p_limit);
-        }
-        break;
-        
-      default:
-        ;
+          first = limit;
+        } while ( p < p_limit );
+      }
+      break;
+
+    default:
+      ;
     }
+
     return fd;
-  }                       
+  }
+
 
+  /*************************************************************************/
+  /*************************************************************************/
+  /***                                                                   ***/
+  /***   CFF font support                                                ***/
+  /***                                                                   ***/
+  /*************************************************************************/
+  /*************************************************************************/
 
- /**********************************************************************/
- /**********************************************************************/
- /***                                                                ***/
- /***   CFF font support                                             ***/
- /***                                                                ***/
- /***                                                                ***/
- /**********************************************************************/
- /**********************************************************************/
 
   static
   FT_Error  CFF_Load_SubFont( CFF_SubFont*  font,
@@ -462,12 +467,13 @@
                               FT_Stream     stream,
                               FT_ULong      base_offset )
   {
-    FT_Error       error;
-    T2_Parser      parser;
-    FT_Byte*       dict;
-    FT_ULong       dict_len;
+    FT_Error        error;
+    T2_Parser       parser;
+    FT_Byte*        dict;
+    FT_ULong        dict_len;
     CFF_Font_Dict*  top  = &font->font_dict;
-    CFF_Private*   priv = &font->private_dict;
+    CFF_Private*    priv = &font->private_dict;
+
 
     T2_Parser_Init( &parser, T2CODE_TOPDICT, &font->font_dict );
 
@@ -494,11 +500,11 @@
       goto Exit;
 
     /* parse the private dictionary, if any */
-    if ( top->private_offset && top->private_size)
+    if ( top->private_offset && top->private_size )
     {
       /* set defaults */
-      MEM_Set( priv, 0, sizeof(*priv) );
-      
+      MEM_Set( priv, 0, sizeof ( *priv ) );
+
       priv->blue_shift       = 7;
       priv->blue_fuzz        = 1;
       priv->lenIV            = -1;
@@ -508,7 +514,7 @@
       T2_Parser_Init( &parser, T2CODE_PRIVATE, priv );
 
       if ( FILE_Seek( base_offset + font->font_dict.private_offset ) ||
-           ACCESS_Frame( font->font_dict.private_size )               )
+           ACCESS_Frame( font->font_dict.private_size )              )
         goto Exit;
 
       error = T2_Parser_Run( &parser,
@@ -529,7 +535,7 @@
       error = t2_new_cff_index( &font->local_subrs_index, stream, 1 );
       if ( error )
         goto Exit;
-        
+
       font->num_local_subrs = font->local_subrs_index.count;
       error = t2_explicit_cff_index( &font->local_subrs_index,
                                      &font->local_subrs );
@@ -544,13 +550,12 @@
   void  CFF_Done_SubFont( FT_Memory     memory,
                           CFF_SubFont*  subfont )
   {
-    if (subfont)
+    if ( subfont )
     {
       t2_done_cff_index( &subfont->local_subrs_index );
       FREE( subfont->local_subrs );
     }
-  }                          
-
+  }
 
 
   LOCAL_FUNC
@@ -599,7 +604,7 @@
 
     /* read the name, top dict, string and global subrs index */
     error = t2_new_cff_index( &font->name_index, stream, 0 )       ||
-            t2_new_cff_index( &font->font_dict_index, stream, 0 )   ||
+            t2_new_cff_index( &font->font_dict_index, stream, 0 )  ||
             t2_new_cff_index( &font->string_index, stream, 0 )     ||
             t2_new_cff_index( &font->global_subrs_index, stream, 1 );
     if ( error )
@@ -615,16 +620,16 @@
     }
 
     /* in case of a font format check, simply exit now */
-    if (face_index < 0)
+    if ( face_index < 0 )
       goto Exit;
-      
+
     /* now, parse the top-level font dictionary */
     error = CFF_Load_SubFont( &font->top_font,
                               &font->font_dict_index,
                               face_index,
                               stream,
                               base_offset );
-    if (error)
+    if ( error )
       goto Exit;
 
     /* now, check for a CID font */
@@ -634,20 +639,22 @@
       CFF_SubFont*  sub;
       FT_UInt       index;
 
+
       /* this is a CID-keyed font, we must now allocate a table of */
-      /* sub-fonts, then load each of them separately..            */
+      /* sub-fonts, then load each of them separately              */
       if ( FILE_Seek( base_offset + dict->cid_fd_array_offset ) )
         goto Exit;
-        
+
       error = t2_new_cff_index( &fd_index, stream, 0 );
-      if (error) goto Exit;
-      
-      if (fd_index.count > CFF_MAX_CID_FONTS)
+      if ( error )
+        goto Exit;
+
+      if ( fd_index.count > CFF_MAX_CID_FONTS )
       {
         FT_ERROR(( "T2_Load_CFF_Font: FD array too large in CID font\n" ));
         goto Fail_CID;
       }
-      
+
       /* allocate & read each font dict independently */
       font->num_subfonts = fd_index.count;
       if ( ALLOC_ARRAY( sub, fd_index.count, CFF_SubFont ) )
@@ -656,13 +663,15 @@
       /* setup pointer table */
       for ( index = 0; index < fd_index.count; index++ )
         font->subfonts[index] = sub + index;
-        
+
       /* now load each sub font independently */
       for ( index = 0; index < fd_index.count; index++ )
       {
         sub = font->subfonts[index];
-        error = CFF_Load_SubFont( sub, &fd_index, index, stream, base_offset );
-        if (error) goto Fail_CID;
+        error = CFF_Load_SubFont( sub, &fd_index, index,
+                                  stream, base_offset );
+        if ( error )
+          goto Fail_CID;
       }
 
       /* now load the FD Select array */
@@ -673,8 +682,8 @@
 
    Fail_CID:
       t2_done_cff_index( &fd_index );
-      
-      if (error)
+
+      if ( error )
         goto Exit;
     }
     else
@@ -713,28 +722,27 @@
   }
 
 
-
-
   LOCAL_FUNC
   void  T2_Done_CFF_Font( CFF_Font*  font )
   {
     FT_Memory  memory = font->memory;
     FT_UInt    index;
 
+
     t2_done_cff_index( &font->global_subrs_index );
     t2_done_cff_index( &font->string_index );
     t2_done_cff_index( &font->font_dict_index );
     t2_done_cff_index( &font->name_index );
     t2_done_cff_index( &font->charstrings_index );
-    
+
     /* release font dictionaries */
     for ( index = 0; index < font->num_subfonts; index++ )
       CFF_Done_SubFont( memory, font->subfonts[index] );
-    
+
     CFF_Done_SubFont( memory, &font->top_font );
-    
+
     CFF_Done_FD_Select( &font->fd_select, font->stream );
-    
+
     FREE( font->global_subrs );
     FREE( font->font_name );
   }
diff --git a/src/cff/t2objs.c b/src/cff/t2objs.c
index 5c0b0a8..2de766c 100644
--- a/src/cff/t2objs.c
+++ b/src/cff/t2objs.c
@@ -198,7 +198,7 @@
 #ifdef TT_CONFIG_OPTION_EXTEND_ENGINE
     return TT_Init_Extensions( driver );
 #else
-    UNUSED(driver);
+    UNUSED( driver );
     return T2_Err_Ok;
 #endif
   }
@@ -222,7 +222,7 @@
 #ifdef TT_CONFIG_OPTION_EXTEND_ENGINE
     TT_Done_Extensions( driver );
 #else
-    UNUSED(driver);    
+    UNUSED( driver );
 #endif
   }
 
diff --git a/src/cff/t2parse.c b/src/cff/t2parse.c
index 8238a81..1d4fc5a 100644
--- a/src/cff/t2parse.c
+++ b/src/cff/t2parse.c
@@ -280,9 +280,9 @@
   FT_Error  parse_font_matrix( T2_Parser*  parser )
   {
     CFF_Font_Dict*  dict   = (CFF_Font_Dict*)parser->object;
-    FT_Matrix*     matrix = &dict->font_matrix;
-    FT_Byte**      data   = parser->stack;
-    FT_Error       error;
+    FT_Matrix*      matrix = &dict->font_matrix;
+    FT_Byte**       data   = parser->stack;
+    FT_Error        error;
 
 
     error = T2_Err_Stack_Underflow;
@@ -304,9 +304,9 @@
   FT_Error  parse_font_bbox( T2_Parser*  parser )
   {
     CFF_Font_Dict*  dict   = (CFF_Font_Dict*)parser->object;
-    FT_BBox*       bbox   = &dict->font_bbox;
-    FT_Byte**      data   = parser->stack;
-    FT_Error       error;
+    FT_BBox*        bbox   = &dict->font_bbox;
+    FT_Byte**       data   = parser->stack;
+    FT_Error        error;
 
 
     error = T2_Err_Stack_Underflow;
@@ -328,8 +328,8 @@
   FT_Error  parse_private_dict( T2_Parser*  parser )
   {
     CFF_Font_Dict*  dict = (CFF_Font_Dict*)parser->object;
-    FT_Byte**      data = parser->stack;
-    FT_Error       error;
+    FT_Byte**       data = parser->stack;
+    FT_Error        error;
 
 
     error = T2_Err_Stack_Underflow;
@@ -349,8 +349,8 @@
   FT_Error  parse_cid_ros( T2_Parser*  parser )
   {
     CFF_Font_Dict*  dict   = (CFF_Font_Dict*)parser->object;
-    FT_Byte**      data   = parser->stack;
-    FT_Error       error;
+    FT_Byte**       data   = parser->stack;
+    FT_Error        error;
 
 
     error = T2_Err_Stack_Underflow;
@@ -395,7 +395,7 @@
             code | T2CODE,                           \
             (FT_UInt)(char*)&T2_REF( T2TYPE, name ), \
             sizeof( T2_REF( T2TYPE, name ) ),        \
-            0, 0, 0                               \
+            0, 0, 0                                  \
           },
 
 #undef  T2_FIELD_DELTA
@@ -478,7 +478,8 @@
         /* and look for it in our current list.                            */
 
         FT_UInt                  code;
-        FT_UInt                   num_args = (FT_UInt)(parser->top - parser->stack);
+        FT_UInt                  num_args = (FT_UInt)
+                                              ( parser->top - parser->stack );
         const T2_Field_Handler*  field;
 
 
@@ -516,28 +517,35 @@
             case t2_kind_fixed:
               val = t2_parse_fixed( parser->stack );
 
-            /* A slight note regarding the following:                    */
-            /*                                                           */
-            /*  SIZEOF_INT is defined in <freetype/config/ftconfig.h>    */
-            /*  and gives the size in bytes of the "int" type on the     */
-            /*  current platform..                                       */
-            /*                                                           */
-            /*  Only on 16-bit systems can the value of SIZEOF_INT be    */
-            /*  less than 4. In this case SIZEOF_LONG is always 4        */
-            /*                                                           */
-            /*  On a 64-bit system, SIZEOF_LONG can be 8, which is       */
-            /*  handled by the default case..                            */
-            /*                                                           */
-
+              /* SIZEOF_INT is defined in <freetype/config/ftconfig.h> */
+              /* and gives the size in bytes of the `int' type on the  */
+              /* current platform.                                     */
+              /*                                                       */
+              /* Only on 16-bit systems the value of SIZEOF_INT can be */
+              /* less than 4.  In this case SIZEOF_LONG is always 4.   */
+              /*                                                       */
+              /* On a 64-bit system, SIZEOF_LONG can be 8, which is    */
+              /* handled by the default case.                          */
+              /*                                                       */
             Store_Number:
               switch ( field->size )
               {
-                case 1:  *(FT_Byte*)q  = (FT_Byte)val;  break;
-                case 2:  *(FT_Short*)q = (FT_Short)val; break;
+              case 1:
+                *(FT_Byte*)q = (FT_Byte)val;
+                break;
+
+              case 2:
+                *(FT_Short*)q = (FT_Short)val;
+                break;
+
 #if SIZEOF_INT == 4
-                case 4:  *(FT_Int*)q   = (FT_Int)val;   break;
+              case 4:
+                *(FT_Int*)q = (FT_Int)val;
+                break;
 #endif
-                default: *(FT_Long*)q  = val;
+
+              default:
+                *(FT_Long*)q = val;
               }
               break;
 
diff --git a/src/cid/cidafm.c b/src/cid/cidafm.c
index 86b2bce..3b1bd26 100644
--- a/src/cid/cidafm.c
+++ b/src/cid/cidafm.c
@@ -40,7 +40,7 @@
 
   LOCAL_FUNC
   void  CID_Done_AFM( FT_Memory  memory,
-                      CID_AFM*    afm )
+                      CID_AFM*   afm )
   {
     FREE( afm->kern_pairs );
     afm->num_pairs = 0;
@@ -162,15 +162,15 @@
   FT_Error  CID_Read_AFM( FT_Face    cid_face,
                           FT_Stream  stream )
   {
-    FT_Error       error;
-    FT_Memory      memory = stream->memory;
-    FT_Byte*       start;
-    FT_Byte*       limit;
-    FT_Byte*       p;
-    FT_Int         count = 0;
-    CID_Kern_Pair* pair;
-    T1_Font*       type1 = &((T1_Face)t1_face)->type1;
-    CID_AFM*       afm   = 0;
+    FT_Error        error;
+    FT_Memory       memory = stream->memory;
+    FT_Byte*        start;
+    FT_Byte*        limit;
+    FT_Byte*        p;
+    FT_Int          count = 0;
+    CID_Kern_Pair*  pair;
+    T1_Font*        type1 = &((T1_Face)t1_face)->type1;
+    CID_AFM*        afm   = 0;
 
 
     if ( ACCESS_Frame( stream->size ) )
@@ -194,7 +194,7 @@
       goto Exit;
 
     /* allocate the pairs */
-    if ( ALLOC( afm, sizeof ( *afm ) )                       ||
+    if ( ALLOC( afm, sizeof ( *afm ) )                        ||
          ALLOC_ARRAY( afm->kern_pairs, count, CID_Kern_Pair ) )
       goto Exit;
 
@@ -245,7 +245,7 @@
 
   /* find the kerning for a given glyph pair */
   LOCAL_FUNC
-  void  CID_Get_Kerning( CID_AFM*     afm,
+  void  CID_Get_Kerning( CID_AFM*    afm,
                          FT_UInt     glyph1,
                          FT_UInt     glyph2,
                          FT_Vector*  kerning )
diff --git a/src/cid/cidgload.c b/src/cid/cidgload.c
index 9651930..1527583 100644
--- a/src/cid/cidgload.c
+++ b/src/cid/cidgload.c
@@ -143,8 +143,8 @@
   /*    glyph   :: The current glyph object.                               */
   /*                                                                       */
   LOCAL_FUNC
-  void  CID_Init_Builder( CID_Builder*  builder,
-                          CID_Face      face,
+  void  CID_Init_Builder( CID_Builder*   builder,
+                          CID_Face       face,
                           CID_Size       size,
                           CID_GlyphSlot  glyph )
   {
@@ -159,11 +159,11 @@
     {
       FT_GlyphLoader*  loader = glyph->root.loader;
 
-      
+
       builder->loader  = loader;
       builder->base    = &loader->base.outline;
       builder->current = &loader->current.outline;
-      
+
       FT_GlyphLoader_Rewind( loader );
     }
 
@@ -202,6 +202,7 @@
   {
     CID_GlyphSlot  glyph = builder->glyph;
 
+
     if ( glyph )
       glyph->root.outline = *builder->base;
   }
@@ -299,7 +300,7 @@
     {
       if ( outline->n_contours > 0 )
         outline->contours[outline->n_contours - 1] = outline->n_points - 1;
-  
+
       outline->n_contours++;
     }
     return error;
@@ -454,7 +455,7 @@
       error = FT_GlyphLoader_Check_Subglyphs( loader, 2 );
       if ( error )
         goto Exit;
-      
+
       subg = loader->current.subglyphs;
 
       /* subglyph 0 = base character */
@@ -474,13 +475,13 @@
       /* set up remaining glyph fields */
       glyph->num_subglyphs = 2;
       glyph->format        = ft_glyph_format_composite;
-      
+
       loader->current.num_subglyphs = 2;
     }
 
     /* First load `bchar' in builder */
     /* now load the unscaled outline */
-    if ( decoder->builder.loader )    
+    if ( decoder->builder.loader )
       FT_GlyphLoader_Prepare( decoder->builder.loader );
 
     error = cid_load_glyph( decoder, bchar_index );  /* load one glyph */
@@ -516,7 +517,7 @@
       {
         FT_Outline  dummy;
 
-        
+
         dummy.n_points = base->n_points - n_base_points;
         dummy.points   = base->points   + n_base_points;
         FT_Outline_Translate( &dummy, adx - asb, ady );
@@ -585,9 +586,9 @@
     /* now, execute loop */
     while ( ip < limit )
     {
-      FT_Int*      top   = decoder->top;
+      FT_Int*       top   = decoder->top;
       CID_Operator  op    = op_none;
-      FT_Long      value = 0;
+      FT_Long       value = 0;
 
 
       /********************************************************************/
@@ -1376,8 +1377,8 @@
   LOCAL_FUNC
   FT_Error  CID_Load_Glyph( CID_GlyphSlot  glyph,
                             CID_Size       size,
-                            FT_Int        glyph_index,
-                            FT_Int        load_flags )
+                            FT_Int         glyph_index,
+                            FT_Int         load_flags )
   {
     FT_Error     error;
     CID_Decoder  decoder;
diff --git a/src/cid/cidgload.h b/src/cid/cidgload.h
index b4bc0c4..555586a 100644
--- a/src/cid/cidgload.h
+++ b/src/cid/cidgload.h
@@ -82,7 +82,7 @@
   {
     FT_Memory        memory;
     CID_Face         face;
-    CID_GlyphSlot     glyph;
+    CID_GlyphSlot    glyph;
     FT_GlyphLoader*  loader;
     FT_Outline*      base;
     FT_Outline*      current;
@@ -142,8 +142,8 @@
 
 
   LOCAL_DEF
-  void  CID_Init_Builder( CID_Builder*  builder,
-                          CID_Face      face,
+  void  CID_Init_Builder( CID_Builder*   builder,
+                          CID_Face       face,
                           CID_Size       size,
                           CID_GlyphSlot  glyph );
 
@@ -173,8 +173,8 @@
   LOCAL_DEF
   FT_Error  CID_Load_Glyph( CID_GlyphSlot  glyph,
                             CID_Size       size,
-                            FT_Int        glyph_index,
-                            FT_Int        load_flags );
+                            FT_Int         glyph_index,
+                            FT_Int         load_flags );
 
 
 #ifdef __cplusplus
diff --git a/src/cid/cidload.c b/src/cid/cidload.c
index 41b823d..1a0b538 100644
--- a/src/cid/cidload.c
+++ b/src/cid/cidload.c
@@ -83,8 +83,8 @@
 
 
   static
-  FT_Error  cid_load_keyword( CID_Face             face,
-                              CID_Loader*          loader,
+  FT_Error  cid_load_keyword( CID_Face              face,
+                              CID_Loader*           loader,
                               const CID_Field_Rec*  keyword )
   {
     FT_Error    error;
diff --git a/src/cid/cidobjs.h b/src/cid/cidobjs.h
index bbc391d..aec06c8 100644
--- a/src/cid/cidobjs.h
+++ b/src/cid/cidobjs.h
@@ -38,7 +38,7 @@
   /*************************************************************************/
   /*                                                                       */
   /* <Type>                                                                */
-  /*    CID_Driver                                                          */
+  /*    CID_Driver                                                         */
   /*                                                                       */
   /* <Description>                                                         */
   /*    A handle to a Type 1 driver object.                                */
@@ -49,7 +49,7 @@
   /*************************************************************************/
   /*                                                                       */
   /* <Type>                                                                */
-  /*    CID_Size                                                            */
+  /*    CID_Size                                                           */
   /*                                                                       */
   /* <Description>                                                         */
   /*    A handle to a Type 1 size object.                                  */
@@ -60,7 +60,7 @@
   /*************************************************************************/
   /*                                                                       */
   /* <Type>                                                                */
-  /*    CID_GlyphSlot                                                       */
+  /*    CID_GlyphSlot                                                      */
   /*                                                                       */
   /* <Description>                                                         */
   /*    A handle to a Type 1 glyph slot object.                            */
@@ -71,7 +71,7 @@
   /*************************************************************************/
   /*                                                                       */
   /* <Type>                                                                */
-  /*    CID_CharMap                                                         */
+  /*    CID_CharMap                                                        */
   /*                                                                       */
   /* <Description>                                                         */
   /*    A handle to a Type 1 character mapping object.                     */
@@ -81,7 +81,7 @@
   /*    The driver is responsible for making up charmap objects            */
   /*    corresponding to these tables.                                     */
   /*                                                                       */
-  typedef struct CID_CharMapRec_*   CID_CharMap;
+  typedef struct CID_CharMapRec_*  CID_CharMap;
 
 
   /*************************************************************************/
@@ -99,7 +99,7 @@
   } CID_SizeRec;
 
 
-  typedef struct  CID_GlyphSlotRec_
+  typedef struct CID_GlyphSlotRec_
   {
     FT_GlyphSlotRec  root;
 
diff --git a/src/cid/cidparse.c b/src/cid/cidparse.c
index e70d622..d4ec6bc 100644
--- a/src/cid/cidparse.c
+++ b/src/cid/cidparse.c
@@ -42,7 +42,7 @@
   /*************************************************************************/
   /*************************************************************************/
   /*****                                                               *****/
-  /*****           IMPLEMENTATION OF CID_TABLE OBJECT                   *****/
+  /*****           IMPLEMENTATION OF CID_TABLE OBJECT                  *****/
   /*****                                                               *****/
   /*************************************************************************/
   /*************************************************************************/
@@ -52,10 +52,10 @@
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
-  /*    CID_New_Table                                                       */
+  /*    CID_New_Table                                                      */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    Initializes a CID_Table.                                            */
+  /*    Initializes a CID_Table.                                           */
   /*                                                                       */
   /* <InOut>                                                               */
   /*    table  :: The address of the target table.                         */
@@ -71,8 +71,8 @@
   /*                                                                       */
   LOCAL_FUNC
   FT_Error  CID_New_Table( CID_Table*  table,
-                          FT_Int     count,
-                          FT_Memory  memory )
+                           FT_Int      count,
+                           FT_Memory   memory )
   {
     FT_Error  error;
 
@@ -99,7 +99,7 @@
 
   static
   void  shift_elements( CID_Table*  table,
-                        FT_Byte*   old_base )
+                        FT_Byte*    old_base )
   {
     FT_Long    delta  = table->block - old_base;
     FT_Byte**  offset = table->elements;
@@ -117,7 +117,7 @@
 
   static
   FT_Error  reallocate_t1_table( CID_Table*  table,
-                                 FT_Int     new_size )
+                                 FT_Int      new_size )
   {
     FT_Memory  memory   = table->memory;
     FT_Byte*   old_base = table->block;
@@ -141,10 +141,10 @@
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
-  /*    CID_Add_Table                                                       */
+  /*    CID_Add_Table                                                      */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    Adds an object to a CID_Table, possibly growing its memory block.   */
+  /*    Adds an object to a CID_Table, possibly growing its memory block.  */
   /*                                                                       */
   /* <InOut>                                                               */
   /*    table  :: The target table.                                        */
@@ -162,9 +162,9 @@
   /*                                                                       */
   LOCAL_FUNC
   FT_Error  CID_Add_Table( CID_Table*  table,
-                          FT_Int     index,
-                          void*      object,
-                          FT_Int     length )
+                           FT_Int      index,
+                           void*       object,
+                           FT_Int      length )
   {
     if ( index < 0 || index > table->max_elems )
     {
@@ -202,10 +202,10 @@
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
-  /*    CID_Done_Table                                                      */
+  /*    CID_Done_Table                                                     */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    Finalizes a CID_Table (reallocate it to its current cursor).        */
+  /*    Finalizes a CID_Table (reallocate it to its current cursor).       */
   /*                                                                       */
   /* <InOut>                                                               */
   /*    table :: The target table.                                         */
@@ -292,7 +292,7 @@
 
 
   LOCAL_FUNC
-  void  CID_ToToken( CID_Parser*    parser,
+  void  CID_ToToken( CID_Parser*     parser,
                      CID_Token_Rec*  token )
   {
     FT_Byte*  cur;
@@ -376,10 +376,10 @@
 
 
   LOCAL_FUNC
-  void  CID_ToTokenArray( CID_Parser*    parser,
+  void  CID_ToTokenArray( CID_Parser*     parser,
                           CID_Token_Rec*  tokens,
-                          FT_UInt        max_tokens,
-                          FT_Int*        pnum_tokens )
+                          FT_UInt         max_tokens,
+                          FT_Int*         pnum_tokens )
   {
     CID_Token_Rec  master;
 
@@ -390,8 +390,8 @@
 
     if ( master.type == t1_token_array )
     {
-      FT_Byte*       old_cursor = parser->cursor;
-      FT_Byte*       old_limit  = parser->limit;
+      FT_Byte*        old_cursor = parser->cursor;
+      FT_Byte*        old_limit  = parser->limit;
       CID_Token_Rec*  cur        = tokens;
       CID_Token_Rec*  limit      = cur + max_tokens;
 
@@ -710,9 +710,9 @@
   /* Loads a simple field (i.e. non-table) into the current */
   /* list of objects                                        */
   LOCAL_FUNC
-  FT_Error  CID_Load_Field( CID_Parser*          parser,
+  FT_Error  CID_Load_Field( CID_Parser*           parser,
                             const CID_Field_Rec*  field,
-                            void*                object )
+                            void*                 object )
   {
     CID_Token_Rec  token;
     FT_Byte*      cur;
@@ -803,16 +803,16 @@
 
 
   LOCAL_FUNC
-  FT_Error  CID_Load_Field_Table( CID_Parser*          parser,
+  FT_Error  CID_Load_Field_Table( CID_Parser*           parser,
                                   const CID_Field_Rec*  field,
-                                  void*                object )
+                                  void*                 object )
   {
     CID_Token_Rec   elements[T1_MAX_TABLE_ELEMENTS];
     CID_Token_Rec*  token;
-    FT_Int         num_elements;
-    FT_Error       error = 0;
-    FT_Byte*       old_cursor;
-    FT_Byte*       old_limit;
+    FT_Int          num_elements;
+    FT_Error        error = 0;
+    FT_Byte*        old_cursor;
+    FT_Byte*        old_limit;
     CID_Field_Rec   fieldrec = *(CID_Field_Rec*)field;
 
 
diff --git a/src/cid/cidparse.h b/src/cid/cidparse.h
index dff348b..092f40e 100644
--- a/src/cid/cidparse.h
+++ b/src/cid/cidparse.h
@@ -32,10 +32,10 @@
   /*************************************************************************/
   /*                                                                       */
   /* <Struct>                                                              */
-  /*    CID_Table                                                           */
+  /*    CID_Table                                                          */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    A CID_Table is a simple object used to store an array of objects    */
+  /*    A CID_Table is a simple object used to store an array of objects   */
   /*    in a single memory block.                                          */
   /*                                                                       */
   /* <Fields>                                                              */
@@ -62,7 +62,7 @@
   /*    memory    :: The memory object used for memory operations          */
   /*                 (allocation resp. reallocation).                      */
   /*                                                                       */
-  typedef struct  CID_Table_
+  typedef struct CID_Table_
   {
     FT_Byte*   block;          /* current memory block           */
     FT_Int     cursor;         /* current cursor in memory block */
@@ -81,14 +81,14 @@
 
   LOCAL_DEF
   FT_Error  CID_New_Table( CID_Table*  table,
-                          FT_Int     count,
-                          CID_Memory  memory );
+                           FT_Int       count,
+                           CID_Memory   memory );
 
   LOCAL_DEF
   FT_Error  CID_Add_Table( CID_Table*  table,
-                          FT_Int     index,
-                          void*      object,
-                          FT_Int     length );
+                           FT_Int      index,
+                           void*       object,
+                           FT_Int      length );
 
   LOCAL_DEF
   void  CID_Release_Table( CID_Table*  table );
@@ -183,7 +183,7 @@
 
 
   /* simple enumeration type used to identify token types */
-  typedef enum  CID_Token_Type_
+  typedef enum CID_Token_Type_
   {
     t1_token_none = 0,
     t1_token_any,
@@ -199,9 +199,9 @@
   /* a simple structure used to identify tokens */
   typedef struct CID_Token_Rec_
   {
-    FT_Byte*       start;   /* first character of token in input stream */
-    FT_Byte*       limit;   /* first character after the token          */
-    CID_Token_Type  type;    /* type of token..                          */
+    FT_Byte*        start;   /* first character of token in input stream */
+    FT_Byte*        limit;   /* first character after the token          */
+    CID_Token_Type  type;    /* type of token                            */
 
   } CID_Token_Rec;
 
@@ -212,7 +212,7 @@
 
 
   /* enumeration type used to identify object fields */
-  typedef enum  CID_Field_Type_
+  typedef enum CID_Field_Type_
   {
     t1_field_none = 0,
     t1_field_bool,
@@ -228,7 +228,7 @@
 
   } CID_Field_Type;
 
-  typedef enum  CID_Field_Location_
+  typedef enum CID_Field_Location_
   {
     t1_field_cid_info,
     t1_field_font_dict,
@@ -245,17 +245,17 @@
                                          CID_Parser*  parser );
 
   /* structure type used to model object fields */
-  typedef struct  CID_Field_Rec_
+  typedef struct CID_Field_Rec_
   {
-    const char*        ident;         /* field identifier                  */
+    const char*         ident;        /* field identifier                  */
     CID_Field_Location  location;
-    CID_Field_Type      type;          /* type of field                     */
-    CID_Field_Parser   reader;
-    FT_UInt            offset;        /* offset of field in object         */
-    FT_UInt            size;          /* size of field in bytes            */
-    FT_UInt            array_max;     /* maximal number of elements for    */
+    CID_Field_Type      type;         /* type of field                     */
+    CID_Field_Parser    reader;
+    FT_UInt             offset;       /* offset of field in object         */
+    FT_UInt             size;         /* size of field in bytes            */
+    FT_UInt             array_max;    /* maximal number of elements for    */
                                       /* array                             */
-    FT_UInt            count_offset;  /* offset of element count for       */
+    FT_UInt             count_offset; /* offset of element count for       */
                                       /* arrays                            */
   } CID_Field_Rec;
 
@@ -263,83 +263,83 @@
 #define CID_FIELD_REF( s, f )  ( ((s*)0)->f )
 
 #define CID_NEW_SIMPLE_FIELD( _ident, _type, _fname )         \
-          {                                                  \
-            _ident, T1CODE, _type,                           \
-            0,                                               \
+          {                                                   \
+            _ident, T1CODE, _type,                            \
+            0,                                                \
             (FT_UInt)(char*)&CID_FIELD_REF( T1TYPE, _fname ), \
             sizeof ( CID_FIELD_REF( T1TYPE, _fname ) ),       \
-            0, 0                                             \
+            0, 0                                              \
           },
 
 #define CID_NEW_CALLBACK_FIELD( _ident, _reader ) \
-          {                                      \
-            _ident, T1CODE, t1_field_callback,   \
-            _reader,                             \
-            0, 0,                                \
-            0, 0                                 \
+          {                                       \
+            _ident, T1CODE, t1_field_callback,    \
+            _reader,                              \
+            0, 0,                                 \
+            0, 0                                  \
           },
 
 #define CID_NEW_TABLE_FIELD( _ident, _type, _fname, _max )           \
-          {                                                         \
-            _ident, T1CODE, _type,                                  \
-            0,                                                      \
+          {                                                          \
+            _ident, T1CODE, _type,                                   \
+            0,                                                       \
             (FT_UInt)(char*)&CID_FIELD_REF( T1TYPE, _fname ),        \
             sizeof ( CID_FIELD_REF( T1TYPE, _fname )[0] ),           \
-            _max,                                                   \
+            _max,                                                    \
             (FT_UInt)(char*)&CID_FIELD_REF( T1TYPE, num_ ## _fname ) \
           },
 
 #define CID_NEW_TABLE_FIELD2( _ident, _type, _fname, _max )   \
-          {                                                  \
-            _ident, T1CODE, _type,                           \
-            0,                                               \
+          {                                                   \
+            _ident, T1CODE, _type,                            \
+            0,                                                \
             (FT_UInt)(char*)&CID_FIELD_REF( T1TYPE, _fname ), \
             sizeof ( CID_FIELD_REF( T1TYPE, _fname )[0] ),    \
-            _max, 0                                          \
+            _max, 0                                           \
           },
 
 
-#define CID_FIELD_BOOL( _ident, _fname )                        \
+#define CID_FIELD_BOOL( _ident, _fname )                           \
           CID_NEW_SIMPLE_FIELD( _ident, t1_field_bool, _fname )
 
 #define CID_FIELD_NUM( _ident, _fname )                            \
           CID_NEW_SIMPLE_FIELD( _ident, t1_field_integer, _fname )
 
-#define CID_FIELD_FIXED( _ident, _fname )                        \
+#define CID_FIELD_FIXED( _ident, _fname )                          \
           CID_NEW_SIMPLE_FIELD( _ident, t1_field_fixed, _fname )
 
-#define CID_FIELD_STRING( _ident, _fname )                        \
+#define CID_FIELD_STRING( _ident, _fname )                         \
           CID_NEW_SIMPLE_FIELD( _ident, t1_field_string, _fname )
 
-#define CID_FIELD_NUM_TABLE( _ident, _fname, _fmax )           \
-          CID_NEW_TABLE_FIELD( _ident, t1_field_integer_array, \
+#define CID_FIELD_NUM_TABLE( _ident, _fname, _fmax )               \
+          CID_NEW_TABLE_FIELD( _ident, t1_field_integer_array,     \
                               _fname, _fmax )
 
-#define CID_FIELD_FIXED_TABLE( _ident, _fname, _fmax )       \
-          CID_NEW_TABLE_FIELD( _ident, t1_field_fixed_array, \
+#define CID_FIELD_FIXED_TABLE( _ident, _fname, _fmax )             \
+          CID_NEW_TABLE_FIELD( _ident, t1_field_fixed_array,       \
                               _fname, _fmax )
 
-#define CID_FIELD_NUM_TABLE2( _ident, _fname, _fmax )           \
-          CID_NEW_TABLE_FIELD2( _ident, t1_field_integer_array, \
+#define CID_FIELD_NUM_TABLE2( _ident, _fname, _fmax )              \
+          CID_NEW_TABLE_FIELD2( _ident, t1_field_integer_array,    \
                                _fname, _fmax )
 
-#define CID_FIELD_FIXED_TABLE2( _ident, _fname, _fmax )       \
-          CID_NEW_TABLE_FIELD2( _ident, t1_field_fixed_array, \
+#define CID_FIELD_FIXED_TABLE2( _ident, _fname, _fmax )            \
+          CID_NEW_TABLE_FIELD2( _ident, t1_field_fixed_array,      \
                                _fname, _fmax )
 
-#define CID_FIELD_CALLBACK( _ident, _name )                 \
+#define CID_FIELD_CALLBACK( _ident, _name )                        \
           CID_NEW_CALLBACK_FIELD( _ident, parse_ ## _name )
 
 
   LOCAL_DEF
-  FT_Error  CID_Load_Field( CID_Parser*          parser,
+  FT_Error  CID_Load_Field( CID_Parser*           parser,
                             const CID_Field_Rec*  field,
-                            void*                object );
+                            void*                 object );
 
   LOCAL_DEF
-  FT_Error  CID_Load_Field_Table( CID_Parser*          parser,
+  FT_Error  CID_Load_Field_Table( CID_Parser*           parser,
                                   const CID_Field_Rec*  field,
-                                  void*                object );
+                                  void*                 object );
 
 
 #ifdef __cplusplus
diff --git a/src/cid/cidriver.c b/src/cid/cidriver.c
index 11be5c7..7f07868 100644
--- a/src/cid/cidriver.c
+++ b/src/cid/cidriver.c
@@ -181,9 +181,9 @@
       "t1cid",   /* module name           */
       0x10000L,  /* version 1.0 of driver */
       0x20000L,  /* requires FreeType 2.0 */
-      
+
       0,
-      
+
       (FT_Module_Constructor)CID_Init_Driver,
       (FT_Module_Destructor) CID_Done_Driver,
       (FT_Module_Requester)  CID_Get_Interface
diff --git a/src/macfond/fonddrvr.c b/src/macfond/fonddrvr.c
index 8066d0d..ce0a2a5 100644
--- a/src/macfond/fonddrvr.c
+++ b/src/macfond/fonddrvr.c
@@ -427,7 +427,7 @@ error:
         return FT_Err_Out_Of_Memory;
       }
 
- #if 0
+#if 0
       {
         FILE* f;
         char * path;
diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c
index acdbb75..906d0e0 100644
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -244,9 +244,10 @@
     FT_Error         error;
     SFNT_Interface*  sfnt = (SFNT_Interface*)face->sfnt;
 
-    UNUSED(face_index);
-    UNUSED(num_params);
-    UNUSED(params);
+    UNUSED( face_index );
+    UNUSED( num_params );
+    UNUSED( params );
+
 
     /* Load tables */
     if ( LOAD_( header )        ||
diff --git a/src/smooth/ftgrays.h b/src/smooth/ftgrays.h
index feb7484..51f44ce 100644
--- a/src/smooth/ftgrays.h
+++ b/src/smooth/ftgrays.h
@@ -42,8 +42,8 @@
 
   FT_EXPORT_VAR(FT_Raster_Funcs)  ft_grays_raster;
 
-  #ifdef __cplusplus
+#ifdef __cplusplus
   }
-  #endif
+#endif
 
 #endif
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index e2cbbad..7ca8077 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -920,6 +920,7 @@
             FT_Vector*  p1;
             FT_Vector*  p2;
 
+
             if ( start_point + k >= (FT_UInt)num_base_points ||
                                l >= (FT_UInt)num_new_points  )
             {
@@ -1023,8 +1024,8 @@
           pp1[0] = loader->pp1;
           pp1[1] = loader->pp2;
 
+          pts->tags[num_points    ] = 0;
           pts->tags[num_points + 1] = 0;
-          pts->tags[num_points + 2] = 0;
 
           /* if hinting, round the phantom points */
           if ( IS_HINTED( loader->load_flags ) )
diff --git a/src/type1z/z1parse.c b/src/type1z/z1parse.c
index 992d39b..06e1069 100644
--- a/src/type1z/z1parse.c
+++ b/src/type1z/z1parse.c
@@ -244,10 +244,10 @@
 /*************************************************************************/
 /*************************************************************************/
 
-  #define IS_Z1_WHITESPACE(c)  ( (c) == ' '  || (c) == '\t' )
-  #define IS_Z1_LINESPACE(c)   ( (c) == '\r' || (c) == '\n' )
+#define IS_Z1_WHITESPACE(c)  ( (c) == ' '  || (c) == '\t' )
+#define IS_Z1_LINESPACE(c)   ( (c) == '\r' || (c) == '\n' )
 
-  #define IS_Z1_SPACE(c)  ( IS_Z1_WHITESPACE(c) || IS_Z1_LINESPACE(c) )
+#define IS_Z1_SPACE(c)  ( IS_Z1_WHITESPACE(c) || IS_Z1_LINESPACE(c) )
 
   LOCAL_FUNC
   void     Z1_Skip_Spaces( Z1_Parser*  parser )