* src/truetype/ttgload.c: 16bit fixes. (TT_Load_Simple_Glyph): Improve debug messages. (load_truetype_glyph): Remove dead code. * src/truetype/ttinterp.c: 16bit fixes. * src/truetype/ttobjs.c: Ditto. * include/freetype/ftsnames.h, include/freetype/internal/sfnt.h, src/cff/cffload.h, src/psaux/psobjs.h, src/truetype/ttinterp.[ch], src/sfnt/ttpost.h: s/index/idx/. formatting, copyright updates.
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
diff --git a/ChangeLog b/ChangeLog
index dc10196..b83770b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2002-04-01 Werner Lemberg <wl@gnu.org>
+
+ * src/truetype/ttgload.c: 16bit fixes.
+ (TT_Load_Simple_Glyph): Improve debug messages.
+ (load_truetype_glyph): Remove dead code.
+ * src/truetype/ttinterp.c: 16bit fixes.
+ * src/truetype/ttobjs.c: Ditto.
+
+ * include/freetype/ftsnames.h, include/freetype/internal/sfnt.h,
+ src/cff/cffload.h, src/psaux/psobjs.h, src/truetype/ttinterp.[ch],
+ src/sfnt/ttpost.h: s/index/idx/.
+
2002-03-31 Yao Zhang <yaoz@vidar.niaaa.nih.gov>
* src/truetype/ttobjs.c (TT_Size_Init): Fix typo.
@@ -97,6 +109,15 @@
* src/sfnt/sfdriver.c, src/sfnt/sfobjs.c, src/sfnt/ttcmap0.c:
Fixed a small bug in the FT_CMaps support code.
+2002-03-25 David Turner <david@freetype.org>
+
+ * src/truetype/ttinterp.c (Norm): Replaced with...
+ (TT_VecLen): This.
+ (TT_MulFix14, TT_DotFix14): New functions.
+ (Project, Dual_Project, Free_Project, Compute_Point_Displacement,
+ Ins_SHPIX, Ins_MIAP, Ins_MIRP): Use them.
+ [FT_CONFIG_OPTION_OLD_CALCS]: Removed all code.
+
2002-03-22 David Turner <david@freetype.org>
* src/base/ftobjs.c, src/sfnt/ttcmap0.c, src/type1/t1objs.c:
diff --git a/include/freetype/ftsnames.h b/include/freetype/ftsnames.h
index 727e451..356f983 100644
--- a/include/freetype/ftsnames.h
+++ b/include/freetype/ftsnames.h
@@ -7,7 +7,7 @@
/* */
/* This is _not_ used to retrieve glyph names! */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2001, 2002 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -128,7 +128,7 @@ FT_BEGIN_HEADER
/* <Input> */
/* face :: A handle to the source face. */
/* */
- /* index :: The index of the `name' string. */
+ /* idx :: The index of the `name' string. */
/* */
/* <Output> */
/* aname :: The indexed FT_SfntName structure. */
@@ -146,7 +146,7 @@ FT_BEGIN_HEADER
/* */
FT_EXPORT( FT_Error )
FT_Get_Sfnt_Name( FT_Face face,
- FT_UInt index,
+ FT_UInt idx,
FT_SfntName *aname );
diff --git a/include/freetype/internal/sfnt.h b/include/freetype/internal/sfnt.h
index 04ce97f..b6a3aed 100644
--- a/include/freetype/internal/sfnt.h
+++ b/include/freetype/internal/sfnt.h
@@ -326,7 +326,7 @@ FT_BEGIN_HEADER
/* Gets the PostScript glyph name of a glyph. */
/* */
/* <Input> */
- /* index :: The glyph index. */
+ /* idx :: The glyph index. */
/* */
/* PSname :: The address of a string pointer. Will be NULL in case */
/* of error, otherwise it is a pointer to the glyph name. */
@@ -338,7 +338,7 @@ FT_BEGIN_HEADER
/* */
typedef FT_Error
(*TT_Get_PS_Name_Func)( TT_Face face,
- FT_UInt index,
+ FT_UInt idx,
FT_String** PSname );
diff --git a/src/cff/cffload.h b/src/cff/cffload.h
index 9511838..18f78df 100644
--- a/src/cff/cffload.h
+++ b/src/cff/cffload.h
@@ -32,23 +32,23 @@ FT_BEGIN_HEADER
FT_LOCAL( FT_String* )
- CFF_Get_Name( CFF_Index index,
+ CFF_Get_Name( CFF_Index idx,
FT_UInt element );
FT_LOCAL( FT_String* )
- CFF_Get_String( CFF_Index index,
+ CFF_Get_String( CFF_Index idx,
FT_UInt sid,
PSNames_Service interface );
FT_LOCAL( FT_Error )
- CFF_Access_Element( CFF_Index index,
+ CFF_Access_Element( CFF_Index idx,
FT_UInt element,
FT_Byte** pbytes,
FT_ULong* pbyte_len );
FT_LOCAL( void )
- CFF_Forget_Element( CFF_Index index,
+ CFF_Forget_Element( CFF_Index idx,
FT_Byte** pbytes );
diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c
index b463959..891edb0 100644
--- a/src/psaux/psobjs.c
+++ b/src/psaux/psobjs.c
@@ -139,7 +139,7 @@
/* table :: The target table. */
/* */
/* <Input> */
- /* index :: The index of the object in the table. */
+ /* idx :: The index of the object in the table. */
/* */
/* object :: The address of the object to copy in memory. */
/* */
diff --git a/src/psaux/psobjs.h b/src/psaux/psobjs.h
index 712def6..f748085 100644
--- a/src/psaux/psobjs.h
+++ b/src/psaux/psobjs.h
@@ -53,7 +53,7 @@ FT_BEGIN_HEADER
FT_LOCAL( FT_Error )
PS_Table_Add( PS_Table table,
- FT_Int index,
+ FT_Int idx,
void* object,
FT_Int length );
diff --git a/src/sfnt/ttpost.h b/src/sfnt/ttpost.h
index fd7f2af..57b1c8c 100644
--- a/src/sfnt/ttpost.h
+++ b/src/sfnt/ttpost.h
@@ -31,7 +31,7 @@ FT_BEGIN_HEADER
FT_LOCAL( FT_Error )
TT_Get_PS_Name( TT_Face face,
- FT_UInt index,
+ FT_UInt idx,
FT_String** PSname );
FT_LOCAL( void )
diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index bba31ad..a2add72 100644
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -4,7 +4,7 @@
/* */
/* A new `perfect' anti-aliasing renderer (body). */
/* */
-/* Copyright 2000-2001 by */
+/* Copyright 2000-2001, 2002 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -17,66 +17,66 @@
/*************************************************************************/
/* */
- /* This file can be compiled without the rest of the FreeType engine, */
- /* by defining the _STANDALONE_ macro when compiling it. You also need */
- /* to put the files `ftgrays.h' and `ftimage.h' into the current */
- /* compilation directory. Typically, you could do something like */
+ /* This file can be compiled without the rest of the FreeType engine, by */
+ /* defining the _STANDALONE_ macro when compiling it. You also need to */
+ /* put the files `ftgrays.h' and `ftimage.h' into the current */
+ /* compilation directory. Typically, you could do something like */
/* */
- /* - copy `src/base/ftgrays.c' to your current directory */
+ /* - copy `src/base/ftgrays.c' to your current directory */
/* */
- /* - copy `include/freetype/ftimage.h' and */
- /* `include/freetype/ftgrays.h' to the same directory */
+ /* - copy `include/freetype/ftimage.h' and `include/freetype/ftgrays.h' */
+ /* to the same directory */
/* */
- /* - compile `ftgrays' with the _STANDALONE_ macro defined, as in */
+ /* - compile `ftgrays' with the _STANDALONE_ macro defined, as in */
/* */
- /* cc -c -D_STANDALONE_ ftgrays.c */
+ /* cc -c -D_STANDALONE_ ftgrays.c */
/* */
- /* The renderer can be initialized with a call to */
- /* `ft_gray_raster.gray_raster_new'; an anti-aliased bitmap can be */
- /* generated with a call to `ft_gray_raster.gray_raster_render'. */
+ /* The renderer can be initialized with a call to */
+ /* `ft_gray_raster.gray_raster_new'; an anti-aliased bitmap can be */
+ /* generated with a call to `ft_gray_raster.gray_raster_render'. */
/* */
- /* See the comments and documentation in the file `ftimage.h' for */
- /* more details on how the raster works. */
+ /* See the comments and documentation in the file `ftimage.h' for more */
+ /* details on how the raster works. */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
- /* This is a new anti-aliasing scan-converter for FreeType 2. The */
- /* algorithm used here is _very_ different from the one in the standard */
- /* `ftraster' module. Actually, `ftgrays' computes the _exact_ */
- /* coverage of the outline on each pixel cell. */
+ /* This is a new anti-aliasing scan-converter for FreeType 2. The */
+ /* algorithm used here is _very_ different from the one in the standard */
+ /* `ftraster' module. Actually, `ftgrays' computes the _exact_ */
+ /* coverage of the outline on each pixel cell. */
/* */
- /* It is based on ideas that I initially found in Raph Levien's */
- /* excellent LibArt graphics library (see http://www.levien.com/libart */
- /* for more information, though the web pages do not tell anything */
- /* about the renderer; you'll have to dive into the source code to */
- /* understand how it works). */
+ /* It is based on ideas that I initially found in Raph Levien's */
+ /* excellent LibArt graphics library (see http://www.levien.com/libart */
+ /* for more information, though the web pages do not tell anything */
+ /* about the renderer; you'll have to dive into the source code to */
+ /* understand how it works). */
/* */
- /* Note, however, that this is a _very_ different implementation */
- /* compared to Raph's. Coverage information is stored in a very */
- /* different way, and I don't use sorted vector paths. Also, it */
- /* doesn't use floating point values. */
+ /* Note, however, that this is a _very_ different implementation */
+ /* compared to Raph's. Coverage information is stored in a very */
+ /* different way, and I don't use sorted vector paths. Also, it doesn't */
+ /* use floating point values. */
/* */
- /* This renderer has the following advantages: */
+ /* This renderer has the following advantages: */
/* */
- /* - It doesn't need an intermediate bitmap. Instead, one can supply */
- /* a callback function that will be called by the renderer to draw */
- /* gray spans on any target surface. You can thus do direct */
- /* composition on any kind of bitmap, provided that you give the */
- /* renderer the right callback. */
+ /* - It doesn't need an intermediate bitmap. Instead, one can supply a */
+ /* callback function that will be called by the renderer to draw gray */
+ /* spans on any target surface. You can thus do direct composition on */
+ /* any kind of bitmap, provided that you give the renderer the right */
+ /* callback. */
/* */
- /* - A perfect anti-aliaser, i.e., it computes the _exact_ coverage on */
- /* each pixel cell */
+ /* - A perfect anti-aliaser, i.e., it computes the _exact_ coverage on */
+ /* each pixel cell. */
/* */
- /* - It performs a single pass on the outline (the `standard' FT2 */
- /* renderer makes two passes). */
+ /* - It performs a single pass on the outline (the `standard' FT2 */
+ /* renderer makes two passes). */
/* */
- /* - It can easily be modified to render to _any_ number of gray levels */
- /* cheaply. */
+ /* - It can easily be modified to render to _any_ number of gray levels */
+ /* cheaply. */
/* */
- /* - For small (< 20) pixel sizes, it is faster than the standard */
- /* renderer. */
+ /* - For small (< 20) pixel sizes, it is faster than the standard */
+ /* renderer. */
/* */
/*************************************************************************/
@@ -146,7 +146,7 @@
#ifndef FT_MEM_SET
-#define FT_MEM_SET( d, s, c ) memset( d, s, c )
+#define FT_MEM_SET( d, s, c ) memset( d, s, c )
#endif
/* define this to dump debugging information */
@@ -2130,11 +2130,11 @@
{
ft_glyph_format_outline,
- (FT_Raster_New_Func) gray_raster_new,
- (FT_Raster_Reset_Func) gray_raster_reset,
- (FT_Raster_Set_Mode_Func) 0,
- (FT_Raster_Render_Func) gray_raster_render,
- (FT_Raster_Done_Func) gray_raster_done
+ (FT_Raster_New_Func) gray_raster_new,
+ (FT_Raster_Reset_Func) gray_raster_reset,
+ (FT_Raster_Set_Mode_Func)0,
+ (FT_Raster_Render_Func) gray_raster_render,
+ (FT_Raster_Done_Func) gray_raster_done
};
diff --git a/src/smooth/ftsmooth.c b/src/smooth/ftsmooth.c
index 80c4c99..b717926 100644
--- a/src/smooth/ftsmooth.c
+++ b/src/smooth/ftsmooth.c
@@ -4,7 +4,7 @@
/* */
/* Anti-aliasing renderer interface (body). */
/* */
-/* Copyright 2000-2001 by */
+/* Copyright 2000-2001, 2002 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/smooth/rules.mk b/src/smooth/rules.mk
index 4458823..457f1e5 100644
--- a/src/smooth/rules.mk
+++ b/src/smooth/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000 by
+# Copyright 1996-2000, 2001 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/truetype/descrip.mms b/src/truetype/descrip.mms
index 675fd0e..e30ee1b 100644
--- a/src/truetype/descrip.mms
+++ b/src/truetype/descrip.mms
@@ -3,7 +3,7 @@
#
-# Copyright 2001 by
+# Copyright 2001, 2002 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/truetype/rules.mk b/src/truetype/rules.mk
index 4ef3678..7c1f3e3 100644
--- a/src/truetype/rules.mk
+++ b/src/truetype/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000 by
+# Copyright 1996-2000, 2001 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/truetype/ttdriver.c b/src/truetype/ttdriver.c
index 0902be3..7011921 100644
--- a/src/truetype/ttdriver.c
+++ b/src/truetype/ttdriver.c
@@ -4,7 +4,7 @@
/* */
/* TrueType font driver implementation (body). */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2001, 2002 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -365,9 +365,9 @@
Get_Char_Index( TT_CharMap charmap,
FT_Long charcode )
{
- FT_Error error;
- TT_Face face;
- TT_CMapTable cmap;
+ FT_Error error;
+ TT_Face face;
+ TT_CMapTable cmap;
cmap = &charmap->cmap;
@@ -412,9 +412,9 @@
Get_Next_Char( TT_CharMap charmap,
FT_Long charcode )
{
- FT_Error error;
- TT_Face face;
- TT_CMapTable cmap;
+ FT_Error error;
+ TT_Face face;
+ TT_CMapTable cmap;
cmap = &charmap->cmap;
@@ -457,8 +457,8 @@
tt_get_interface( TT_Driver driver,
const char* interface )
{
- FT_Module sfntd = FT_Get_Module( driver->root.root.library,
- "sfnt" );
+ FT_Module sfntd = FT_Get_Module( driver->root.root.library,
+ "sfnt" );
SFNT_Service sfnt;
@@ -506,23 +506,23 @@
sizeof ( FT_GlyphSlotRec ),
- (FT_Face_InitFunc) TT_Face_Init,
- (FT_Face_DoneFunc) TT_Face_Done,
- (FT_Size_InitFunc) TT_Size_Init,
- (FT_Size_DoneFunc) TT_Size_Done,
- (FT_Slot_InitFunc)0,
- (FT_Slot_DoneFunc)0,
+ (FT_Face_InitFunc) TT_Face_Init,
+ (FT_Face_DoneFunc) TT_Face_Done,
+ (FT_Size_InitFunc) TT_Size_Init,
+ (FT_Size_DoneFunc) TT_Size_Done,
+ (FT_Slot_InitFunc) 0,
+ (FT_Slot_DoneFunc) 0,
(FT_Size_ResetPointsFunc) Set_Char_Sizes,
- (FT_Size_ResetPixelsFunc)Set_Pixel_Sizes,
- (FT_Slot_LoadFunc) Load_Glyph,
- (FT_CharMap_CharIndexFunc) Get_Char_Index,
+ (FT_Size_ResetPixelsFunc) Set_Pixel_Sizes,
+ (FT_Slot_LoadFunc) Load_Glyph,
+ (FT_CharMap_CharIndexFunc)Get_Char_Index,
- (FT_Face_GetKerningFunc) Get_Kerning,
- (FT_Face_AttachFunc) 0,
- (FT_Face_GetAdvancesFunc) 0,
+ (FT_Face_GetKerningFunc) Get_Kerning,
+ (FT_Face_AttachFunc) 0,
+ (FT_Face_GetAdvancesFunc) 0,
- (FT_CharMap_CharNextFunc) Get_Next_Char
+ (FT_CharMap_CharNextFunc) Get_Next_Char
};
diff --git a/src/truetype/ttdriver.h b/src/truetype/ttdriver.h
index e4f5aaf..f6f26e4 100644
--- a/src/truetype/ttdriver.h
+++ b/src/truetype/ttdriver.h
@@ -4,7 +4,7 @@
/* */
/* High-level TrueType driver interface (specification). */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2001, 2002 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index 4ff468b..50cd219 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -4,7 +4,7 @@
/* */
/* TrueType Glyph Loader (body). */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2001, 2002 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -87,8 +87,8 @@
FT_Short* bearing,
FT_UShort* advance )
{
- TT_LongMetrics longs_m;
- FT_UShort k = header->number_Of_HMetrics;
+ TT_LongMetrics longs_m;
+ FT_UShort k = header->number_Of_HMetrics;
if ( idx < (FT_UInt)k )
@@ -127,8 +127,8 @@
/*************************************************************************/
/* */
- /* Returns the advance width table for a given pixel size if it is */
- /* found in the font's `hdmx' table (if any). */
+ /* Returns the advance width table for a given pixel size if it is found */
+ /* in the font's `hdmx' table (if any). */
/* */
static FT_Byte*
Get_Advance_Widths( TT_Face face,
@@ -136,6 +136,7 @@
{
FT_UShort n;
+
for ( n = 0; n < face->hdmx.num_records; n++ )
if ( face->hdmx.records[n].ppem == ppem )
return face->hdmx.records[n].widths;
@@ -153,7 +154,7 @@
/*************************************************************************/
/* */
- /* Translates an array of coordinates. */
+ /* Translates an array of coordinates. */
/* */
static void
translate_array( FT_UInt n,
@@ -175,10 +176,10 @@
static void
- tt_prepare_zone( TT_GlyphZone zone,
- FT_GlyphLoad load,
- FT_UInt start_point,
- FT_UInt start_contour )
+ tt_prepare_zone( TT_GlyphZone zone,
+ FT_GlyphLoad load,
+ FT_UInt start_point,
+ FT_UInt start_contour )
{
zone->n_points = (FT_UShort)( load->outline.n_points - start_point );
zone->n_contours = (FT_Short) ( load->outline.n_contours - start_contour );
@@ -195,17 +196,17 @@
/*************************************************************************/
/* */
- /* The following functions are used by default with TrueType fonts. */
- /* However, they can be replaced by alternatives if we need to support */
- /* TrueType-compressed formats (like MicroType) in the future. */
+ /* The following functions are used by default with TrueType fonts. */
+ /* However, they can be replaced by alternatives if we need to support */
+ /* TrueType-compressed formats (like MicroType) in the future. */
/* */
/*************************************************************************/
FT_CALLBACK_DEF( FT_Error )
- TT_Access_Glyph_Frame( TT_Loader loader,
- FT_UInt glyph_index,
- FT_ULong offset,
- FT_UInt byte_count )
+ TT_Access_Glyph_Frame( TT_Loader loader,
+ FT_UInt glyph_index,
+ FT_ULong offset,
+ FT_UInt byte_count )
{
FT_Error error;
FT_Stream stream = loader->stream;
@@ -225,7 +226,7 @@
FT_CALLBACK_DEF( void )
- TT_Forget_Glyph_Frame( TT_Loader loader )
+ TT_Forget_Glyph_Frame( TT_Loader loader )
{
FT_Stream stream = loader->stream;
@@ -235,10 +236,10 @@
FT_CALLBACK_DEF( FT_Error )
- TT_Load_Glyph_Header( TT_Loader loader )
+ TT_Load_Glyph_Header( TT_Loader loader )
{
- FT_Stream stream = loader->stream;
- FT_Int byte_len = loader->byte_len - 10;
+ FT_Stream stream = loader->stream;
+ FT_Int byte_len = loader->byte_len - 10;
if ( byte_len < 0 )
@@ -263,18 +264,18 @@
FT_CALLBACK_DEF( FT_Error )
- TT_Load_Simple_Glyph( TT_Loader load )
+ TT_Load_Simple_Glyph( TT_Loader load )
{
- FT_Error error;
- FT_Stream stream = load->stream;
- FT_GlyphLoader gloader = load->gloader;
- FT_Int n_contours = load->n_contours;
- FT_Outline* outline;
- TT_Face face = (TT_Face)load->face;
- TT_GlyphSlot slot = (TT_GlyphSlot)load->glyph;
- FT_UShort n_ins;
- FT_Int n, n_points;
- FT_Int byte_len = load->byte_len;
+ FT_Error error;
+ FT_Stream stream = load->stream;
+ FT_GlyphLoader gloader = load->gloader;
+ FT_Int n_contours = load->n_contours;
+ FT_Outline* outline;
+ TT_Face face = (TT_Face)load->face;
+ TT_GlyphSlot slot = (TT_GlyphSlot)load->glyph;
+ FT_UShort n_ins;
+ FT_Int n, n_points;
+ FT_Int byte_len = load->byte_len;
/* reading the contours endpoints & number of points */
@@ -317,7 +318,7 @@
if ( n_ins > face->max_profile.maxSizeOfInstructions )
{
- FT_TRACE0(( "ERROR: Too many instructions!\n" ));
+ FT_TRACE0(( "TT_Load_Simple_Glyph: Too many instructions!\n" ));
error = TT_Err_Too_Many_Hints;
goto Fail;
}
@@ -325,7 +326,7 @@
byte_len -= n_ins;
if ( byte_len < 0 )
{
- FT_TRACE0(( "ERROR: Instruction count mismatch!\n" ));
+ FT_TRACE0(( "TT_Load_Simple_Glyph: Instruction count mismatch!\n" ));
error = TT_Err_Too_Many_Hints;
goto Fail;
}
@@ -466,14 +467,14 @@
FT_CALLBACK_DEF( FT_Error )
- TT_Load_Composite_Glyph( TT_Loader loader )
+ TT_Load_Composite_Glyph( TT_Loader loader )
{
- FT_Error error;
- FT_Stream stream = loader->stream;
- FT_GlyphLoader gloader = loader->gloader;
+ FT_Error error;
+ FT_Stream stream = loader->stream;
+ FT_GlyphLoader gloader = loader->gloader;
FT_SubGlyph subglyph;
- FT_UInt num_subglyphs;
- FT_Int byte_len = loader->byte_len;
+ FT_UInt num_subglyphs;
+ FT_Int byte_len = loader->byte_len;
num_subglyphs = 0;
@@ -603,17 +604,17 @@
/* interpretation. */
/* */
static FT_Error
- TT_Process_Simple_Glyph( TT_Loader load,
- FT_Bool debug )
+ TT_Process_Simple_Glyph( TT_Loader load,
+ FT_Bool debug )
{
- FT_GlyphLoader gloader = load->gloader;
- FT_Outline* outline = &gloader->current.outline;
- FT_UInt n_points = outline->n_points;
+ FT_GlyphLoader gloader = load->gloader;
+ FT_Outline* outline = &gloader->current.outline;
+ FT_UInt n_points = outline->n_points;
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
- FT_UInt n_ins;
+ FT_UInt n_ins;
#endif
- TT_GlyphZone zone = &load->zone;
- FT_Error error = TT_Err_Ok;
+ TT_GlyphZone zone = &load->zone;
+ FT_Error error = TT_Err_Ok;
FT_UNUSED( debug ); /* used by truetype interpreter only */
@@ -737,22 +738,22 @@
/* TT_Loader object. */
/* */
static FT_Error
- load_truetype_glyph( TT_Loader loader,
- FT_UInt glyph_index )
+ load_truetype_glyph( TT_Loader loader,
+ FT_UInt glyph_index )
{
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
- FT_Stream stream = loader->stream;
+ FT_Stream stream = loader->stream;
#endif
- FT_Error error;
- TT_Face face = (TT_Face)loader->face;
- FT_ULong offset;
- FT_Int contours_count;
- FT_UInt idx, num_points, count;
- FT_Fixed x_scale, y_scale;
- FT_GlyphLoader gloader = loader->gloader;
- FT_Bool opened_frame = 0;
+ FT_Error error;
+ TT_Face face = (TT_Face)loader->face;
+ FT_ULong offset;
+ FT_Int contours_count;
+ FT_UInt idx, num_points, count;
+ FT_Fixed x_scale, y_scale;
+ FT_GlyphLoader gloader = loader->gloader;
+ FT_Bool opened_frame = 0;
/* check glyph index */
@@ -781,8 +782,8 @@
Get_HMetrics( face, idx,
- (FT_Bool)!(loader->load_flags &
- FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH),
+ (FT_Bool)!( loader->load_flags &
+ FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ),
&left_bearing,
&advance_width );
@@ -830,16 +831,6 @@
loader->byte_len = (FT_Int)count;
-#if 0
- /* temporary hack */
- if ( count < 10 )
- {
- /* This glyph is corrupted -- it does not have a complete header */
- error = TT_Err_Invalid_Outline;
- goto Fail;
- }
-#endif
-
offset = loader->glyf_offset + offset;
/* access glyph frame */
@@ -889,7 +880,7 @@
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
{
- TT_Size size = (TT_Size)loader->size;
+ TT_Size size = (TT_Size)loader->size;
error = TT_Process_Simple_Glyph( loader,
@@ -951,9 +942,9 @@
/* set up remaining glyph fields */
FT_GlyphLoader_Add( gloader );
- glyph->num_subglyphs = gloader->base.num_subglyphs;
- glyph->format = ft_glyph_format_composite;
- glyph->subglyphs = gloader->base.subglyphs;
+ glyph->num_subglyphs = gloader->base.num_subglyphs;
+ glyph->format = ft_glyph_format_composite;
+ glyph->subglyphs = gloader->base.subglyphs;
goto Exit;
}
@@ -964,11 +955,11 @@
/* Now, read each subglyph independently. */
{
- FT_Int n, num_base_points, num_new_points;
- FT_SubGlyph subglyph = 0;
+ FT_Int n, num_base_points, num_new_points;
+ FT_SubGlyph subglyph = 0;
- FT_UInt num_subglyphs = gloader->current.num_subglyphs;
- FT_UInt num_base_subgs = gloader->base.num_subglyphs;
+ FT_UInt num_subglyphs = gloader->current.num_subglyphs;
+ FT_UInt num_base_subgs = gloader->base.num_subglyphs;
FT_GlyphLoader_Add( gloader );
@@ -1114,7 +1105,7 @@
FT_TRACE5(( " Instructions size = %d\n", n_ins ));
/* in some fonts? */
- if ( n_ins == 0xFFFF )
+ if ( n_ins == 0xFFFFU )
n_ins = 0;
/* check it */
@@ -1260,7 +1251,7 @@
/* `advance_Width_Max' field! It is used, to my knowledge, */
/* exclusively in the X-TrueType font server. */
/* */
- if ( face->postscript.isFixedPitch &&
+ if ( face->postscript.isFixedPitch &&
( loader->load_flags & FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ) == 0 )
advance = face->horizontal.advance_Width_Max;
@@ -1285,9 +1276,9 @@
FT_Short top_bearing; /* vertical top side bearing (EM units) */
FT_UShort advance_height; /* vertical advance height (EM units) */
- FT_Pos left; /* scaled vertical left side bearing */
- FT_Pos top; /* scaled vertical top side bearing */
- FT_Pos advance; /* scaled vertical advance height */
+ FT_Pos left; /* scaled vertical left side bearing */
+ FT_Pos top; /* scaled vertical top side bearing */
+ FT_Pos advance; /* scaled vertical advance height */
/* Get the unscaled `tsb' and `ah' */
@@ -1316,7 +1307,7 @@
/* here with: */
/* ascender - descender + linegap */
/* */
- if ( face->os2.version != 0xFFFF )
+ if ( face->os2.version != 0xFFFFU )
{
top_bearing = (FT_Short)( face->os2.sTypoLineGap / 2 );
advance_height = (FT_UShort)( face->os2.sTypoAscender -
@@ -1375,8 +1366,8 @@
if ( !face->postscript.isFixedPitch && size &&
IS_HINTED( loader->load_flags ) )
{
- FT_Byte* widths = Get_Advance_Widths( face,
- size->root.metrics.x_ppem );
+ FT_Byte* widths = Get_Advance_Widths( face,
+ size->root.metrics.x_ppem );
if ( widths )
@@ -1423,10 +1414,10 @@
FT_UInt load_flags )
{
SFNT_Service sfnt;
- TT_Face face;
- FT_Stream stream;
- FT_Error error;
- TT_LoaderRec loader;
+ TT_Face face;
+ FT_Stream stream;
+ FT_Error error;
+ TT_LoaderRec loader;
face = (TT_Face)glyph->face;
@@ -1452,7 +1443,7 @@
/* XXX: The convention should be emphasized in */
/* the documents because it can be confusing. */
if ( size &&
- size->strike_index != 0xFFFF &&
+ size->strike_index != 0xFFFFU &&
sfnt->load_sbits &&
( load_flags & FT_LOAD_NO_BITMAP ) == 0 )
@@ -1578,6 +1569,7 @@
/* Main loading loop */
glyph->format = ft_glyph_format_outline;
glyph->num_subglyphs = 0;
+
error = load_truetype_glyph( &loader, glyph_index );
if ( !error )
compute_glyph_metrics( &loader, glyph_index );
diff --git a/src/truetype/ttgload.h b/src/truetype/ttgload.h
index eee9057..3744523 100644
--- a/src/truetype/ttgload.h
+++ b/src/truetype/ttgload.h
@@ -4,7 +4,7 @@
/* */
/* TrueType Glyph Loader (specification). */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2001, 2002 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index 560b673..28587e6 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -4,7 +4,7 @@
/* */
/* TrueType bytecode interpreter (body). */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2001, 2002 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -1168,104 +1168,114 @@
#define NULL_Vector (FT_Vector*)&Null_Vector
- /* compute (a*b)/2^14 with maximal accuracy and rounding */
+ /* compute (a*b)/2^14 with maximal accuracy and rounding */
static FT_Int32
- TT_MulFix14( FT_Int32 a, FT_Int b )
+ TT_MulFix14( FT_Int32 a,
+ FT_Int b )
{
FT_Int32 m, s, hi;
FT_UInt32 l, lo;
+
/* compute ax*bx as 64-bit value */
- l = (FT_UInt32)( (a & 0xFFFF)*b );
- m = (a >> 16)*b;
+ l = (FT_UInt32)( ( a & 0xFFFFU ) * b );
+ m = ( a >> 16 ) * b;
- lo = l + (FT_UInt32)(m << 16);
- hi = (m >> 16) + ((FT_Int32)l >> 31) + (lo < l);
+ lo = l + (FT_UInt32)( m << 16 );
+ hi = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo < l );
/* divide the result by 2^14 with rounding */
- s = (hi >> 31);
+ s = hi >> 31;
l = lo + (FT_UInt32)s;
- hi += s + (l < lo);
+ hi += s + ( l < lo );
lo = l;
l = lo + 0x2000U;
hi += (l < lo);
- return ( (hi << 18) | (l >> 14) );
+ return ( hi << 18 ) | ( l >> 14 );
}
- /* compute (ax*bx+ay*by)/2^14 with maximal accuracy and rounding */
+ /* compute (ax*bx+ay*by)/2^14 with maximal accuracy and rounding */
static FT_Int32
- TT_DotFix14( FT_Int32 ax, FT_Int32 ay, FT_Int bx, FT_Int by )
+ TT_DotFix14( FT_Int32 ax,
+ FT_Int32 ay,
+ FT_Int bx,
+ FT_Int by )
{
FT_Int32 m, s, hi1, hi2, hi;
FT_UInt32 l, lo1, lo2, lo;
+
/* compute ax*bx as 64-bit value */
- l = (FT_UInt32)( (ax & 0xFFFF)*bx );
- m = (ax >> 16)*bx;
+ l = (FT_UInt32)( ( ax & 0xFFFFU ) * bx );
+ m = ( ax >> 16 ) * bx;
- lo1 = l + (FT_UInt32)(m << 16);
- hi1 = (m >> 16) + ((FT_Int32)l >> 31) + (lo1 < l);
+ lo1 = l + (FT_UInt32)( m << 16 );
+ hi1 = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo1 < l );
/* compute ay*by as 64-bit value */
- l = (FT_UInt32)( (ay & 0xFFFF)*by );
- m = (ay >> 16)*by;
+ l = (FT_UInt32)( ( ay & 0xFFFFU ) * by );
+ m = ( ay >> 16 ) * by;
- lo2 = l + (FT_UInt32)(m << 16);
- hi2 = (m >> 16) + ((FT_Int32)l >> 31) + (lo2 < l);
+ lo2 = l + (FT_UInt32)( m << 16 );
+ hi2 = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo2 < l );
/* add them */
lo = lo1 + lo2;
- hi = hi1 + hi2 + (lo < lo1);
+ hi = hi1 + hi2 + ( lo < lo1 );
/* divide the result by 2^14 with rounding */
- s = (hi >> 31);
+ s = hi >> 31;
l = lo + (FT_UInt32)s;
- hi += s + (l < lo);
+ hi += s + ( l < lo );
lo = l;
l = lo + 0x2000U;
- hi += (l < lo);
+ hi += ( l < lo );
- return ( (hi << 18) | (l >> 14) );
+ return ( hi << 18 ) | ( l >> 14 );
}
- /* return length of given vector */
+
+ /* return length of given vector */
+
#if 0
static FT_Int32
- TT_VecLen( FT_Int32 x, FT_Int32 y )
+ TT_VecLen( FT_Int32 x,
+ FT_Int32 y )
{
- FT_Int32 m, hi1, hi2, hi;
- FT_UInt32 l, lo1, lo2, lo;
+ FT_Int32 m, hi1, hi2, hi;
+ FT_UInt32 l, lo1, lo2, lo;
+
/* compute x*x as 64-bit value */
- lo = (FT_UInt32)(x & 0xFFFF);
- hi = (x >> 16);
+ lo = (FT_UInt32)( x & 0xFFFFU );
+ hi = x >> 16;
- l = lo*lo;
- m = hi*lo;
- hi = hi*hi;
+ l = lo * lo;
+ m = hi * lo;
+ hi = hi * hi;
- lo1 = l + (FT_UInt32)(m << 17);
- hi1 = hi + (m >> 15) + (lo1 < l);
+ lo1 = l + (FT_UInt32)( m << 17 );
+ hi1 = hi + ( m >> 15 ) + ( lo1 < l );
/* compute y*y as 64-bit value */
- lo = (FT_UInt32)( y & 0xFFFF );
- hi = (y >> 16);
+ lo = (FT_UInt32)( y & 0xFFFFU );
+ hi = y >> 16;
- l = lo*lo;
- m = hi*lo;
- hi = hi*hi;
+ l = lo * lo;
+ m = hi * lo;
+ hi = hi * hi;
- lo2 = l + (FT_UInt32)(m << 17);
- hi2 = hi + (m >> 15) + (lo2 < l);
+ lo2 = l + (FT_UInt32)( m << 17 );
+ hi2 = hi + ( m >> 15 ) + ( lo2 < l );
/* add them to get 'x*x+y*y' as 64-bit value */
lo = lo1 + lo2;
- hi = hi1 + hi2 + (lo < lo1);
+ hi = hi1 + hi2 + ( lo < lo1 );
/* compute the square root of this value */
{
@@ -1280,8 +1290,8 @@
count = 32;
do
{
- rem = ( rem << 2 ) | ( (FT_UInt32)hi >> 30 );
- hi = ( hi << 2 ) | ( lo >> 30 );
+ rem = ( rem << 2 ) | ( (FT_UInt32)hi >> 30 );
+ hi = ( hi << 2 ) | ( lo >> 30 );
lo <<= 2;
root <<= 1;
test_div = ( root << 1 ) + 1;
@@ -1297,24 +1307,28 @@
return (FT_Int32)root;
}
}
+
#else
- /* this version uses FT_Vector_Length which computes the same value */
- /* much, much faster.. */
- /* */
+ /* this version uses FT_Vector_Length which computes the same value */
+ /* much, much faster.. */
+ /* */
static FT_F26Dot6
TT_VecLen( FT_F26Dot6 X,
FT_F26Dot6 Y )
{
FT_Vector v;
+
v.x = X;
v.y = Y;
+
return FT_Vector_Length( &v );
}
#endif
+
/*************************************************************************/
/* */
/* <Function> */
@@ -1367,48 +1381,48 @@
FT_CALLBACK_DEF( FT_F26Dot6 )
- Read_CVT( EXEC_OP_ FT_ULong index )
+ Read_CVT( EXEC_OP_ FT_ULong idx )
{
- return CUR.cvt[index];
+ return CUR.cvt[idx];
}
FT_CALLBACK_DEF( FT_F26Dot6 )
- Read_CVT_Stretched( EXEC_OP_ FT_ULong index )
+ Read_CVT_Stretched( EXEC_OP_ FT_ULong idx )
{
- return TT_MULFIX( CUR.cvt[index], CURRENT_Ratio() );
+ return TT_MULFIX( CUR.cvt[idx], CURRENT_Ratio() );
}
FT_CALLBACK_DEF( void )
- Write_CVT( EXEC_OP_ FT_ULong index,
+ Write_CVT( EXEC_OP_ FT_ULong idx,
FT_F26Dot6 value )
{
- CUR.cvt[index] = value;
+ CUR.cvt[idx] = value;
}
FT_CALLBACK_DEF( void )
- Write_CVT_Stretched( EXEC_OP_ FT_ULong index,
+ Write_CVT_Stretched( EXEC_OP_ FT_ULong idx,
FT_F26Dot6 value )
{
- CUR.cvt[index] = FT_DivFix( value, CURRENT_Ratio() );
+ CUR.cvt[idx] = FT_DivFix( value, CURRENT_Ratio() );
}
FT_CALLBACK_DEF( void )
- Move_CVT( EXEC_OP_ FT_ULong index,
+ Move_CVT( EXEC_OP_ FT_ULong idx,
FT_F26Dot6 value )
{
- CUR.cvt[index] += value;
+ CUR.cvt[idx] += value;
}
FT_CALLBACK_DEF( void )
- Move_CVT_Stretched( EXEC_OP_ FT_ULong index,
+ Move_CVT_Stretched( EXEC_OP_ FT_ULong idx,
FT_F26Dot6 value )
{
- CUR.cvt[index] += FT_DivFix( value, CURRENT_Ratio() );
+ CUR.cvt[idx] += FT_DivFix( value, CURRENT_Ratio() );
}
@@ -1511,11 +1525,11 @@
/* zone :: The affected glyph zone. */
/* */
static void
- Direct_Move( EXEC_OP_ TT_GlyphZone zone,
- FT_UShort point,
- FT_F26Dot6 distance )
+ Direct_Move( EXEC_OP_ TT_GlyphZone zone,
+ FT_UShort point,
+ FT_F26Dot6 distance )
{
- FT_F26Dot6 v;
+ FT_F26Dot6 v;
v = CUR.GS.freeVector.x;
@@ -1573,9 +1587,9 @@
static void
- Direct_Move_X( EXEC_OP_ TT_GlyphZone zone,
- FT_UShort point,
- FT_F26Dot6 distance )
+ Direct_Move_X( EXEC_OP_ TT_GlyphZone zone,
+ FT_UShort point,
+ FT_F26Dot6 distance )
{
FT_UNUSED_EXEC;
@@ -1585,9 +1599,9 @@
static void
- Direct_Move_Y( EXEC_OP_ TT_GlyphZone zone,
- FT_UShort point,
- FT_F26Dot6 distance )
+ Direct_Move_Y( EXEC_OP_ TT_GlyphZone zone,
+ FT_UShort point,
+ FT_F26Dot6 distance )
{
FT_UNUSED_EXEC;
@@ -3942,8 +3956,8 @@
K = CUR.stack[CUR.args - L];
FT_MEM_MOVE( &CUR.stack[CUR.args - L ],
- &CUR.stack[CUR.args - L + 1],
- ( L - 1 ) * sizeof ( FT_Long ) );
+ &CUR.stack[CUR.args - L + 1],
+ ( L - 1 ) * sizeof ( FT_Long ) );
CUR.stack[CUR.args - 1] = K;
}
@@ -5076,14 +5090,14 @@
static FT_Bool
- Compute_Point_Displacement( EXEC_OP_ FT_F26Dot6* x,
- FT_F26Dot6* y,
- TT_GlyphZone zone,
- FT_UShort* refp )
+ Compute_Point_Displacement( EXEC_OP_ FT_F26Dot6* x,
+ FT_F26Dot6* y,
+ TT_GlyphZone zone,
+ FT_UShort* refp )
{
TT_GlyphZoneRec zp;
- FT_UShort p;
- FT_F26Dot6 d;
+ FT_UShort p;
+ FT_F26Dot6 d;
if ( CUR.opcode & 1 )
@@ -5161,11 +5175,11 @@
Ins_SHP( INS_ARG )
{
TT_GlyphZoneRec zp;
- FT_UShort refp;
+ FT_UShort refp;
- FT_F26Dot6 dx,
- dy;
- FT_UShort point;
+ FT_F26Dot6 dx,
+ dy;
+ FT_UShort point;
FT_UNUSED_ARG;
@@ -5214,12 +5228,12 @@
Ins_SHC( INS_ARG )
{
TT_GlyphZoneRec zp;
- FT_UShort refp;
- FT_F26Dot6 dx,
- dy;
+ FT_UShort refp;
+ FT_F26Dot6 dx,
+ dy;
- FT_Short contour;
- FT_UShort first_point, last_point, i;
+ FT_Short contour;
+ FT_UShort first_point, last_point, i;
contour = (FT_UShort)args[0];
@@ -5270,11 +5284,11 @@
Ins_SHZ( INS_ARG )
{
TT_GlyphZoneRec zp;
- FT_UShort refp;
- FT_F26Dot6 dx,
- dy;
+ FT_UShort refp;
+ FT_F26Dot6 dx,
+ dy;
- FT_UShort last_point, i;
+ FT_UShort last_point, i;
if ( BOUNDS( args[0], 2 ) )
diff --git a/src/truetype/ttinterp.h b/src/truetype/ttinterp.h
index 96d8316..e750963 100644
--- a/src/truetype/ttinterp.h
+++ b/src/truetype/ttinterp.h
@@ -4,7 +4,7 @@
/* */
/* TrueType bytecode interpreter (specification). */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2001, 2002 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -73,9 +73,9 @@ FT_BEGIN_HEADER
/* Point displacement along the freedom vector routine */
typedef void
- (*TT_Move_Func)( EXEC_OP_ TT_GlyphZone zone,
- FT_UShort point,
- FT_F26Dot6 distance );
+ (*TT_Move_Func)( EXEC_OP_ TT_GlyphZone zone,
+ FT_UShort point,
+ FT_F26Dot6 distance );
/* Distance projection along one of the projection vectors */
typedef FT_F26Dot6
@@ -84,12 +84,12 @@ FT_BEGIN_HEADER
/* reading a cvt value. Take care of non-square pixels if necessary */
typedef FT_F26Dot6
- (*TT_Get_CVT_Func)( EXEC_OP_ FT_ULong index );
+ (*TT_Get_CVT_Func)( EXEC_OP_ FT_ULong idx );
/* setting or moving a cvt value. Take care of non-square pixels */
/* if necessary */
typedef void
- (*TT_Set_CVT_Func)( EXEC_OP_ FT_ULong index,
+ (*TT_Set_CVT_Func)( EXEC_OP_ FT_ULong idx,
FT_F26Dot6 value );
@@ -114,90 +114,90 @@ FT_BEGIN_HEADER
/* */
typedef struct TT_ExecContextRec_
{
- TT_Face face;
- TT_Size size;
- FT_Memory memory;
+ TT_Face face;
+ TT_Size size;
+ FT_Memory memory;
/* instructions state */
- FT_Error error; /* last execution error */
+ FT_Error error; /* last execution error */
- FT_Long top; /* top of exec. stack */
+ FT_Long top; /* top of exec. stack */
- FT_UInt stackSize; /* size of exec. stack */
- FT_Long* stack; /* current exec. stack */
+ FT_UInt stackSize; /* size of exec. stack */
+ FT_Long* stack; /* current exec. stack */
- FT_Long args;
- FT_UInt new_top; /* new top after exec. */
+ FT_Long args;
+ FT_UInt new_top; /* new top after exec. */
TT_GlyphZoneRec zp0, /* zone records */
- zp1,
- zp2,
- pts,
- twilight;
+ zp1,
+ zp2,
+ pts,
+ twilight;
- FT_Size_Metrics metrics;
- TT_Size_Metrics tt_metrics; /* size metrics */
+ FT_Size_Metrics metrics;
+ TT_Size_Metrics tt_metrics; /* size metrics */
- TT_GraphicsState GS; /* current graphics state */
+ TT_GraphicsState GS; /* current graphics state */
- FT_Int curRange; /* current code range number */
- FT_Byte* code; /* current code range */
- FT_Long IP; /* current instruction pointer */
- FT_Long codeSize; /* size of current range */
+ FT_Int curRange; /* current code range number */
+ FT_Byte* code; /* current code range */
+ FT_Long IP; /* current instruction pointer */
+ FT_Long codeSize; /* size of current range */
- FT_Byte opcode; /* current opcode */
- FT_Int length; /* length of current opcode */
+ FT_Byte opcode; /* current opcode */
+ FT_Int length; /* length of current opcode */
- FT_Bool step_ins; /* true if the interpreter must */
- /* increment IP after ins. exec */
- FT_Long cvtSize;
- FT_Long* cvt;
+ FT_Bool step_ins; /* true if the interpreter must */
+ /* increment IP after ins. exec */
+ FT_Long cvtSize;
+ FT_Long* cvt;
- FT_UInt glyphSize; /* glyph instructions buffer size */
- FT_Byte* glyphIns; /* glyph instructions buffer */
+ FT_UInt glyphSize; /* glyph instructions buffer size */
+ FT_Byte* glyphIns; /* glyph instructions buffer */
- FT_UInt numFDefs; /* number of function defs */
- FT_UInt maxFDefs; /* maximum number of function defs */
- TT_DefArray FDefs; /* table of FDefs entries */
+ FT_UInt numFDefs; /* number of function defs */
+ FT_UInt maxFDefs; /* maximum number of function defs */
+ TT_DefArray FDefs; /* table of FDefs entries */
- FT_UInt numIDefs; /* number of instruction defs */
- FT_UInt maxIDefs; /* maximum number of ins defs */
- TT_DefArray IDefs; /* table of IDefs entries */
+ FT_UInt numIDefs; /* number of instruction defs */
+ FT_UInt maxIDefs; /* maximum number of ins defs */
+ TT_DefArray IDefs; /* table of IDefs entries */
- FT_UInt maxFunc; /* maximum function index */
- FT_UInt maxIns; /* maximum instruction index */
+ FT_UInt maxFunc; /* maximum function index */
+ FT_UInt maxIns; /* maximum instruction index */
- FT_Int callTop, /* top of call stack during execution */
- callSize; /* size of call stack */
- TT_CallStack callStack; /* call stack */
+ FT_Int callTop, /* top of call stack during execution */
+ callSize; /* size of call stack */
+ TT_CallStack callStack; /* call stack */
- FT_UShort maxPoints; /* capacity of this context's `pts' */
- FT_Short maxContours; /* record, expressed in points and */
- /* contours. */
+ FT_UShort maxPoints; /* capacity of this context's `pts' */
+ FT_Short maxContours; /* record, expressed in points and */
+ /* contours. */
TT_CodeRangeTable codeRangeTable; /* table of valid code ranges */
/* useful for the debugger */
- FT_UShort storeSize; /* size of current storage */
- FT_Long* storage; /* storage area */
+ FT_UShort storeSize; /* size of current storage */
+ FT_Long* storage; /* storage area */
- FT_F26Dot6 period; /* values used for the */
- FT_F26Dot6 phase; /* `SuperRounding' */
- FT_F26Dot6 threshold;
+ FT_F26Dot6 period; /* values used for the */
+ FT_F26Dot6 phase; /* `SuperRounding' */
+ FT_F26Dot6 threshold;
#if 0
/* this seems to be unused */
- FT_Int cur_ppem; /* ppem along the current proj vector */
+ FT_Int cur_ppem; /* ppem along the current proj vector */
#endif
- FT_Bool instruction_trap; /* If `True', the interpreter will */
- /* exit after each instruction */
+ FT_Bool instruction_trap; /* If `True', the interpreter will */
+ /* exit after each instruction */
- TT_GraphicsState default_GS; /* graphics state resulting from */
- /* the prep program */
- FT_Bool is_composite; /* true if the glyph is composite */
- FT_Bool pedantic_hinting; /* true for pedantic interpretation */
+ TT_GraphicsState default_GS; /* graphics state resulting from */
+ /* the prep program */
+ FT_Bool is_composite; /* true if the glyph is composite */
+ FT_Bool pedantic_hinting; /* true if pedantic interpretation */
/* latest interpreter additions */
diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c
index 2d443cf..cab9d1b 100644
--- a/src/truetype/ttobjs.c
+++ b/src/truetype/ttobjs.c
@@ -4,7 +4,7 @@
/* */
/* Objects manager (body). */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2001, 2002 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -66,7 +66,7 @@
/* zone :: A pointer to the target glyph zone. */
/* */
FT_LOCAL_DEF( void )
- TT_Done_GlyphZone( TT_GlyphZone zone )
+ TT_Done_GlyphZone( TT_GlyphZone zone )
{
FT_Memory memory = zone->memory;
@@ -103,10 +103,10 @@
/* FreeType error code. 0 means success. */
/* */
FT_LOCAL_DEF( FT_Error )
- TT_New_GlyphZone( FT_Memory memory,
- FT_UShort maxPoints,
- FT_Short maxContours,
- TT_GlyphZone zone )
+ TT_New_GlyphZone( FT_Memory memory,
+ FT_UShort maxPoints,
+ FT_Short maxContours,
+ TT_GlyphZone zone )
{
FT_Error error;
@@ -160,8 +160,8 @@
FT_Int num_params,
FT_Parameter* params )
{
- FT_Error error;
- FT_Library library;
+ FT_Error error;
+ FT_Library library;
SFNT_Service sfnt;
@@ -227,10 +227,10 @@
FT_LOCAL_DEF( void )
TT_Face_Done( TT_Face face )
{
- FT_Memory memory = face->root.memory;
- FT_Stream stream = face->root.stream;
+ FT_Memory memory = face->root.memory;
+ FT_Stream stream = face->root.stream;
- SFNT_Service sfnt = (SFNT_Service)face->sfnt;
+ SFNT_Service sfnt = (SFNT_Service)face->sfnt;
/* for `extended TrueType formats' (i.e. compressed versions) */
@@ -326,10 +326,10 @@
}
/* allocate function defs, instruction defs, cvt, and storage area */
- if ( FT_NEW_ARRAY( size->function_defs, size->max_function_defs ) ||
+ if ( FT_NEW_ARRAY( size->function_defs, size->max_function_defs ) ||
FT_NEW_ARRAY( size->instruction_defs, size->max_instruction_defs ) ||
- FT_NEW_ARRAY( size->cvt, size->cvt_size ) ||
- FT_NEW_ARRAY( size->storage, size->storage_size ) )
+ FT_NEW_ARRAY( size->cvt, size->cvt_size ) ||
+ FT_NEW_ARRAY( size->storage, size->storage_size ) )
goto Fail_Memory;
@@ -513,8 +513,8 @@
static FT_Error
Reset_Outline_Size( TT_Size size )
{
- TT_Face face;
- FT_Error error = TT_Err_Ok;
+ TT_Face face;
+ FT_Error error = TT_Err_Ok;
FT_Size_Metrics* metrics;
@@ -561,7 +561,7 @@
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
/* set to `invalid' by default */
- size->strike_index = 0xFFFF;
+ size->strike_index = 0xFFFFU;
#endif
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
@@ -670,12 +670,12 @@
FT_ULong strike_index;
FT_Size_Metrics* metrics;
FT_Size_Metrics* sbit_metrics;
- SFNT_Service sfnt;
+ SFNT_Service sfnt;
metrics = &size->root.metrics;
- if ( size->strike_index != 0xFFFF )
+ if ( size->strike_index != 0xFFFFU )
return TT_Err_Ok;
face = (TT_Face)size->root.face;
@@ -689,7 +689,7 @@
if ( !error )
{
- TT_SBit_Strike strike = face->sbit_strikes + strike_index;
+ TT_SBit_Strike strike = face->sbit_strikes + strike_index;
sbit_metrics->x_ppem = metrics->x_ppem;
@@ -719,7 +719,7 @@
}
else
{
- size->strike_index = 0xFFFF;
+ size->strike_index = 0xFFFFU;
sbit_metrics->x_ppem = 0;
sbit_metrics->y_ppem = 0;
@@ -769,7 +769,7 @@
if ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )
{
- if ( size->strike_index == 0xFFFF )
+ if ( size->strike_index == 0xFFFFU )
error = Reset_SBit_Size( size );
if ( !error && !( face->face_flags & FT_FACE_FLAG_SCALABLE ) )
diff --git a/src/truetype/ttobjs.h b/src/truetype/ttobjs.h
index 7871788..4fb48d0 100644
--- a/src/truetype/ttobjs.h
+++ b/src/truetype/ttobjs.h
@@ -4,7 +4,7 @@
/* */
/* Objects manager (specification). */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2001, 2002 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -108,13 +108,13 @@ FT_BEGIN_HEADER
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
FT_LOCAL( void )
- TT_Done_GlyphZone( TT_GlyphZone zone );
+ TT_Done_GlyphZone( TT_GlyphZone zone );
FT_LOCAL( FT_Error )
- TT_New_GlyphZone( FT_Memory memory,
- FT_UShort maxPoints,
- FT_Short maxContours,
- TT_GlyphZone zone );
+ TT_New_GlyphZone( FT_Memory memory,
+ FT_UShort maxPoints,
+ FT_Short maxContours,
+ TT_GlyphZone zone );
#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
@@ -192,27 +192,27 @@ FT_BEGIN_HEADER
/* */
typedef struct TT_SubglyphRec_
{
- FT_Long index; /* subglyph index; initialized with -1 */
- FT_Bool is_scaled; /* is the subglyph scaled? */
- FT_Bool is_hinted; /* should it be hinted? */
- FT_Bool preserve_pps; /* preserve phantom points? */
+ FT_Long index; /* subglyph index; initialized with -1 */
+ FT_Bool is_scaled; /* is the subglyph scaled? */
+ FT_Bool is_hinted; /* should it be hinted? */
+ FT_Bool preserve_pps; /* preserve phantom points? */
- FT_Long file_offset;
+ FT_Long file_offset;
- FT_BBox bbox;
- FT_Pos left_bearing;
- FT_Pos advance;
+ FT_BBox bbox;
+ FT_Pos left_bearing;
+ FT_Pos advance;
TT_GlyphZoneRec zone;
- FT_Long arg1; /* first argument */
- FT_Long arg2; /* second argument */
+ FT_Long arg1; /* first argument */
+ FT_Long arg2; /* second argument */
- FT_UShort element_flag; /* current load element flag */
+ FT_UShort element_flag; /* current load element flag */
- TT_Transform transform; /* transformation matrix */
+ TT_Transform transform; /* transformation matrix */
- FT_Vector pp1, pp2; /* phantom points */
+ FT_Vector pp1, pp2; /* phantom points */
} TT_SubGlyphRec, *TT_SubGlyph_Stack;
@@ -343,7 +343,7 @@ FT_BEGIN_HEADER
FT_UShort storage_size; /* The storage area is now part of */
FT_Long* storage; /* the instance */
- TT_GlyphZoneRec twilight; /* The instance's twilight zone */
+ TT_GlyphZoneRec twilight; /* The instance's twilight zone */
/* debugging variables */
@@ -365,11 +365,11 @@ FT_BEGIN_HEADER
/* */
typedef struct TT_DriverRec_
{
- FT_DriverRec root;
- TT_ExecContext context; /* execution context */
- TT_GlyphZoneRec zone; /* glyph loader points zone */
+ FT_DriverRec root;
+ TT_ExecContext context; /* execution context */
+ TT_GlyphZoneRec zone; /* glyph loader points zone */
- void* extension_component;
+ void* extension_component;
} TT_DriverRec;
diff --git a/src/truetype/ttpload.c b/src/truetype/ttpload.c
index 212d484..19bd0f8 100644
--- a/src/truetype/ttpload.c
+++ b/src/truetype/ttpload.c
@@ -4,7 +4,7 @@
/* */
/* TrueType glyph data/program tables loader (body). */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2001, 2002 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/truetype/ttpload.h b/src/truetype/ttpload.h
index 26de13e..c83b2f2 100644
--- a/src/truetype/ttpload.h
+++ b/src/truetype/ttpload.h
@@ -4,7 +4,7 @@
/* */
/* TrueType glyph data/program tables loader (specification). */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2001, 2002 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */