Commit b211651ac9a40f3ed2d25474dcf9a9e09c8a81dd

Werner Lemberg 2008-09-12T16:27:48

* autogen.sh, builds/unix/configure.raw, include/freetype/config/ftconfig.h, builds/unix/ftconfig.in: Minor beautifying. * include/freetype/ftadvanc.h, include/freetype/ftgasp.h, include/freetype/ftlcdfil.h: Protect against FreeType 1. Some other minor fixes. * devel/ftoption.h: Synchronize with include/freetype/config/ftoption.h. Formatting, documentation improvements.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
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
diff --git a/ChangeLog b/ChangeLog
index 93cd1e4..47ea642 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,62 +1,129 @@
+2008-09-13  Werner Lemberg  <wl@gnu.org>
+
+	* autogen.sh, builds/unix/configure.raw,
+	include/freetype/config/ftconfig.h, builds/unix/ftconfig.in: Minor
+	beautifying.
+
+	* include/freetype/ftadvanc.h, include/freetype/ftgasp.h,
+	include/freetype/ftlcdfil.h: Protect against FreeType 1.
+	Some other minor fixes.
+
+	* devel/ftoption.h: Synchronize with
+	include/freetype/config/ftoption.h.
+
 2008-09-11  Werner Lemberg  <wl@gnu.org>
 
 	* src/base/ftbase.c: Include ftadvanc.c.
 
-2008-09-11  suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+2008-09-11  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
 	* builds/unix/ftconfig.in: Duplicate the cpp computation of
 	FT_SIZEOF_{INT|LONG} from include/freetype/config/ftconfig.h.
-	If FT_USE_AUTOCONF_SIZEOF_TYPES is defined, the cpp computation
-	is disabled and the statically configured sizes are used.
-	This fixes Savannah bug #21250
-
-	* builds/unix/configure.raw: Add the checks to compare the
-	cpp computation results of the bit length of int and long
-	versus the sizes detected by running configure. If the results
-	are different, FT_USE_AUTOCONF_SIZEOF_TYPES is defined to
-	prioritize the results detected by running configure.
-	New option --{enable|disable}-biarch-config is added to
-	define or undefine FT_USE_AUTOCONF_SIZEOF_TYPES manually.
-
-2008-09-05  suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
-	* builds/unix/configure.raw: Clear FT2_EXTRA_LIBS when Carbon
-	or ApplicationService framework is missing. Although this
-	value is not used in building of FreeType2, it is written in
-	freetype2.pc and freetype-config.
-
-2008-09-01  david turner <david@freetype.org>
-
-	* include/freetype/ftcache.h, src/cache/ftccmap.c:
-	modify FTC_CMapCache_Lookup to accept a negative cmap index
-	to mean "use default cached FT_Face's charmap". This fixes
-	Savannah issue #22625
-
-	* include/freetype/ftoption.h, include/freetype/ftconfig.h,
-	builds/unix/ftconfig.in, include/freetype/freetype.h,
-	src/base/ftcalc.c:
-	Make FT_MulFix an inlined function. Also provide an assembler
-	implementation for ARM architectures. this is done to speedup
+	(FT_USE_AUTOCONF_SIZEOF_TYPES): New macro.  If defined, the cpp
+	computation is disabled and the statically configured sizes are
+	used.  This fixes Savannah bug #21250.
+
+	* builds/unix/configure.raw: Add the checks to compare the cpp
+	computation results of the bit length of int and long versus the
+	sizes detected by running `configure'.  If the results are
+	different, FT_USE_AUTOCONF_SIZEOF_TYPES is defined to prioritize the
+	results.
+	New option --{enable|disable}-biarch-config is added to define or
+	undefine FT_USE_AUTOCONF_SIZEOF_TYPES manually.
+
+2008-09-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+	* builds/unix/configure.raw: Clear FT2_EXTRA_LIBS when Carbon or
+	ApplicationService framework is missing.  Although this value is not
+	used in building of FreeType2, it is written in `freetype2.pc' and
+	`freetype-config'.
+
+2008-09-01  david turner  <david@freetype.org>
+
+	* src/cache/ftccmap.c (FTC_CMapCache_Lookup): Accept a negative cmap
+	index to mean `use default cached FT_Face's charmap'.  This fixes
+	Savannah bug #22625.
+	* include/freetype/ftcache.h: Document it.
+
+
+	Make FT_MulFix an inlined function.  This is done to speed up
 	FreeType a little (on x86 3% when loading+hinting, 10% when
-	rendering, ARM savings are more important though).
-	Disable this by undefining FT_CONFIG_OPTION_INLINE_MULFIX in
-	ftconfig.h
-
-	* include/freetype/ftadvanc.h, src/base/ftadvanc.c,
-	include/freetype/config/ftheader.h, include/freetype/freetype.h,
-	src/base/Jamfile, src/base/rules.mk, src/cff/cffdrivr.c,
-	src/cff/cffgload.c, src/cff/cffgload.h, src/truetype/ttdriver.c,
-	src/truetype/ttgload.h, src/truetype/ttgload.c, src/type1/t1driver.c,
-	src/type1/t1gload.h, src/type1/t1gload.c:
-	Add a new header named FT_ADVANCES_H declaring some new APIs
-	to extract the advances of one or more glyphs without necessarily
-	loading their outlines. Also provide 'fast loaders' for the
-	TrueType, Type1 and CFF font drivers (more to come later) 
-
-	* autogen.sh: add checks for minimum version of the 'autotools'
-	stuff.
-
-2008-08-29  suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+	rendering, ARM savings are more important though).  Disable this by
+	undefining FT_CONFIG_OPTION_INLINE_MULFIX.
+
+	Use of assembler code can now be controlled with
+	FT_CONFIG_OPTION_NO_ASSEMBLER.
+
+	* include/freetype/config/ftconfig.h, builds/unix/ftconfig.in
+	[!FT_CONFIG_OPTION_NO_ASSEMBLER] (FT_MulFix_arm): New assembler
+	implementation.
+	[!FT_CONFIG_OPTION_NO_ASSEMBLER] (FT_MulFix_i386): Assembler
+	implementation taken from `ftcalc.c'.
+	[!FT_CONFIG_OPTION_NO_ASSEMBLER] (FT_MULFIX_ASSEMBLER): New macro
+	which is defined to the platform-specific assembler implementation
+	of FT_MulFix.
+	[FT_CONFIG_OPTION_INLINE_MULFIX && FT_MULFIX_ASSEMBLER]
+	(FT_MULFIX_INLINED): New macro.
+
+	* include/freetype/config/ftoption.h (FT_CONFIG_OPTION_NO_ASSEMBLER,
+	FT_CONFIG_OPTION_INLINE_MULFIX): New macros.
+
+	* include/freetype/freetype.h: Updated to handle FT_MULFIX_INLINED.
+
+	* src/base/ftcalc.c: Updated to use FT_MULFIX_ASSEMBLER and
+	FT_MULFIX_INLINED.
+
+
+	Add a new header named FT_ADVANCES_H declaring some new APIs to
+	extract the advances of one or more glyphs without necessarily
+	loading their outlines.  Also provide `fast loaders' for the
+	TrueType, Type1, and CFF font drivers (more to come later).
+
+	* src/base/ftadvanc.c, include/freetype/ftadvanc.h: New files.
+
+	* include/freetype/config/ftheader.h (FT_ADVANCES_H): New macro.
+	* include/freetype/freetype.h (FT_LOAD_ADVANCE_ONLY): New macro.
+
+	* include/freetype/internal/ftdriver.h (FT_Face_GetAdvancesFunc):
+	`flags' and `advances' are now of type `FT_UInt' and `FT_Fixed',
+	respectively.
+
+	* src/base/Jamfile (_sources), src/base/rules.mk (BASE_SRC): Add
+	ftadvanc.c.
+
+	* src/cff/cffdrivr.c (cff_get_advances): New function.
+	(cff_driver_class): Register it.
+
+	* src/cff/cffgload.c (cff_decoder_set_width_only): New function.
+	(cff_decoder_parse_charstrings): Handle `width_only'.
+	(cff_slot_load): Handle FT_LOAD_ADVANCE_ONLY.
+
+	* src/cff/cffgload.h (cff_decoder): New element `width_only'.
+	(cff_decoder_set_width_only): New declaration.
+
+	* src/truetype/ttdriver.c (tt_get_advances): New function.
+	(tt_driver_class): Register it.
+
+	* src/truetype/ttgload.c (Get_HMetrics, Get_VMetrics): Renamed to...
+	(TT_Get_HMetrics, TT_Get_VMetrics): This.
+	Update callers.
+	* src/truetype/ttgload.h: Declare them.
+
+	* src/type1/t1gload.h, src/type1/t1gload.c (T1_Get_Advances): New
+	function.
+	* src/type1/t1driver.c (t1_driver_class): Register T1_Get_Advances.
+
+
+	Add checks for minimum version of the `autotools' stuff.
+
+	* autogen.sh: Implement it.
+	(get_major_version, get_minor_version, get_patch_version,
+	compare_to_minimum_version, check_tool_version): New auxiliary
+	functions.
+
+	* README.CVS: Document it.
+
+2008-08-29  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
 	* src/sfnt/sfobjs.c (sfnt_open_font): Use TTAG_OTTO defined in
 	ttags.h instead of FT_MAKE_TAG( 'O', 'T', 'T', 'O' ).
@@ -73,7 +140,7 @@
 	(afm_compare_kern_pairs): Fix comparison.  This fixes Savannah bug
 	#24119.
 
-2008-08-19  suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+2008-08-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
 	* src/base/ftobjs.c (FT_Stream_New): Initialize *astream always,
 	even if passed library or arguments are invalid.  This fixes a bug
@@ -83,7 +150,7 @@
 	(FT_Open_Face): Ditto (stream).
 	(load_face_in_embedded_rfork): Ditto (stream2).
 
-2008-08-18  suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+2008-08-18  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
 	* src/base/ftmac.c: Add a fallback to guess the availability of the
 	`ResourceIndex' type.  It is used when built without configure
@@ -92,13 +159,13 @@
 	* builds/unix/configure.raw: Set HAVE_TYPE_RESOURCE_INDEX to 1 or 0
 	explicitly, even if `ResourceIndex' is unavailable.
 
-2008-08-18  suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+2008-08-18  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
 	* builds/unix/configure.raw: In checking of Mac OS X features,
 	all-in-one header file `Carbon.h' is replaced by the minimum
 	header file `CoreServices.h', similar to current src/base/ftmac.c.
 
-2008-08-18  suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+2008-08-18  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
 	* src/sfnt/ttcmap.c (tt_cmap2_validate): Skip the validation of
 	sub-header when its code_count is 0.  Many Japanese Dynalab fonts
@@ -285,7 +352,7 @@
 	* src/tools/docmaker/tohtml.py (make_html_para): Implement it.
 	Update header files accordingly.
 
-2008-06-24  suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+2008-06-24  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
 	* builds/unix/configure.raw: Check type `ResourceIndex' explicitly
 	and define HAVE_TYPE_RESOURCE_INDEX if it is defined.  Mac OS X 10.5
@@ -318,7 +385,7 @@
 
 	* docs/CHANGES: Updated.
 
-2008-06-22  suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+2008-06-22  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
 	* builds/unix/configure.raw: If CFLAGS has `-isysroot XXX' option
 	but LDFLAGS does not, import it to LDFLAGS.  The option is used to
@@ -549,7 +616,7 @@
 
 	* docs/CHANGES: Updated.
 
-2008-05-18  David Turner <david@freetype.org>
+2008-05-18  David Turner  <david@freetype.org>
 
 	* src/psnames/psmodule.c (ft_wgl_extra_unicodes,
 	ft_wgl_extra_glyph_names, ft_wgl_extra_glyph_name_offsets,
@@ -1869,7 +1936,7 @@
 	* src/base/ftglyph.c (FT_Glyph_Copy): Always set second argument to
 	zero in case of error.  This fixes Savannah bug #19689.
 
-2007-04-25  Boris Letocha <b.letocha@cz.gmc.net>
+2007-04-25  Boris Letocha  <b.letocha@cz.gmc.net>
 
 	* src/truetype/ttobjs.c: Fix a typo that created a speed regression
 	in the TrueType bytecode loader.
diff --git a/README.CVS b/README.CVS
index 676578f..ff1a2d0 100644
--- a/README.CVS
+++ b/README.CVS
@@ -13,13 +13,13 @@ The versions given  in parentheses are known to  work.  Newer versions
 should work too, of course.   Note that autogen.sh also sets up proper
 file permissions for the `configure' and auxiliary scripts.
 
-The autogen.sh script now checks the version of your installed auto tools
-to see if they match the numbers above. If not, it will complain and suggest
-either upgrading or using an environment variable to point to a more recent
-version of the required tool(s).
+The autogen.sh script  now checks the version of  above three packages
+whether they match the numbers  above.  Otherwise it will complain and
+suggest either upgrading or using  an environment variable to point to
+a more recent version of the required tool(s).
 
-Note that 'aclocal' is provided by the 'automake' package on Linux, and
-that 'libtoolize' is called 'glibtoolize' on Darwin (OS X)
+Note that  `aclocal' is provided  by the `automake' package  on Linux,
+and that `libtoolize' is called `glibtoolize' on Darwin (OS X).
 
 
 For static builds which  don't use platform specific optimizations, no
diff --git a/autogen.sh b/autogen.sh
index c167abb..7e86882 100644
--- a/autogen.sh
+++ b/autogen.sh
@@ -20,78 +20,78 @@ run ()
   fi
 }
 
-# extract major version
 get_major_version ()
 {
-    echo $1 | sed -e 's/\([0-9]\+\)\..*/\1/g'
+  echo $1 | sed -e 's/\([0-9]\+\)\..*/\1/g'
 }
 
 get_minor_version ()
 {
-    echo $1 | sed -e 's/[0-9]\+\.\([0-9]\+\).*/\1/g'
+  echo $1 | sed -e 's/[0-9]\+\.\([0-9]\+\).*/\1/g'
 }
 
 get_patch_version ()
 {
-    # tricky, some version numbers don't include a patch
-    # separated with a point, but something like 1.4-p6
-    #
-    patch=`echo $1 | sed -e 's/[0-9]\+\.[0-9]\+\.\([0-9]\+\).*/\1/g'`
+  # tricky: some version numbers don't include a patch
+  # separated with a point, but something like 1.4-p6
+  patch=`echo $1 | sed -e 's/[0-9]\+\.[0-9]\+\.\([0-9]\+\).*/\1/g'`
+  if test "$patch" = "$1"; then
+    patch=`echo $1 | sed -e 's/[0-9]\+\.[0-9]\+\-p\([0-9]\+\).*/\1/g'`
+    # if there isn't any patch number, default to 0
     if test "$patch" = "$1"; then
-      patch=`echo $1 | sed -e 's/[0-9]\+\.[0-9]\+\-p\([0-9]\+\).*/\1/g'`
-      # if there isn't any patch number, default to 0
-      if test "$patch" = "$1"; then
-        patch=0
-      fi
+      patch=0
     fi
-    echo $patch
+  fi
+  echo $patch
 }
 
 # $1: version to check
 # $2: minimum version
+
 compare_to_minimum_version ()
 {
-    MAJOR1=`get_major_version $1`
-    MAJOR2=`get_major_version $2`
-    if test $MAJOR1 -lt $MAJOR2; then
-      echo 0
+  MAJOR1=`get_major_version $1`
+  MAJOR2=`get_major_version $2`
+  if test $MAJOR1 -lt $MAJOR2; then
+    echo 0
+    return
+  else 
+    if test $MAJOR1 -gt $MAJOR2; then
+      echo 1
       return
-    else 
-      if test $MAJOR1 -gt $MAJOR2; then
-        echo 1
-        return
-      fi
     fi
+  fi
 
-    MINOR1=`get_minor_version $1`
-    MINOR2=`get_minor_version $2`
-    if test $MINOR1 -lt $MINOR2; then
-      echo 0
+  MINOR1=`get_minor_version $1`
+  MINOR2=`get_minor_version $2`
+  if test $MINOR1 -lt $MINOR2; then
+    echo 0
+    return
+  else 
+    if test $MINOR1 -gt $MINOR2; then
+      echo 1
       return
-    else 
-      if test $MINOR1 -gt $MINOR2; then
-        echo 1
-        return
-      fi
     fi
+  fi
 
-    PATCH1=`get_patch_version $1`
-    PATCH2=`get_patch_version $2`
-    if test $PATCH1 -lt $PATCH2; then
-        echo 0
-    else
-        echo 1
-    fi
+  PATCH1=`get_patch_version $1`
+  PATCH2=`get_patch_version $2`
+  if test $PATCH1 -lt $PATCH2; then
+    echo 0
+  else
+    echo 1
+  fi
 }
 
-
-# check that version of a given tool against a minimum version number
+# check the version of a given tool against a minimum version number
+#
 # $1: tool path
-# $2: tool usual name (e.g. 'aclocal')
-# $3: tool variable  (e.g. 'ACLOCAL')
+# $2: tool usual name (e.g. `aclocal')
+# $3: tool variable  (e.g. `ACLOCAL')
 # $4: minimum version to check against
-# $5: option field index used to extract the tool version from the output of --version
-#
+# $5: option field index used to extract the tool version from the
+#     output of --version
+
 check_tool_version ()
 {
   field=$5
@@ -101,10 +101,11 @@ check_tool_version ()
   version=`$1 --version | head -1 | cut -d ' ' -f $field`
   version_check=`compare_to_minimum_version $version $4`
   if test "$version_check"x = 0x; then
-      echo "ERROR: You $2 version is too old. minimum version $4 is required (yours is $version)"
-      echo "please upgrade or use the $3 variable to point to a more recent one"
-      echo ""
-      exit 1
+    echo "ERROR: Your version of the \`$2' tool is too old."
+    echo "       Minimum version $4 is required (yours is version $version)."
+    echo "       Please upgrade or use the $3 variable to point to a more recent one."
+    echo ""
+    exit 1
   fi
 }
 
@@ -129,9 +130,9 @@ if test "$AUTOCONF"x = x; then
   AUTOCONF=autoconf
 fi
 
-check_tool_version $ACLOCAL    aclocal ACLOCAL  1.10.1
+check_tool_version $ACLOCAL    aclocal    ACLOCAL    1.10.1
 check_tool_version $LIBTOOLIZE libtoolize LIBTOOLIZE 2.2.4
-check_tool_version $AUTOCONF autoconf AUTOCONF 2.62
+check_tool_version $AUTOCONF   autoconf   AUTOCONF   2.62
 
 # This sets freetype_major, freetype_minor, and freetype_patch.
 eval `sed -nf version.sed include/freetype/freetype.h`
diff --git a/builds/unix/configure.raw b/builds/unix/configure.raw
index 140f55c..5f48d82 100644
--- a/builds/unix/configure.raw
+++ b/builds/unix/configure.raw
@@ -126,13 +126,14 @@ AC_CHECK_SIZEOF([int])
 AC_CHECK_SIZEOF([long])
 
 
-# checks for cpp computation of size of int and long ftconfig.in works
+# check whether cpp computation of size of int and long in ftconfig.in works
 
 AC_MSG_CHECKING([cpp computation of bit length in ftconfig.in works])
 orig_CPPFLAGS="${CPPFLAGS}"
 CPPFLAGS="-I${srcdir} -I. ${CPPFLAGS}"
 ac_clean_files="ft2build.h ftoption.h ftstdlib.h"
 touch ft2build.h ftoption.h ftstdlib.h
+
 cat > conftest.c <<\_ACEOF
 #include <limits.h>
 #define FT_CONFIG_OPTIONS_H "ftoption.h"
@@ -147,41 +148,45 @@ echo >> conftest.c "#endif"
 echo >> conftest.c "#if FT_SIZEOF_LONG == "${ac_cv_sizeof_long}
 echo >> conftest.c "ac_cpp_ft_sizeof_long="${ac_cv_sizeof_long}
 echo >> conftest.c "#endif"
+
 ${CPP} ${CPPFLAGS} conftest.c | ${GREP} ac_cpp_ft > conftest.sh
 eval `cat conftest.sh`
 ${RMF} conftest.c conftest.sh confft2build.h ftoption.h ftstdlib.h
-if test x != "x${ac_cpp_ft_sizeof_int}" -a x != x"${ac_cpp_ft_sizeof_long}"
-then
+
+if test x != "x${ac_cpp_ft_sizeof_int}" \
+   -a x != x"${ac_cpp_ft_sizeof_long}"; then
   unset ft_use_autoconf_sizeof_types
 else
-  ft_use_autoconf_sizeof_types="yes"
+  ft_use_autoconf_sizeof_types=yes
 fi
+
 AC_ARG_ENABLE(biarch-config,
 [  --enable-biarch-config  install biarch ftconfig.h to support multiple
-                          architechtures by single file], [], [])
+                          architectures by single file], [], [])
 
 case :${ft_use_autoconf_sizeof_types}:${enable_biarch_config}: in
-  :yes:yes: )
-    AC_MSG_RESULT([broken but use])
+  :yes:yes:)
+    AC_MSG_RESULT([broken but use it])
     unset ft_use_autoconf_sizeof_types
     ;;
-  ::no: )
-    AC_MSG_RESULT([works but ignore])
-    ft_use_autoconf_sizeof_types="yes"
+  ::no:)
+    AC_MSG_RESULT([works but ignore it])
+    ft_use_autoconf_sizeof_types=yes
     ;;
-  ::yes: | ::: )
+  ::yes: | :::)
     AC_MSG_RESULT([yes])
     unset ft_use_autoconf_sizeof_types
     ;;
-  * )
+  *)
     AC_MSG_RESULT([no])
-    ft_use_autoconf_sizeof_types="yes"
+    ft_use_autoconf_sizeof_types=yes
     ;;
 esac
-if test xyes = x"${ft_use_autoconf_sizeof_types}"
-then
+
+if test x"${ft_use_autoconf_sizeof_types}" = xyes; then
   AC_DEFINE([FT_USE_AUTOCONF_SIZEOF_TYPES])
 fi
+
 CPPFLAGS="${orig_CPPFLAGS}"
 
 
diff --git a/builds/unix/ftconfig.in b/builds/unix/ftconfig.in
index 311b03a..868189e 100644
--- a/builds/unix/ftconfig.in
+++ b/builds/unix/ftconfig.in
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    UNIX-specific configuration file (specification only).               */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007 by                   */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008 by             */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -77,11 +77,13 @@ FT_BEGIN_HEADER
 
 #undef FT_USE_AUTOCONF_SIZEOF_TYPES
 #ifdef FT_USE_AUTOCONF_SIZEOF_TYPES
+
 #undef SIZEOF_INT
 #undef SIZEOF_LONG
 #define FT_SIZEOF_INT  SIZEOF_INT
 #define FT_SIZEOF_LONG SIZEOF_LONG
-#else /* ! FT_USE_AUTOCONF_SIZEOF_TYPES */
+
+#else /* !FT_USE_AUTOCONF_SIZEOF_TYPES */
 
   /* Following cpp computation of the bit length of int and long */
   /* is copied from default include/freetype/config/ftconfig.h.  */
@@ -112,7 +114,8 @@ FT_BEGIN_HEADER
 #error "Unsupported size of `long' type!"
 #endif
 
-#endif /* ! FT_USE_AUTOCONF_SIZEOF_TYPES */
+#endif /* !FT_USE_AUTOCONF_SIZEOF_TYPES */
+
 
   /* Preferred alignment of data */
 #define FT_ALIGNMENT  8
@@ -242,79 +245,13 @@ FT_BEGIN_HEADER
 
 #endif /* FT_SIZEOF_LONG == 8 */
 
-#if !defined(FT_CONFIG_OPTION_NO_ASSEMBLER)
-/* provide assembler fragments for performance-critical
- * functions. these must be defined static __inline__
- * with GCC
- */
-#if defined(__GNUC__)
-
-#  if defined(__arm__) && !defined(__thumb__)
-#    define FT_MULFIX_ASSEMBLER   FT_MulFix_arm
-    static __inline__ FT_Int32
-    FT_MulFix_arm( FT_Int32  a, FT_Int32  b )
-    {
-        register FT_Int32  t, t2;
-        asm __volatile__ (
-            "smull  %1, %2, %4, %3\n\t"   /* (lo=%1,hi=%2) = a*b */
-            "mov    %0, %2, asr #31\n\t"  /* %0  = (hi >> 31) */
-            "add    %0, %0, #0x8000\n\t"  /* %0 += 0x8000 */
-            "adds   %1, %1, %0\n\t"       /* %1 += %0 */
-            "adc    %2, %2, #0\n\t"       /* %2 += carry */
-            "mov    %0, %1, lsr #16\n\t"  /* %0  = %1 >> 16 */
-            "orr    %0, %2, lsl #16\n\t"  /* %0 |= %2 << 16 */
-            : "=r"(a), "=&r"(t2), "=&r"(t)
-            : "r"(a), "r"(b)
-            );
-        return a;
-    }
-#  endif /* __arm__ */
-
-#  if defined(i386)
-#    define FT_MULFIX_ASSEMBLER  FT_MulFix_i386
-    static __inline__ FT_Int32
-    FT_MulFix_i386( FT_Int32  a, FT_Int32  b )
-    {
-        register FT_Int32  result;
-
-        __asm__ __volatile__ (
-          "imul  %%edx\n"
-          "movl  %%edx, %%ecx\n"
-          "sarl  $31, %%ecx\n"
-          "addl  $0x8000, %%ecx\n"
-          "addl  %%ecx, %%eax\n"
-          "adcl  $0, %%edx\n"
-          "shrl  $16, %%eax\n"
-          "shll  $16, %%edx\n"
-          "addl  %%edx, %%eax\n"
-          : "=a"(result), "+d"(b)
-          : "a"(a)
-          : "%ecx"
-        );
-        return result;
-    }
-#  endif /* i386 */
-#endif /* __GNUC__ */
-#endif /* !NO_ASSEMBLER */
-
-#ifdef FT_CONFIG_OPTION_INLINE_MULFIX
-#  ifdef FT_MULFIX_ASSEMBLER
-#    define FT_MULFIX_INLINED   FT_MULFIX_ASSEMBLER
-#  endif
-#endif
-
-
-#define FT_BEGIN_STMNT  do {
-#define FT_END_STMNT    } while ( 0 )
-#define FT_DUMMY_STMNT  FT_BEGIN_STMNT FT_END_STMNT
-
 
   /*************************************************************************/
   /*                                                                       */
   /* A 64-bit data type will create compilation problems if you compile    */
-  /* in strict ANSI mode.  To avoid them, we disable their use if          */
-  /* __STDC__ is defined.  You can however ignore this rule by             */
-  /* defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro.        */
+  /* in strict ANSI mode.  To avoid them, we disable its use if __STDC__   */
+  /* is defined.  You can however ignore this rule by defining the         */
+  /* FT_CONFIG_OPTION_FORCE_INT64 configuration macro.                     */
   /*                                                                       */
 #if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )
 
@@ -332,6 +269,82 @@ FT_BEGIN_HEADER
 #endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */
 
 
+#define FT_BEGIN_STMNT  do {
+#define FT_END_STMNT    } while ( 0 )
+#define FT_DUMMY_STMNT  FT_BEGIN_STMNT FT_END_STMNT
+
+
+#ifndef  FT_CONFIG_OPTION_NO_ASSEMBLER
+  /* Provide assembler fragments for performance-critical functions. */
+  /* These must be defined `static __inline__' with GCC.             */
+
+#ifdef __GNUC__
+
+#if defined( __arm__ ) && !defined( __thumb__ )
+#define FT_MULFIX_ASSEMBLER  FT_MulFix_arm
+
+  static __inline__ FT_Int32
+  FT_MulFix_arm( FT_Int32  a,
+                 FT_Int32  b )
+  {
+    register FT_Int32  t, t2;
+
+
+    asm __volatile__ (
+      "smull  %1, %2, %4, %3\n\t"   /* (lo=%1,hi=%2) = a*b */
+      "mov    %0, %2, asr #31\n\t"  /* %0  = (hi >> 31) */
+      "add    %0, %0, #0x8000\n\t"  /* %0 += 0x8000 */
+      "adds   %1, %1, %0\n\t"       /* %1 += %0 */
+      "adc    %2, %2, #0\n\t"       /* %2 += carry */
+      "mov    %0, %1, lsr #16\n\t"  /* %0  = %1 >> 16 */
+      "orr    %0, %2, lsl #16\n\t"  /* %0 |= %2 << 16 */
+      : "=r"(a), "=&r"(t2), "=&r"(t)
+      : "r"(a), "r"(b) );
+    return a;
+  }
+
+#endif /* __arm__ && !__thumb__ */
+
+#if defined( i386 )
+#define FT_MULFIX_ASSEMBLER  FT_MulFix_i386
+
+  static __inline__ FT_Int32
+  FT_MulFix_i386( FT_Int32  a,
+                  FT_Int32  b )
+  {
+    register FT_Int32  result;
+
+
+    __asm__ __volatile__ (
+      "imul  %%edx\n"
+      "movl  %%edx, %%ecx\n"
+      "sarl  $31, %%ecx\n"
+      "addl  $0x8000, %%ecx\n"
+      "addl  %%ecx, %%eax\n"
+      "adcl  $0, %%edx\n"
+      "shrl  $16, %%eax\n"
+      "shll  $16, %%edx\n"
+      "addl  %%edx, %%eax\n"
+      : "=a"(result), "+d"(b)
+      : "a"(a)
+      : "%ecx" );
+    return result;
+  }
+
+#endif /* i386 */
+
+#endif /* __GNUC__ */
+
+#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
+
+
+#ifdef FT_CONFIG_OPTION_INLINE_MULFIX
+#ifdef FT_MULFIX_ASSEMBLER
+#define FT_MULFIX_INLINED  FT_MULFIX_ASSEMBLER
+#endif
+#endif
+
+
 #ifdef FT_MAKE_OPTION_SINGLE_OBJECT
 
 #define FT_LOCAL( x )      static  x
diff --git a/devel/ftoption.h b/devel/ftoption.h
index b3bace1..c5d001b 100644
--- a/devel/ftoption.h
+++ b/devel/ftoption.h
@@ -117,6 +117,27 @@ FT_BEGIN_HEADER
 
   /*************************************************************************/
   /*                                                                       */
+  /* If this macro is defined, do not try to use an assembler version of   */
+  /* performance-critical functions (e.g. FT_MulFix).  You should only do  */
+  /* that to verify that the assembler function works properly, or to      */
+  /* execute benchmark tests of the various implementations.               */
+/* #define FT_CONFIG_OPTION_NO_ASSEMBLER */
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* If this macro is defined, try to use an inlined assembler version of  */
+  /* the `FT_MulFix' function, which is a `hotspot' when loading and       */
+  /* hinting glyphs, and which should be executed as fast as possible.     */
+  /*                                                                       */
+  /* Note that if your compiler or CPU is not supported, this will default */
+  /* to the standard and portable implementation found in `ftcalc.c'.      */
+  /*                                                                       */
+#define FT_CONFIG_OPTION_INLINE_MULFIX
+
+
+  /*************************************************************************/
+  /*                                                                       */
   /* LZW-compressed file support.                                          */
   /*                                                                       */
   /*   FreeType now handles font files that have been compressed with the  */
diff --git a/include/freetype/config/ftconfig.h b/include/freetype/config/ftconfig.h
index 0e9daf3..9e92e70 100644
--- a/include/freetype/config/ftconfig.h
+++ b/include/freetype/config/ftconfig.h
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    ANSI-specific configuration file (specification only).               */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007 by                   */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008 by             */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -43,6 +43,7 @@
 #include FT_CONFIG_OPTIONS_H
 #include FT_CONFIG_STANDARD_LIBRARY_H
 
+
 FT_BEGIN_HEADER
 
 
@@ -212,6 +213,7 @@ FT_BEGIN_HEADER
 #error "no 32bit type found -- please check your configuration files"
 #endif
 
+
   /* look up an integer type that is at least 32 bits */
 #if FT_SIZEOF_INT >= (32 / FT_CHAR_BIT)
 
@@ -225,67 +227,6 @@ FT_BEGIN_HEADER
 
 #endif
 
-#if !defined(FT_CONFIG_OPTION_NO_ASSEMBLER)
-/* provide assembler fragments for performance-critical
- * functions. these must be defined static __inline__
- * with GCC
- */
-#if defined(__GNUC__)
-
-#  if defined(__arm__) && !defined(__thumb__)
-#    define FT_MULFIX_ASSEMBLER   FT_MulFix_arm
-    static __inline__ FT_Int32
-    FT_MulFix_arm( FT_Int32  a, FT_Int32  b )
-    {
-        register FT_Int32  t, t2;
-        asm __volatile__ (
-            "smull  %1, %2, %4, %3\n\t"   /* (lo=%1,hi=%2) = a*b */
-            "mov    %0, %2, asr #31\n\t"  /* %0  = (hi >> 31) */
-            "add    %0, %0, #0x8000\n\t"  /* %0 += 0x8000 */
-            "adds   %1, %1, %0\n\t"       /* %1 += %0 */
-            "adc    %2, %2, #0\n\t"       /* %2 += carry */
-            "mov    %0, %1, lsr #16\n\t"  /* %0  = %1 >> 16 */
-            "orr    %0, %2, lsl #16\n\t"  /* %0 |= %2 << 16 */
-            : "=r"(a), "=&r"(t2), "=&r"(t)
-            : "r"(a), "r"(b)
-            );
-        return a;
-    }
-#  endif /* __arm__ */
-
-#  if defined(i386)
-#    define FT_MULFIX_ASSEMBLER  FT_MulFix_i386
-    static __inline__ FT_Int32
-    FT_MulFix_i386( FT_Int32  a, FT_Int32  b )
-    {
-        register FT_Int32  result;
-
-        __asm__ __volatile__ (
-          "imul  %%edx\n"
-          "movl  %%edx, %%ecx\n"
-          "sarl  $31, %%ecx\n"
-          "addl  $0x8000, %%ecx\n"
-          "addl  %%ecx, %%eax\n"
-          "adcl  $0, %%edx\n"
-          "shrl  $16, %%eax\n"
-          "shll  $16, %%edx\n"
-          "addl  %%edx, %%eax\n"
-          : "=a"(result), "+d"(b)
-          : "a"(a)
-          : "%ecx"
-        );
-        return result;
-    }
-#  endif /* i386 */
-#endif /* __GNUC__ */
-#endif /* !NO_ASSEMBLER */
-
-#ifdef FT_CONFIG_OPTION_INLINE_MULFIX
-#  ifdef FT_MULFIX_ASSEMBLER
-#    define FT_MULFIX_INLINED   FT_MULFIX_ASSEMBLER
-#  endif
-#endif
-
 
   /* determine whether we have a 64-bit int type for platforms without */
   /* Autoconf                                                          */
@@ -328,17 +269,12 @@ FT_BEGIN_HEADER
 #endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
 
 
-#define FT_BEGIN_STMNT  do {
-#define FT_END_STMNT    } while ( 0 )
-#define FT_DUMMY_STMNT  FT_BEGIN_STMNT FT_END_STMNT
-
-
   /*************************************************************************/
   /*                                                                       */
   /* A 64-bit data type will create compilation problems if you compile    */
-  /* in strict ANSI mode.  To avoid them, we disable their use if          */
-  /* __STDC__ is defined.  You can however ignore this rule by             */
-  /* defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro.        */
+  /* in strict ANSI mode.  To avoid them, we disable its use if __STDC__   */
+  /* is defined.  You can however ignore this rule by defining the         */
+  /* FT_CONFIG_OPTION_FORCE_INT64 configuration macro.                     */
   /*                                                                       */
 #if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )
 
@@ -353,6 +289,86 @@ FT_BEGIN_HEADER
 #endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */
 
 
+#define FT_BEGIN_STMNT  do {
+#define FT_END_STMNT    } while ( 0 )
+#define FT_DUMMY_STMNT  FT_BEGIN_STMNT FT_END_STMNT
+
+
+#ifndef  FT_CONFIG_OPTION_NO_ASSEMBLER
+  /* Provide assembler fragments for performance-critical functions. */
+  /* These must be defined `static __inline__' with GCC.             */
+
+#ifdef __GNUC__
+
+#if defined( __arm__ ) && !defined( __thumb__ )
+#define FT_MULFIX_ASSEMBLER  FT_MulFix_arm
+
+  /* documentation is in freetype.h */
+
+  static __inline__ FT_Int32
+  FT_MulFix_arm( FT_Int32  a,
+                 FT_Int32  b )
+  {
+    register FT_Int32  t, t2;
+
+
+    asm __volatile__ (
+      "smull  %1, %2, %4, %3\n\t"   /* (lo=%1,hi=%2) = a*b */
+      "mov    %0, %2, asr #31\n\t"  /* %0  = (hi >> 31) */
+      "add    %0, %0, #0x8000\n\t"  /* %0 += 0x8000 */
+      "adds   %1, %1, %0\n\t"       /* %1 += %0 */
+      "adc    %2, %2, #0\n\t"       /* %2 += carry */
+      "mov    %0, %1, lsr #16\n\t"  /* %0  = %1 >> 16 */
+      "orr    %0, %2, lsl #16\n\t"  /* %0 |= %2 << 16 */
+      : "=r"(a), "=&r"(t2), "=&r"(t)
+      : "r"(a), "r"(b) );
+    return a;
+  }
+
+#endif /* __arm__ && !__thumb__ */
+
+#if defined( i386 )
+#define FT_MULFIX_ASSEMBLER  FT_MulFix_i386
+
+  /* documentation is in freetype.h */
+
+  static __inline__ FT_Int32
+  FT_MulFix_i386( FT_Int32  a,
+                  FT_Int32  b )
+  {
+    register FT_Int32  result;
+
+
+    __asm__ __volatile__ (
+      "imul  %%edx\n"
+      "movl  %%edx, %%ecx\n"
+      "sarl  $31, %%ecx\n"
+      "addl  $0x8000, %%ecx\n"
+      "addl  %%ecx, %%eax\n"
+      "adcl  $0, %%edx\n"
+      "shrl  $16, %%eax\n"
+      "shll  $16, %%edx\n"
+      "addl  %%edx, %%eax\n"
+      : "=a"(result), "+d"(b)
+      : "a"(a)
+      : "%ecx" );
+    return result;
+  }
+
+#endif /* i386 */
+
+#endif /* __GNUC__ */
+
+#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
+
+
+#ifdef FT_CONFIG_OPTION_INLINE_MULFIX
+#ifdef FT_MULFIX_ASSEMBLER
+#define FT_MULFIX_INLINED  FT_MULFIX_ASSEMBLER
+#endif
+#endif
+
+
 #ifdef FT_MAKE_OPTION_SINGLE_OBJECT
 
 #define FT_LOCAL( x )      static  x
diff --git a/include/freetype/config/ftheader.h b/include/freetype/config/ftheader.h
index 4c3ce0a..b63945d 100644
--- a/include/freetype/config/ftheader.h
+++ b/include/freetype/config/ftheader.h
@@ -728,6 +728,7 @@
    */
 #define FT_GASP_H  <freetype/ftgasp.h>
 
+
   /*************************************************************************
    *
    * @macro:
@@ -735,9 +736,10 @@
    *
    * @description:
    *   A macro used in #include statements to name the file containing the
-   *   FreeType~2 API which returns individual and ranged glyph advances
+   *   FreeType~2 API which returns individual and ranged glyph advances.
    */
-#define FT_ADVANCES_H             <freetype/ftadvanc.h>
+#define FT_ADVANCES_H  <freetype/ftadvanc.h>
+
 
   /* */
 
diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h
index a92e19b..22f06ed 100644
--- a/include/freetype/config/ftoption.h
+++ b/include/freetype/config/ftoption.h
@@ -112,25 +112,26 @@ FT_BEGIN_HEADER
   /*         file `ftconfig.h' either statically or through the            */
   /*         `configure' script on supported platforms.                    */
   /*                                                                       */
-#undef  FT_CONFIG_OPTION_FORCE_INT64
+#undef FT_CONFIG_OPTION_FORCE_INT64
 
 
   /*************************************************************************/
   /*                                                                       */
-  /* When this macro is defined, do not try to use an assembler version    */
-  /* of performance-critical functions (e.g. FT_MulFix). you should only   */
-  /* do that to verify that the assembler function works properly, or even */
-  /* to benchmarks the various implementations...                          */
+  /* If this macro is defined, do not try to use an assembler version of   */
+  /* performance-critical functions (e.g. FT_MulFix).  You should only do  */
+  /* that to verify that the assembler function works properly, or to      */
+  /* execute benchmark tests of the various implementations.               */
 /* #define FT_CONFIG_OPTION_NO_ASSEMBLER */
 
+
   /*************************************************************************/
   /*                                                                       */
-  /* When this macro is defined, try to use an inlined assembler version   */
-  /* of the FT_MulFix function, which appears to be a hotspot when loading */
-  /* and hinting glyphs.                                                   */
+  /* If this macro is defined, try to use an inlined assembler version of  */
+  /* the `FT_MulFix' function, which is a `hotspot' when loading and       */
+  /* hinting glyphs, and which should be executed as fast as possible.     */
   /*                                                                       */
-  /* note that if your compiler/cpu isn't supported, this will default to  */
-  /* the standard and portable implementation found in src/base/ftcalc.c   */
+  /* Note that if your compiler or CPU is not supported, this will default */
+  /* to the standard and portable implementation found in `ftcalc.c'.      */
   /*                                                                       */
 #define FT_CONFIG_OPTION_INLINE_MULFIX
 
@@ -183,7 +184,7 @@ FT_BEGIN_HEADER
   /*   Do not #undef this macro here since the build system might define   */
   /*   it for certain configurations only.                                 */
   /*                                                                       */
-/* #define  FT_CONFIG_OPTION_SYSTEM_ZLIB */
+/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
 
 
   /*************************************************************************/
@@ -224,8 +225,8 @@ FT_BEGIN_HEADER
   /*   Do not #undef these macros here since the build system might define */
   /*   them for certain configurations only.                               */
   /*                                                                       */
-/* #define  FT_EXPORT(x)       extern x */
-/* #define  FT_EXPORT_DEF(x)   x */
+/* #define FT_EXPORT(x)      extern x */
+/* #define FT_EXPORT_DEF(x)  x */
 
 
   /*************************************************************************/
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index 9289ca5..5ddff69 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -1056,8 +1056,6 @@ FT_BEGIN_HEADER
 #define FT_FACE_FLAG_HINTER            ( 1L << 11 )
 #define FT_FACE_FLAG_CID_KEYED         ( 1L << 12 )
 
-  /* */
-
 
   /*************************************************************************
    *
@@ -1167,8 +1165,6 @@ FT_BEGIN_HEADER
 #define FT_HAS_FIXED_SIZES( face ) \
           ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )
 
-  /* */
-
 
   /*************************************************************************
    *
@@ -1231,7 +1227,7 @@ FT_BEGIN_HEADER
 
   /*************************************************************************/
   /*                                                                       */
-  /* <Constant>                                                            */
+  /* <Const>                                                               */
   /*    FT_STYLE_FLAG_XXX                                                  */
   /*                                                                       */
   /* <Description>                                                         */
@@ -2432,13 +2428,13 @@ FT_BEGIN_HEADER
 #define FT_LOAD_MONOCHROME                   0x1000
 #define FT_LOAD_LINEAR_DESIGN                0x2000
 #define FT_LOAD_NO_AUTOHINT                  0x8000U
-#define FT_LOAD_ADVANCE_ONLY                 0x10000U
-
-  /* used internally only by certain font drivers ! */
-#define FT_LOAD_SBITS_ONLY                   0x4000
+#define FT_LOAD_ADVANCE_ONLY                 0x10000UL
 
   /* */
 
+  /* used internally only by certain font drivers! */
+#define FT_LOAD_SBITS_ONLY                   0x4000
+
 
   /**************************************************************************
    *
@@ -3439,6 +3435,12 @@ FT_BEGIN_HEADER
              FT_Long  c );
 
 
+  /* */
+
+  /* The following #if 0 ... #endif is for the documentation formatter, */
+  /* hiding the internal `FT_MULFIX_INLINED' macro.                     */
+
+#if 0
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
@@ -3468,14 +3470,22 @@ FT_BEGIN_HEADER
   /*    _second_ argument of this function; this can make a great          */
   /*    difference.                                                        */
   /*                                                                       */
+  FT_EXPORT( FT_Long )
+  FT_MulFix( FT_Long  a,
+             FT_Long  b );
+
+  /* */
+#endif
+
 #ifdef FT_MULFIX_INLINED
-#  define  FT_MulFix(a,b)  FT_MULFIX_INLINED(a,b)
+#define FT_MulFix( a, b )  FT_MULFIX_INLINED( a, b )
 #else
   FT_EXPORT( FT_Long )
   FT_MulFix( FT_Long  a,
              FT_Long  b );
 #endif
 
+
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
diff --git a/include/freetype/ftadvanc.h b/include/freetype/ftadvanc.h
index 02befa1..1597f4f 100644
--- a/include/freetype/ftadvanc.h
+++ b/include/freetype/ftadvanc.h
@@ -2,9 +2,9 @@
 /*                                                                         */
 /*  ftadvanc.h                                                             */
 /*                                                                         */
-/*    FreeType access the glyph advances       (specification only).       */
+/*    Quick computation of advance widths (specification only).            */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by             */
+/*  Copyright 2008 by                                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -15,33 +15,64 @@
 /*                                                                         */
 /***************************************************************************/
 
-#ifndef __FREETYPE_ADVANCE_H__
-#define __FREETYPE_ADVANCE_H__
+
+#ifndef __FTADVANC_H__
+#define __FTADVANC_H__
+
 
 #include <ft2build.h>
 #include FT_FREETYPE_H
 
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+  /**************************************************************************
+   *
+   * @section:
+   *   quick_advance
+   *
+   * @title:
+   *   Quick retrieval of advance values
+   *
+   * @abstract:
+   *   Retrieve horizontal and vertical advance values without processing
+   *   glyph outlines, if possible.
+   *
+   * @description:
+   *   This section contains functions to quickly extract advance values
+   *   without handling glyph outlines, if possible.
+   */
+
+
   /*************************************************************************/
   /*                                                                       */
   /* <Const>                                                               */
   /*    FT_ADVANCE_FLAG_FAST_ONLY                                          */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    a bit-flag to be or-ed to the 'flags' parameter of the             */
-  /*    @FT_Get_Advance and @FT_Get_Advances.                              */
+  /*    A bit-flag to be OR-ed with the `flags' parameter of the           */
+  /*    @FT_Get_Advance and @FT_Get_Advances functions.                    */
   /*                                                                       */
-  /*    when set, it indicates that you want these functions to fail       */
-  /*    if the corresponding hinting mode or font driver doesn't           */
-  /*    allow for very quick advance computation.                          */
+  /*    If set, it indicates that you want these functions to fail if the  */
+  /*    corresponding hinting mode or font driver doesn't allow for very   */
+  /*    quick advance computation.                                         */
   /*                                                                       */
-  /*    typically, unscaled, unhinted, bitmapped and light-hinted glyphs   */
-  /*    can have their advance width(s) computed very quickly.             */
+  /*    Typically, glyphs which are either unscaled, unhinted, bitmapped,  */
+  /*    or light-hinted can have their advance width computed very         */
+  /*    quickly.                                                           */
   /*                                                                       */
-  /*    not so for normal and bytecode hinted modes, which require         */
-  /*    loading/scaling/hinting the glyph outline instead, which is        */
-  /*    extremely slow by comparison                                       */
+  /*    Normal and bytecode hinted modes, which require loading, scaling,  */
+  /*    and hinting of the glyph outline, are extremely slow by            */
+  /*    comparison.                                                        */
   /*                                                                       */
-#define  FT_ADVANCE_FLAG_FAST_ONLY   0x20000000U
+#define FT_ADVANCE_FLAG_FAST_ONLY  0x20000000UL
 
 
   /*************************************************************************/
@@ -50,33 +81,37 @@
   /*    FT_Get_Advance                                                     */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    Retrieve the advance of a given glyph outline in a @FT_Face.       */
-  /*    by default, the unhinted advance is returned in font units         */
+  /*    Retrieve the advance value of a given glyph outline in an          */
+  /*    @FT_Face.  By default, the unhinted advance is returned in font    */
+  /*    units.                                                             */
   /*                                                                       */
   /* <Input>                                                               */
-  /*    face       :: source @FT_Face handle                               */
-  /*    gindex     :: glyph index                                          */
-  /*    load_flags :: a set of bit-flags similar to those used             */
-  /*                  when calling @FT_Load_Glyph, used to determine       */
-  /*                  what kind of advances you need.                      */
+  /*    face       :: The source @FT_Face handle.                          */
+  /*                                                                       */
+  /*    gindex     :: The glyph index.                                     */
+  /*                                                                       */
+  /*    load_flags :: A set of bit flags similar to those used when        */
+  /*                  calling @FT_Load_Glyph, used to determine what kind  */
+  /*                  of advances you need.                                */
   /* <Output>                                                              */
-  /*    padvance :: the advance value, in either font units or 16.16       */
+  /*    padvance :: The advance value, in either font units or 16.16       */
   /*                format.                                                */
   /*                                                                       */
-  /*                if @FT_LOAD_VERTICAL_LAYOUT is set, this is the        */
+  /*                If @FT_LOAD_VERTICAL_LAYOUT is set, this is the        */
   /*                vertical advance corresponding to a vertical layout.   */
-  /*                otherwise, it's the horizontal advance in an           */
+  /*                Otherwise, it is the horizontal advance in a           */
   /*                horizontal layout.                                     */
+  /*                                                                       */
   /* <Return>                                                              */
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
   /* <Note>                                                                */
   /*    This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and   */
-  /*    if the corresponding's font backend doesn't have a quick way to    */
+  /*    if the corresponding font backend doesn't have a quick way to      */
   /*    retrieve the advances.                                             */
   /*                                                                       */
-  /*    A scaled advance is returned in 16.16 format, but isn't            */
-  /*    transformed by the affine transform specified by @FT_Set_Transform */
+  /*    A scaled advance is returned in 16.16 format but isn't transformed */
+  /*    by the affine transformation specified by @FT_Set_Transform.       */
   /*                                                                       */
   FT_EXPORT( FT_Error )
   FT_Get_Advance( FT_Face    face,
@@ -84,40 +119,47 @@
                   FT_UInt    load_flags,
                   FT_Fixed  *padvance );
 
+
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
   /*    FT_Get_Advances                                                    */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    Retrieve the advance of several glyph outlines in a @FT_Face.      */
-  /*    by default, the unhinted advances are returned in font units       */
+  /*    Retrieve the advance values of several glyph outlines in an        */
+  /*    @FT_Face.  By default, the unhinted advances are returned in font  */
+  /*    units.                                                             */
   /*                                                                       */
   /* <Input>                                                               */
-  /*    face        :: source @FT_Face handle                              */
-  /*    start       :: first glyph index                                   */
-  /*    count       :: number of advances you want to retrieve             */
-  /*    load_flags  :: a set of bit-flags similar to those used when       */
+  /*    face        :: The source @FT_Face handle.                         */
+  /*                                                                       */
+  /*    start       :: The first glyph index.                              */
+  /*                                                                       */
+  /*    count       :: The number of advance values you want to retrieve.  */
+  /*                                                                       */
+  /*    load_flags  :: A set of bit flags similar to those used when       */
   /*                   calling @FT_Load_Glyph.                             */
   /*                                                                       */
   /* <Output>                                                              */
-  /*    padvance :: the advances, in either font units or 16.16 format.    */
-  /*                this array must contain at least 'count' elements      */
+  /*    padvance :: The advances, in either font units or 16.16 format.    */
+  /*                This array must contain at least `count' elements.     */
   /*                                                                       */
-  /*                if @FT_LOAD_VERTICAL_LAYOUT is set, these are the      */
+  /*                If @FT_LOAD_VERTICAL_LAYOUT is set, these are the      */
   /*                vertical advances corresponding to a vertical layout.  */
-  /*                otherwise, they are the horizontal advances in an      */
+  /*                Otherwise, they are the horizontal advances in a       */
   /*                horizontal layout.                                     */
+  /*                                                                       */
   /* <Return>                                                              */
   /*    FreeType error code.  0 means success.                             */
   /*                                                                       */
   /* <Note>                                                                */
   /*    This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and   */
-  /*    if the corresponding's font backend doesn't have a quick way to    */
+  /*    if the corresponding font backend doesn't have a quick way to      */
   /*    retrieve the advances.                                             */
   /*                                                                       */
-  /*    Scaled advances are returned in 16.16 format, but aren't           */
-  /*    transformed by the affine transform specified by @FT_Set_Transform */
+  /*    Scaled advances are returned in 16.16 format but aren't            */
+  /*    transformed by the affine transformation specified by              */
+  /*    @FT_Set_Transform.                                                 */
   /*                                                                       */
   FT_EXPORT( FT_Error )
   FT_Get_Advances( FT_Face    face,
@@ -128,4 +170,10 @@
 
 /* */
 
-#endif /* __FREETYPE_ADVANCE_H__ */
+
+FT_END_HEADER
+
+#endif /* __FTADVANC_H__ */
+
+
+/* END */
diff --git a/include/freetype/ftcache.h b/include/freetype/ftcache.h
index e6c38fc..605ed14 100644
--- a/include/freetype/ftcache.h
+++ b/include/freetype/ftcache.h
@@ -609,8 +609,8 @@ FT_BEGIN_HEADER
    *     The source face ID.
    *
    *   cmap_index ::
-   *     The index of the charmap in the source face.
-   *     Any negative value means to use the cache FT_Face's default charmap.
+   *     The index of the charmap in the source face.  Any negative value
+   *     means to use the cache @FT_Face's default charmap.
    *
    *   char_code ::
    *     The character code (in the corresponding charmap).
diff --git a/include/freetype/ftchapters.h b/include/freetype/ftchapters.h
index 4c61824..7775a6b 100644
--- a/include/freetype/ftchapters.h
+++ b/include/freetype/ftchapters.h
@@ -90,6 +90,7 @@
 /*    computations                                                         */
 /*    list_processing                                                      */
 /*    outline_processing                                                   */
+/*    quick_advance                                                        */
 /*    bitmap_handling                                                      */
 /*    raster                                                               */
 /*    glyph_stroker                                                        */
diff --git a/include/freetype/ftgasp.h b/include/freetype/ftgasp.h
index 6355bae..91a769e 100644
--- a/include/freetype/ftgasp.h
+++ b/include/freetype/ftgasp.h
@@ -22,6 +22,13 @@
 #include <ft2build.h>
 #include FT_FREETYPE_H
 
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
   /***************************************************************************
    *
    * @section:
diff --git a/include/freetype/ftlcdfil.h b/include/freetype/ftlcdfil.h
index 1e38fe7..c6201b3 100644
--- a/include/freetype/ftlcdfil.h
+++ b/include/freetype/ftlcdfil.h
@@ -23,6 +23,12 @@
 #include <ft2build.h>
 #include FT_FREETYPE_H
 
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
 
 FT_BEGIN_HEADER
 
diff --git a/include/freetype/internal/ftdriver.h b/include/freetype/internal/ftdriver.h
index 6119630..b6e73b6 100644
--- a/include/freetype/internal/ftdriver.h
+++ b/include/freetype/internal/ftdriver.h
@@ -91,12 +91,14 @@ FT_BEGIN_HEADER
   (*FT_CharMap_CharNextFunc)( FT_CharMap  charmap,
                               FT_Long     charcode );
 
+
   typedef FT_Error
   (*FT_Face_GetKerningFunc)( FT_Face     face,
                              FT_UInt     left_glyph,
                              FT_UInt     right_glyph,
                              FT_Vector*  kerning );
 
+
   typedef FT_Error
   (*FT_Face_AttachFunc)( FT_Face    face,
                          FT_Stream  stream );
diff --git a/src/base/Jamfile b/src/base/Jamfile
index d13d9bf..e025769 100644
--- a/src/base/Jamfile
+++ b/src/base/Jamfile
@@ -1,6 +1,6 @@
 # FreeType 2 src/base Jamfile
 #
-# Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007 by
+# Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
diff --git a/src/base/ftadvanc.c b/src/base/ftadvanc.c
index 626a0cf..dec3735 100644
--- a/src/base/ftadvanc.c
+++ b/src/base/ftadvanc.c
@@ -1,7 +1,26 @@
+/***************************************************************************/
+/*                                                                         */
+/*  ftadvanc.c                                                             */
+/*                                                                         */
+/*    Quick computation of advance widths (body).                          */
+/*                                                                         */
+/*  Copyright 2008 by                                                      */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
 #include <ft2build.h>
 #include FT_ADVANCES_H
 #include FT_INTERNAL_OBJECTS_H
 
+
   static FT_Error
   _ft_face_scale_advances( FT_Face    face,
                            FT_Fixed*  advances,
@@ -11,38 +30,43 @@
     FT_Fixed  scale;
     FT_UInt   nn;
 
-    if ( (flags & FT_LOAD_NO_SCALE) )
+
+    if ( flags & FT_LOAD_NO_SCALE )
       return FT_Err_Ok;
 
     if ( face->size == NULL )
       return FT_Err_Invalid_Size_Handle;
 
-    if ( !(flags & FT_LOAD_VERTICAL_LAYOUT) )
-      scale = face->size->metrics.x_scale;
-    else
+    if ( flags & FT_LOAD_VERTICAL_LAYOUT )
       scale = face->size->metrics.y_scale;
+    else
+      scale = face->size->metrics.x_scale;
 
-    /* this must be the same computation than to get linearHori/VertAdvance
-     * (see FT_Load_Glyph() implementation in src/base/ftobjs.c */
-    for (nn = 0; nn < count; nn++)
+    /* this must be the same computation as to get linearHori/VertAdvance */
+    /* (see `FT_Load_Glyph' implementation in src/base/ftobjs.c           */
+
+    for ( nn = 0; nn < count; nn++ )
       advances[nn] = FT_MulDiv( advances[nn], scale, 64 );
 
-    return 0;
+    return FT_Err_Ok;
   }
 
 
-/* at the moment, we can perform fast advance retrieval only in
-   the following cases:
+   /* at the moment, we can perform fast advance retrieval only in */
+   /* the following cases:                                         */
+   /*                                                              */
+   /*  - unscaled load                                             */
+   /*  - unhinted load                                             */
+   /*  - light-hinted load                                         */
+
+#define LOAD_ADVANCE_FAST_CHECK( flags )                            \
+          ( flags & ( FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING )    || \
+            FT_LOAD_TARGET_MODE( flags ) == FT_RENDER_MODE_LIGHT )
 
-       - unscaled load
-       - unhinted load
-       - light-hinted load
- */
-#define  LOAD_ADVANCE_FAST_CHECK(flags)    \
-    (((flags & (FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING)) != 0) || \
-     FT_LOAD_TARGET_MODE(flags) == FT_RENDER_MODE_LIGHT)
 
-  FT_EXPORT_DEF(FT_Error)
+  /* documentation is in ftadvanc.h */
+
+  FT_EXPORT_DEF( FT_Error )
   FT_Get_Advance( FT_Face    face,
                   FT_UInt    gindex,
                   FT_UInt    flags,
@@ -50,22 +74,24 @@
   {
     FT_Face_GetAdvancesFunc  func;
 
+
     if ( !face )
       return FT_Err_Invalid_Face_Handle;
 
-    if (gindex >= (FT_UInt) face->num_glyphs )
+    if ( gindex >= (FT_UInt)face->num_glyphs )
       return FT_Err_Invalid_Glyph_Index;
 
     func = face->driver->clazz->get_advances;
-    if (func != NULL && LOAD_ADVANCE_FAST_CHECK(flags))
+    if ( func && LOAD_ADVANCE_FAST_CHECK( flags ) )
     {
       FT_Error  error;
 
+
       error = func( face, gindex, 1, flags, padvance );
-      if (!error)
+      if ( !error )
         return _ft_face_scale_advances( face, padvance, 1, flags );
 
-      if (error != FT_Err_Unimplemented_Feature)
+      if ( error != FT_Err_Unimplemented_Feature )
         return error;
     }
 
@@ -73,7 +99,9 @@
   }
 
 
-  FT_EXPORT_DEF(FT_Error)
+  /* documentation is in ftadvanc.h */
+
+  FT_EXPORT_DEF( FT_Error )
   FT_Get_Advances( FT_Face    face,
                    FT_UInt    start,
                    FT_UInt    count,
@@ -82,46 +110,54 @@
   {
     FT_Face_GetAdvancesFunc  func;
     FT_UInt                  num, end, nn;
-    FT_Error                 error = 0;
+    FT_Error                 error = FT_Err_Ok;
+
 
     if ( !face )
       return FT_Err_Invalid_Face_Handle;
 
-    num = (FT_UInt) face->num_glyphs;
+    num = (FT_UInt)face->num_glyphs;
     end = start + count;
-    if (start >= num || end < start || end > num)
+    if ( start >= num || end < start || end > num )
       return FT_Err_Invalid_Glyph_Index;
 
-    if (count == 0)
-        return FT_Err_Ok;
+    if ( count == 0 )
+      return FT_Err_Ok;
 
     func = face->driver->clazz->get_advances;
-    if (func != NULL && LOAD_ADVANCE_FAST_CHECK(flags))
+    if ( func && LOAD_ADVANCE_FAST_CHECK( flags ) )
     {
       error = func( face, start, count, flags, padvances );
-      if (!error) goto Exit;
+      if ( !error )
+        goto Exit;
 
-      if (error != FT_Err_Unimplemented_Feature)
+      if ( error != FT_Err_Unimplemented_Feature )
         return error;
     }
 
-    error = 0;
+    error = FT_Err_Ok;
 
-    if ((flags & FT_ADVANCE_FLAG_FAST_ONLY) != 0)
+    if ( flags & FT_ADVANCE_FLAG_FAST_ONLY )
       return FT_Err_Unimplemented_Feature;
 
     flags |= FT_LOAD_ADVANCE_ONLY;
-    for (nn = 0; nn < count; nn++)
+    for ( nn = 0; nn < count; nn++ )
     {
-      error = FT_Load_Glyph( face, start+nn, flags );
-      if (error) break;
+      error = FT_Load_Glyph( face, start + nn, flags );
+      if ( error )
+        break;
 
-      padvances[nn] = (flags & FT_LOAD_VERTICAL_LAYOUT)
-                    ? face->glyph->advance.x
-                    : face->glyph->advance.y;
+      padvances[nn] = ( flags & FT_LOAD_VERTICAL_LAYOUT )
+                      ? face->glyph->advance.x
+                      : face->glyph->advance.y;
     }
-    if (error) return error;
+
+    if ( error )
+      return error;
 
   Exit:
     return _ft_face_scale_advances( face, padvances, count, flags );
   }
+
+
+/* END */
diff --git a/src/base/ftcalc.c b/src/base/ftcalc.c
index 75e89c2..04295a6 100644
--- a/src/base/ftcalc.c
+++ b/src/base/ftcalc.c
@@ -38,8 +38,8 @@
 #include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_OBJECTS_H
 
-#ifdef  FT_MULFIX_INLINED
-#undef  FT_MulFix
+#ifdef FT_MULFIX_INLINED
+#undef FT_MulFix
 #endif
 
 /* we need to define a 64-bits data type here */
@@ -197,18 +197,32 @@
              FT_Long  b )
   {
 #ifdef FT_MULFIX_ASSEMBLER
-    return FT_MULFIX_ASSEMBLER(a,b);
+
+    return FT_MULFIX_ASSEMBLER( a, b );
+
 #else
+
     FT_Int   s = 1;
     FT_Long  c;
 
 
-    if ( a < 0 ) { a = -a; s = -1; }
-    if ( b < 0 ) { b = -b; s = -s; }
+    if ( a < 0 )
+    {
+      a = -a;
+      s = -1;
+    }
+
+    if ( b < 0 )
+    {
+      b = -b;
+      s = -s;
+    }
 
     c = (FT_Long)( ( (FT_Int64)a * b + 0x8000L ) >> 16 );
-    return ( s > 0 ) ? c : -c ;
-#endif
+
+    return ( s > 0 ) ? c : -c;
+
+#endif /* FT_MULFIX_ASSEMBLER */
   }
 
 
@@ -421,7 +435,9 @@
              FT_Long  b )
   {
 #ifdef FT_MULFIX_ASSEMBLER
-    return FT_MULFIX_ASSEMBLER(a,b);
+
+    return FT_MULFIX_ASSEMBLER( a, b );
+
 #elif 0
 
     /*
diff --git a/src/base/rules.mk b/src/base/rules.mk
index 738264c..4a152ab 100644
--- a/src/base/rules.mk
+++ b/src/base/rules.mk
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000, 2002, 2003, 2004, 2005, 2006, 2007 by
+# Copyright 1996-2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -47,7 +47,6 @@ BASE_SRC := $(BASE_DIR)/ftcalc.c   \
             $(BASE_DIR)/ftutil.c   \
             $(BASE_DIR)/ftadvanc.c
 
-
 # Base layer `extensions' sources
 #
 # An extension is added to the library file as a separate object.  It is
diff --git a/src/cache/ftccmap.c b/src/cache/ftccmap.c
index 51bef1e..4c6a7fd 100644
--- a/src/cache/ftccmap.c
+++ b/src/cache/ftccmap.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType CharMap cache (body)                                        */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007 by             */
+/*  Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -290,14 +290,14 @@
     FT_UInt32         hash;
     FT_Int            no_cmap_change = 0;
 
-    if (cmap_index < 0)
+
+    if ( cmap_index < 0 )
     {
-      /* treat a negative cmap index as a special value that
-       * means you don't want to change the FT_Face's character
-       * map through this call. this can be useful when the
-       * face requester callback already set the face's charmap
-       * to the appropriate value.
-       */
+      /* Treat a negative cmap index as a special value, meaning that you */
+      /* don't want to change the FT_Face's character map through this    */
+      /* call.  This can be useful if the face requester callback already */
+      /* sets the face's charmap to the appropriate value.                */
+
       no_cmap_change = 1;
       cmap_index     = 0;
     }
diff --git a/src/cff/cffdrivr.c b/src/cff/cffdrivr.c
index 4e96d68..b02ee79 100644
--- a/src/cff/cffdrivr.c
+++ b/src/cff/cffdrivr.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    OpenType font driver implementation (body).                          */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by             */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -187,32 +187,36 @@
   }
 
 
-  FT_CALLBACK_DEF(FT_Error)
+  FT_CALLBACK_DEF( FT_Error )
   cff_get_advances( FT_Face    ftface,
                     FT_UInt    start,
                     FT_UInt    count,
                     FT_UInt    flags,
                     FT_Fixed*  advances )
   {
-    CFF_Face      face = (CFF_Face) ftface;
+    CFF_Face      face = (CFF_Face)ftface;
     FT_UInt       nn;
-    FT_Error      error = 0;
-    FT_GlyphSlot  slot = face->root.glyph;
+    FT_Error      error = CFF_Err_Ok;
+    FT_GlyphSlot  slot  = face->root.glyph;
+
 
     flags |= FT_LOAD_ADVANCE_ONLY;
 
-    for (nn = 0; nn < count; nn++)
+    for ( nn = 0; nn < count; nn++ )
     {
       error = Load_Glyph( slot, face->root.size, start+nn, flags );
-      if (error) break;
+      if ( error )
+        break;
 
-      advances[nn] = (flags & FT_LOAD_VERTICAL_LAYOUT)
-                   ? slot->advance.y
-                   : slot->advance.x;
+      advances[nn] = ( flags & FT_LOAD_VERTICAL_LAYOUT )
+                     ? slot->advance.y
+                     : slot->advance.x;
     }
+
     return error;
   }
 
+
   /*
    *  GLYPH DICT SERVICE
    *
diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c
index 1914983..3814220 100644
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -384,12 +384,14 @@
     decoder->hint_mode    = hint_mode;
   }
 
+
   FT_LOCAL_DEF( void )
   cff_decoder_set_width_only( CFF_Decoder*  decoder )
   {
     decoder->width_only = 1;
   }
 
+
   /* this function is used to select the subfont */
   /* and the locals subrs array                  */
   FT_LOCAL_DEF( FT_Error )
@@ -1205,9 +1207,9 @@
               decoder->glyph_width = decoder->nominal_width +
                                        ( stack[0] >> 16 );
 
-              if (decoder->width_only)
+              if ( decoder->width_only )
               {
-                /* we only want the advance width, stop here */
+                /* we only want the advance width; stop here */
                 break;
               }
 
@@ -2570,11 +2572,11 @@
       cff_decoder_init( &decoder, face, size, glyph, hinting,
                         FT_LOAD_TARGET_MODE( load_flags ) );
 
-      if ((load_flags & FT_LOAD_ADVANCE_ONLY) != 0)
+      if ( load_flags & FT_LOAD_ADVANCE_ONLY )
         cff_decoder_set_width_only( &decoder );
 
       decoder.builder.no_recurse =
-        (FT_Bool)( ( load_flags & FT_LOAD_NO_RECURSE ) != 0 );
+        (FT_Bool)( load_flags & FT_LOAD_NO_RECURSE );
 
       /* now load the unscaled outline */
       error = cff_get_glyph_data( face, glyph_index,
@@ -2681,7 +2683,7 @@
 
         has_vertical_info = FT_BOOL( face->vertical_info                   &&
                                      face->vertical.number_Of_VMetrics > 0 &&
-                                     face->vertical.long_metrics != 0 );
+                                     face->vertical.long_metrics           );
 
         /* get the vertical metrics from the vtmx table if we have one */
         if ( has_vertical_info )
diff --git a/src/truetype/ttdriver.c b/src/truetype/ttdriver.c
index 2647cf5..9e9133b 100644
--- a/src/truetype/ttdriver.c
+++ b/src/truetype/ttdriver.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType font driver implementation (body).                          */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by             */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -134,33 +134,38 @@
   {
     FT_UInt  nn;
     TT_Face  face  = (TT_Face) ttface;
-    FT_Bool  check = FT_BOOL(!(flags & FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH));
+    FT_Bool  check = FT_BOOL(
+                       !( flags & FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ) );
+
 
     /* XXX: TODO: check for sbits */
 
-    if (flags & FT_LOAD_VERTICAL_LAYOUT)
+    if ( flags & FT_LOAD_VERTICAL_LAYOUT )
     {
-      for (nn = 0; nn < count; nn++)
+      for ( nn = 0; nn < count; nn++ )
       {
         FT_Short   tsb;
         FT_UShort  ah;
 
+
         TT_Get_VMetrics( face, start + nn, check, &tsb, &ah );
         advances[nn] = ah;
       }
     }
     else
     {
-      for (nn = 0; nn < count; nn++)
+      for ( nn = 0; nn < count; nn++ )
       {
         FT_Short   lsb;
         FT_UShort  aw;
 
+
         TT_Get_HMetrics( face, start + nn, check, &lsb, &aw );
         advances[nn] = aw;
       }
     }
-    return 0;
+
+    return TT_Err_Ok;
   }
 
   /*************************************************************************/
diff --git a/src/truetype/ttgload.h b/src/truetype/ttgload.h
index 313bb14..958d67d 100644
--- a/src/truetype/ttgload.h
+++ b/src/truetype/ttgload.h
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType Glyph Loader (specification).                               */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by                   */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008 by             */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -34,14 +34,14 @@ FT_BEGIN_HEADER
   FT_LOCAL( void )
   TT_Init_Glyph_Loading( TT_Face  face );
 
-  FT_LOCAL(void)
+  FT_LOCAL( void )
   TT_Get_HMetrics( TT_Face     face,
                    FT_UInt     idx,
                    FT_Bool     check,
                    FT_Short*   lsb,
                    FT_UShort*  aw );
 
-  FT_LOCAL(void)
+  FT_LOCAL( void )
   TT_Get_VMetrics( TT_Face     face,
                    FT_UInt     idx,
                    FT_Bool     check,
diff --git a/src/type1/t1gload.c b/src/type1/t1gload.c
index 6d7420c..67de870 100644
--- a/src/type1/t1gload.c
+++ b/src/type1/t1gload.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 1 Glyph Loader (body).                                          */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by                   */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008 by             */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -215,12 +215,15 @@
     FT_UInt        nn;
     FT_Error       error;
 
-    if (load_flags & FT_LOAD_VERTICAL_LAYOUT)
+    FT_UNUSED( load_flags );
+
+
+    if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )
     {
-        for (nn = 0; nn < count; nn++)
-            advances[nn] = 0;
+      for ( nn = 0; nn < count; nn++ )
+        advances[nn] = 0;
 
-        return T1_Err_Ok;
+      return T1_Err_Ok;
     }
 
     error = psaux->t1_decoder_funcs->init( &decoder,
@@ -235,14 +238,12 @@
     if ( error )
       return error;
 
-    FT_UNUSED(load_flags);
-
     decoder.builder.metrics_only = 1;
     decoder.builder.load_points  = 0;
 
-    decoder.num_subrs     = type1->num_subrs;
-    decoder.subrs         = type1->subrs;
-    decoder.subrs_len     = type1->subrs_len;
+    decoder.num_subrs = type1->num_subrs;
+    decoder.subrs     = type1->subrs;
+    decoder.subrs_len = type1->subrs_len;
 
     decoder.buildchar     = face->buildchar;
     decoder.len_buildchar = face->len_buildchar;
@@ -250,11 +251,12 @@
     for ( nn = 0; nn < count; nn++ )
     {
       error = T1_Parse_Glyph( &decoder, first + nn );
-      if (!error)
+      if ( !error )
         advances[nn] = decoder.builder.advance.x;
       else
         advances[nn] = 0;
     }
+
     return T1_Err_Ok;
   }
 
diff --git a/src/type1/t1gload.h b/src/type1/t1gload.h
index 1638db8..100df06 100644
--- a/src/type1/t1gload.h
+++ b/src/type1/t1gload.h
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 1 Glyph Loader (specification).                                 */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003 by                                     */
+/*  Copyright 1996-2001, 2002, 2003, 2008 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */