* include/freetype/fttypes.h src/autofit/afangles.c src/autofit/aflatin.c src/autohint/ahglyph.c src/autohint/ahhint.c src/base/ftcalc.c src/base/ftgloadr.c src/base/ftglyph.c src/base/ftobjs.c src/base/ftsynth.c src/base/fttrigon.c src/cff/cffgload.c src/cid/cidgload.c src/cid/cidload.c src/pfr/pfrgload.c src/pfr/pfrload.c src/pfr/pfrsbit.c src/psaux/psobjs.c src/pshinter/pshalgo.c src/pshinter/pshglob.c src/pshinter/pshrec.c src/raster/ftrend1.c src/sfnt/ttcmap0.c src/smooth/ftsmooth.c src/truetype/ttdriver.c src/truetype/ttgload.c src/truetype/ttinterp.c src/truetype/ttobjs.c src/type1/t1gload.c src/winfonts/winfnt.c: use of the FT_PAD_XXX and FT_PIX_XXX macros to avoid compiler warnings with very pedantic compilers. Hints: (x) & -64 will warn if (x) is not signed.. use (x) & ~63 instead !
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475
diff --git a/ChangeLog b/ChangeLog
index fc8f0dc..5864787 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,41 @@
+2003-12-23 David Turner <david@freetype.org>
+
+ * include/freetype/fttypes.h
+ src/autofit/afangles.c
+ src/autofit/aflatin.c
+ src/autohint/ahglyph.c
+ src/autohint/ahhint.c
+ src/base/ftcalc.c
+ src/base/ftgloadr.c
+ src/base/ftglyph.c
+ src/base/ftobjs.c
+ src/base/ftsynth.c
+ src/base/fttrigon.c
+ src/cff/cffgload.c
+ src/cid/cidgload.c
+ src/cid/cidload.c
+ src/pfr/pfrgload.c
+ src/pfr/pfrload.c
+ src/pfr/pfrsbit.c
+ src/psaux/psobjs.c
+ src/pshinter/pshalgo.c
+ src/pshinter/pshglob.c
+ src/pshinter/pshrec.c
+ src/raster/ftrend1.c
+ src/sfnt/ttcmap0.c
+ src/smooth/ftsmooth.c
+ src/truetype/ttdriver.c
+ src/truetype/ttgload.c
+ src/truetype/ttinterp.c
+ src/truetype/ttobjs.c
+ src/type1/t1gload.c
+ src/winfonts/winfnt.c:
+
+ use of the FT_PAD_XXX and FT_PIX_XXX macros to avoid compiler
+ warnings with very pedantic compilers. Hints: (x) & -64 will
+ warn if (x) is not signed.. use (x) & ~63 instead !
+
+
2003-12-22 Werner Lemberg <wl@gnu.org>
* include/freetype/ftwinfnt.h (FT_WinFNT_ID_*): New definitions
diff --git a/include/freetype/fttypes.h b/include/freetype/fttypes.h
index 2782f74..50e078f 100644
--- a/include/freetype/fttypes.h
+++ b/include/freetype/fttypes.h
@@ -1,558 +1,558 @@
-/***************************************************************************/
-/* */
-/* fttypes.h */
-/* */
-/* FreeType simple types definitions (specification only). */
-/* */
-/* Copyright 1996-2001 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. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FTTYPES_H__
-#define __FTTYPES_H__
-
-
-#include <ft2build.h>
-#include FT_CONFIG_CONFIG_H
-#include FT_SYSTEM_H
-#include FT_IMAGE_H
-
-#include <stddef.h>
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* basic_types */
- /* */
- /* <Title> */
- /* Basic Data Types */
- /* */
- /* <Abstract> */
- /* The basic data types defined by the library. */
- /* */
- /* <Description> */
- /* This section contains the basic data types defined by FreeType 2, */
- /* ranging from simple scalar types to bitmap descriptors. More */
- /* font-specific structures are defined in a different section. */
- /* */
- /* <Order> */
- /* FT_Byte */
- /* FT_Char */
- /* FT_Int */
- /* FT_UInt */
- /* FT_Short */
- /* FT_UShort */
- /* FT_Long */
- /* FT_ULong */
- /* FT_Bool */
- /* FT_Offset */
- /* FT_PtrDist */
- /* FT_String */
- /* FT_Error */
- /* FT_Fixed */
- /* FT_Pointer */
- /* FT_Pos */
- /* FT_Vector */
- /* FT_BBox */
- /* FT_Matrix */
- /* FT_FWord */
- /* FT_UFWord */
- /* FT_F2Dot14 */
- /* FT_UnitVector */
- /* FT_F26Dot6 */
- /* */
- /* */
- /* FT_Generic */
- /* FT_Generic_Finalizer */
- /* */
- /* FT_Bitmap */
- /* FT_Pixel_Mode */
- /* FT_Palette_Mode */
- /* FT_Glyph_Format */
- /* FT_IMAGE_TAG */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Bool */
- /* */
- /* <Description> */
- /* A typedef of unsigned char, used for simple booleans. */
- /* */
- typedef unsigned char FT_Bool;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_FWord */
- /* */
- /* <Description> */
- /* A signed 16-bit integer used to store a distance in original font */
- /* units. */
- /* */
- typedef signed short FT_FWord; /* distance in FUnits */
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_UFWord */
- /* */
- /* <Description> */
- /* An unsigned 16-bit integer used to store a distance in original */
- /* font units. */
- /* */
- typedef unsigned short FT_UFWord; /* unsigned distance */
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Char */
- /* */
- /* <Description> */
- /* A simple typedef for the _signed_ char type. */
- /* */
- typedef signed char FT_Char;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Byte */
- /* */
- /* <Description> */
- /* A simple typedef for the _unsigned_ char type. */
- /* */
- typedef unsigned char FT_Byte;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_String */
- /* */
- /* <Description> */
- /* A simple typedef for the char type, usually used for strings. */
- /* */
- typedef char FT_String;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Short */
- /* */
- /* <Description> */
- /* A typedef for signed short. */
- /* */
- typedef signed short FT_Short;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_UShort */
- /* */
- /* <Description> */
- /* A typedef for unsigned short. */
- /* */
- typedef unsigned short FT_UShort;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Int */
- /* */
- /* <Description> */
- /* A typedef for the int type. */
- /* */
- typedef int FT_Int;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_UInt */
- /* */
- /* <Description> */
- /* A typedef for the unsigned int type. */
- /* */
- typedef unsigned int FT_UInt;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Long */
- /* */
- /* <Description> */
- /* A typedef for signed long. */
- /* */
- typedef signed long FT_Long;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_ULong */
- /* */
- /* <Description> */
- /* A typedef for unsigned long. */
- /* */
- typedef unsigned long FT_ULong;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_F2Dot14 */
- /* */
- /* <Description> */
- /* A signed 2.14 fixed float type used for unit vectors. */
- /* */
- typedef signed short FT_F2Dot14;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_F26Dot6 */
- /* */
- /* <Description> */
- /* A signed 26.6 fixed float type used for vectorial pixel */
- /* coordinates. */
- /* */
- typedef signed long FT_F26Dot6;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Fixed */
- /* */
- /* <Description> */
- /* This type is used to store 16.16 fixed float values, like scales */
- /* or matrix coefficients. */
- /* */
- typedef signed long FT_Fixed;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Error */
- /* */
- /* <Description> */
- /* The FreeType error code type. A value of 0 is always interpreted */
- /* as a successful operation. */
- /* */
- typedef int FT_Error;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Pointer */
- /* */
- /* <Description> */
- /* A simple typedef for a typeless pointer. */
- /* */
- typedef void* FT_Pointer;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Offset */
- /* */
- /* <Description> */
- /* This is equivalent to the ANSI C `size_t' type, i.e. the largest */
- /* _unsigned_ integer type used to express a file size or position, */
- /* or a memory block size. */
- /* */
- typedef size_t FT_Offset;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_PtrDist */
- /* */
- /* <Description> */
- /* This is equivalent to the ANSI C `ptrdiff_t' type, i.e. the */
- /* largest _signed_ integer type used to express the distance */
- /* between two pointers. */
- /* */
- typedef size_t FT_PtrDist;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_UnitVector */
- /* */
- /* <Description> */
- /* A simple structure used to store a 2D vector unit vector. Uses */
- /* FT_F2Dot14 types. */
- /* */
- /* <Fields> */
- /* x :: Horizontal coordinate. */
- /* */
- /* y :: Vertical coordinate. */
- /* */
- typedef struct FT_UnitVector_
- {
- FT_F2Dot14 x;
- FT_F2Dot14 y;
-
- } FT_UnitVector;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Matrix */
- /* */
- /* <Description> */
- /* A simple structure used to store a 2x2 matrix. Coefficients are */
- /* in 16.16 fixed float format. The computation performed is: */
- /* */
- /* { */
- /* x' = x*xx + y*xy */
- /* y' = x*yx + y*yy */
- /* } */
- /* */
- /* <Fields> */
- /* xx :: Matrix coefficient. */
- /* */
- /* xy :: Matrix coefficient. */
- /* */
- /* yx :: Matrix coefficient. */
- /* */
- /* yy :: Matrix coefficient. */
- /* */
- typedef struct FT_Matrix_
- {
- FT_Fixed xx, xy;
- FT_Fixed yx, yy;
-
- } FT_Matrix;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Data */
- /* */
- /* <Description> */
- /* Read-only binary data represented as a pointer and a length. */
- /* */
- /* <Fields> */
- /* pointer :: The data. */
- /* */
- /* length :: The length of the data in bytes. */
- /* */
- typedef struct FT_Data_
- {
- const FT_Byte* pointer;
- FT_Int length;
-
- } FT_Data;
-
-
- /*************************************************************************/
- /* */
- /* <FuncType> */
- /* FT_Generic_Finalizer */
- /* */
- /* <Description> */
- /* Describes a function used to destroy the `client' data of any */
- /* FreeType object. See the description of the FT_Generic type for */
- /* details of usage. */
- /* */
- /* <Input> */
- /* The address of the FreeType object which is under finalization. */
- /* Its client data is accessed through its `generic' field. */
- /* */
- typedef void (*FT_Generic_Finalizer)(void* object);
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Generic */
- /* */
- /* <Description> */
- /* Client applications often need to associate their own data to a */
- /* variety of FreeType core objects. For example, a text layout API */
- /* might want to associate a glyph cache to a given size object. */
- /* */
- /* Most FreeType object contains a `generic' field, of type */
- /* FT_Generic, which usage is left to client applications and font */
- /* servers. */
- /* */
- /* It can be used to store a pointer to client-specific data, as well */
- /* as the address of a `finalizer' function, which will be called by */
- /* FreeType when the object is destroyed (for example, the previous */
- /* client example would put the address of the glyph cache destructor */
- /* in the `finalizer' field). */
- /* */
- /* <Fields> */
- /* data :: A typeless pointer to any client-specified data. This */
- /* field is completely ignored by the FreeType library. */
- /* */
- /* finalizer :: A pointer to a `generic finalizer' function, which */
- /* will be called when the object is destroyed. If this */
- /* field is set to NULL, no code will be called. */
- /* */
- typedef struct FT_Generic_
- {
- void* data;
- FT_Generic_Finalizer finalizer;
-
- } FT_Generic;
-
-
- /*************************************************************************/
- /* */
- /* <Macro> */
- /* FT_MAKE_TAG */
- /* */
- /* <Description> */
- /* This macro converts four letter tags which are used to label */
- /* TrueType tables into an unsigned long to be used within FreeType. */
- /* */
- /* <Note> */
- /* The produced values *must* be 32bit integers. Don't redefine this */
- /* macro. */
- /* */
-#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
- ( ( (FT_ULong)_x1 << 24 ) | \
- ( (FT_ULong)_x2 << 16 ) | \
- ( (FT_ULong)_x3 << 8 ) | \
- (FT_ULong)_x4 )
-
-
- /*************************************************************************/
- /*************************************************************************/
- /* */
- /* L I S T M A N A G E M E N T */
- /* */
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* list_processing */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_ListNode */
- /* */
- /* <Description> */
- /* Many elements and objects in FreeType are listed through a */
- /* FT_List record (see FT_ListRec). As its name suggests, a */
- /* FT_ListNode is a handle to a single list element. */
- /* */
- typedef struct FT_ListNodeRec_* FT_ListNode;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_List */
- /* */
- /* <Description> */
- /* A handle to a list record (see FT_ListRec). */
- /* */
- typedef struct FT_ListRec_* FT_List;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_ListNodeRec */
- /* */
- /* <Description> */
- /* A structure used to hold a single list element. */
- /* */
- /* <Fields> */
- /* prev :: The previous element in the list. NULL if first. */
- /* */
- /* next :: The next element in the list. NULL if last. */
- /* */
- /* data :: A typeless pointer to the listed object. */
- /* */
- typedef struct FT_ListNodeRec_
- {
- FT_ListNode prev;
- FT_ListNode next;
- void* data;
-
- } FT_ListNodeRec;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_ListRec */
- /* */
- /* <Description> */
- /* A structure used to hold a simple doubly-linked list. These are */
- /* used in many parts of FreeType. */
- /* */
- /* <Fields> */
- /* head :: The head (first element) of doubly-linked list. */
- /* */
- /* tail :: The tail (last element) of doubly-linked list. */
- /* */
- typedef struct FT_ListRec_
- {
- FT_ListNode head;
- FT_ListNode tail;
-
- } FT_ListRec;
-
-
- /* */
-
-#define FT_IS_EMPTY( list ) ( (list).head == 0 )
-
- /* return base error code (without module-specific prefix) */
-#define FT_ERROR_BASE( x ) ( (x) & 0xFF )
-
- /* return module error code */
-#define FT_ERROR_MODULE( x ) ( (x) & 0xFF00U )
-
-#define FT_BOOL( x ) ( (FT_Bool)( x ) )
-
-FT_END_HEADER
-
-#endif /* __FTTYPES_H__ */
-
-
-/* END */
+/***************************************************************************/
+/* */
+/* fttypes.h */
+/* */
+/* FreeType simple types definitions (specification only). */
+/* */
+/* Copyright 1996-2001 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. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTTYPES_H__
+#define __FTTYPES_H__
+
+
+#include <ft2build.h>
+#include FT_CONFIG_CONFIG_H
+#include FT_SYSTEM_H
+#include FT_IMAGE_H
+
+#include <stddef.h>
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* basic_types */
+ /* */
+ /* <Title> */
+ /* Basic Data Types */
+ /* */
+ /* <Abstract> */
+ /* The basic data types defined by the library. */
+ /* */
+ /* <Description> */
+ /* This section contains the basic data types defined by FreeType 2, */
+ /* ranging from simple scalar types to bitmap descriptors. More */
+ /* font-specific structures are defined in a different section. */
+ /* */
+ /* <Order> */
+ /* FT_Byte */
+ /* FT_Char */
+ /* FT_Int */
+ /* FT_UInt */
+ /* FT_Short */
+ /* FT_UShort */
+ /* FT_Long */
+ /* FT_ULong */
+ /* FT_Bool */
+ /* FT_Offset */
+ /* FT_PtrDist */
+ /* FT_String */
+ /* FT_Error */
+ /* FT_Fixed */
+ /* FT_Pointer */
+ /* FT_Pos */
+ /* FT_Vector */
+ /* FT_BBox */
+ /* FT_Matrix */
+ /* FT_FWord */
+ /* FT_UFWord */
+ /* FT_F2Dot14 */
+ /* FT_UnitVector */
+ /* FT_F26Dot6 */
+ /* */
+ /* */
+ /* FT_Generic */
+ /* FT_Generic_Finalizer */
+ /* */
+ /* FT_Bitmap */
+ /* FT_Pixel_Mode */
+ /* FT_Palette_Mode */
+ /* FT_Glyph_Format */
+ /* FT_IMAGE_TAG */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Bool */
+ /* */
+ /* <Description> */
+ /* A typedef of unsigned char, used for simple booleans. */
+ /* */
+ typedef unsigned char FT_Bool;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_FWord */
+ /* */
+ /* <Description> */
+ /* A signed 16-bit integer used to store a distance in original font */
+ /* units. */
+ /* */
+ typedef signed short FT_FWord; /* distance in FUnits */
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_UFWord */
+ /* */
+ /* <Description> */
+ /* An unsigned 16-bit integer used to store a distance in original */
+ /* font units. */
+ /* */
+ typedef unsigned short FT_UFWord; /* unsigned distance */
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Char */
+ /* */
+ /* <Description> */
+ /* A simple typedef for the _signed_ char type. */
+ /* */
+ typedef signed char FT_Char;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Byte */
+ /* */
+ /* <Description> */
+ /* A simple typedef for the _unsigned_ char type. */
+ /* */
+ typedef unsigned char FT_Byte;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_String */
+ /* */
+ /* <Description> */
+ /* A simple typedef for the char type, usually used for strings. */
+ /* */
+ typedef char FT_String;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Short */
+ /* */
+ /* <Description> */
+ /* A typedef for signed short. */
+ /* */
+ typedef signed short FT_Short;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_UShort */
+ /* */
+ /* <Description> */
+ /* A typedef for unsigned short. */
+ /* */
+ typedef unsigned short FT_UShort;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Int */
+ /* */
+ /* <Description> */
+ /* A typedef for the int type. */
+ /* */
+ typedef int FT_Int;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_UInt */
+ /* */
+ /* <Description> */
+ /* A typedef for the unsigned int type. */
+ /* */
+ typedef unsigned int FT_UInt;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Long */
+ /* */
+ /* <Description> */
+ /* A typedef for signed long. */
+ /* */
+ typedef signed long FT_Long;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_ULong */
+ /* */
+ /* <Description> */
+ /* A typedef for unsigned long. */
+ /* */
+ typedef unsigned long FT_ULong;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_F2Dot14 */
+ /* */
+ /* <Description> */
+ /* A signed 2.14 fixed float type used for unit vectors. */
+ /* */
+ typedef signed short FT_F2Dot14;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_F26Dot6 */
+ /* */
+ /* <Description> */
+ /* A signed 26.6 fixed float type used for vectorial pixel */
+ /* coordinates. */
+ /* */
+ typedef signed long FT_F26Dot6;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Fixed */
+ /* */
+ /* <Description> */
+ /* This type is used to store 16.16 fixed float values, like scales */
+ /* or matrix coefficients. */
+ /* */
+ typedef signed long FT_Fixed;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Error */
+ /* */
+ /* <Description> */
+ /* The FreeType error code type. A value of 0 is always interpreted */
+ /* as a successful operation. */
+ /* */
+ typedef int FT_Error;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Pointer */
+ /* */
+ /* <Description> */
+ /* A simple typedef for a typeless pointer. */
+ /* */
+ typedef void* FT_Pointer;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Offset */
+ /* */
+ /* <Description> */
+ /* This is equivalent to the ANSI C `size_t' type, i.e. the largest */
+ /* _unsigned_ integer type used to express a file size or position, */
+ /* or a memory block size. */
+ /* */
+ typedef size_t FT_Offset;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_PtrDist */
+ /* */
+ /* <Description> */
+ /* This is equivalent to the ANSI C `ptrdiff_t' type, i.e. the */
+ /* largest _signed_ integer type used to express the distance */
+ /* between two pointers. */
+ /* */
+ typedef size_t FT_PtrDist;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_UnitVector */
+ /* */
+ /* <Description> */
+ /* A simple structure used to store a 2D vector unit vector. Uses */
+ /* FT_F2Dot14 types. */
+ /* */
+ /* <Fields> */
+ /* x :: Horizontal coordinate. */
+ /* */
+ /* y :: Vertical coordinate. */
+ /* */
+ typedef struct FT_UnitVector_
+ {
+ FT_F2Dot14 x;
+ FT_F2Dot14 y;
+
+ } FT_UnitVector;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Matrix */
+ /* */
+ /* <Description> */
+ /* A simple structure used to store a 2x2 matrix. Coefficients are */
+ /* in 16.16 fixed float format. The computation performed is: */
+ /* */
+ /* { */
+ /* x' = x*xx + y*xy */
+ /* y' = x*yx + y*yy */
+ /* } */
+ /* */
+ /* <Fields> */
+ /* xx :: Matrix coefficient. */
+ /* */
+ /* xy :: Matrix coefficient. */
+ /* */
+ /* yx :: Matrix coefficient. */
+ /* */
+ /* yy :: Matrix coefficient. */
+ /* */
+ typedef struct FT_Matrix_
+ {
+ FT_Fixed xx, xy;
+ FT_Fixed yx, yy;
+
+ } FT_Matrix;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Data */
+ /* */
+ /* <Description> */
+ /* Read-only binary data represented as a pointer and a length. */
+ /* */
+ /* <Fields> */
+ /* pointer :: The data. */
+ /* */
+ /* length :: The length of the data in bytes. */
+ /* */
+ typedef struct FT_Data_
+ {
+ const FT_Byte* pointer;
+ FT_Int length;
+
+ } FT_Data;
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Generic_Finalizer */
+ /* */
+ /* <Description> */
+ /* Describes a function used to destroy the `client' data of any */
+ /* FreeType object. See the description of the FT_Generic type for */
+ /* details of usage. */
+ /* */
+ /* <Input> */
+ /* The address of the FreeType object which is under finalization. */
+ /* Its client data is accessed through its `generic' field. */
+ /* */
+ typedef void (*FT_Generic_Finalizer)(void* object);
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Generic */
+ /* */
+ /* <Description> */
+ /* Client applications often need to associate their own data to a */
+ /* variety of FreeType core objects. For example, a text layout API */
+ /* might want to associate a glyph cache to a given size object. */
+ /* */
+ /* Most FreeType object contains a `generic' field, of type */
+ /* FT_Generic, which usage is left to client applications and font */
+ /* servers. */
+ /* */
+ /* It can be used to store a pointer to client-specific data, as well */
+ /* as the address of a `finalizer' function, which will be called by */
+ /* FreeType when the object is destroyed (for example, the previous */
+ /* client example would put the address of the glyph cache destructor */
+ /* in the `finalizer' field). */
+ /* */
+ /* <Fields> */
+ /* data :: A typeless pointer to any client-specified data. This */
+ /* field is completely ignored by the FreeType library. */
+ /* */
+ /* finalizer :: A pointer to a `generic finalizer' function, which */
+ /* will be called when the object is destroyed. If this */
+ /* field is set to NULL, no code will be called. */
+ /* */
+ typedef struct FT_Generic_
+ {
+ void* data;
+ FT_Generic_Finalizer finalizer;
+
+ } FT_Generic;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Macro> */
+ /* FT_MAKE_TAG */
+ /* */
+ /* <Description> */
+ /* This macro converts four letter tags which are used to label */
+ /* TrueType tables into an unsigned long to be used within FreeType. */
+ /* */
+ /* <Note> */
+ /* The produced values *must* be 32bit integers. Don't redefine this */
+ /* macro. */
+ /* */
+#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
+ ( ( (FT_ULong)_x1 << 24 ) | \
+ ( (FT_ULong)_x2 << 16 ) | \
+ ( (FT_ULong)_x3 << 8 ) | \
+ (FT_ULong)_x4 )
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /* */
+ /* L I S T M A N A G E M E N T */
+ /* */
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* list_processing */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_ListNode */
+ /* */
+ /* <Description> */
+ /* Many elements and objects in FreeType are listed through a */
+ /* FT_List record (see FT_ListRec). As its name suggests, a */
+ /* FT_ListNode is a handle to a single list element. */
+ /* */
+ typedef struct FT_ListNodeRec_* FT_ListNode;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_List */
+ /* */
+ /* <Description> */
+ /* A handle to a list record (see FT_ListRec). */
+ /* */
+ typedef struct FT_ListRec_* FT_List;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_ListNodeRec */
+ /* */
+ /* <Description> */
+ /* A structure used to hold a single list element. */
+ /* */
+ /* <Fields> */
+ /* prev :: The previous element in the list. NULL if first. */
+ /* */
+ /* next :: The next element in the list. NULL if last. */
+ /* */
+ /* data :: A typeless pointer to the listed object. */
+ /* */
+ typedef struct FT_ListNodeRec_
+ {
+ FT_ListNode prev;
+ FT_ListNode next;
+ void* data;
+
+ } FT_ListNodeRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_ListRec */
+ /* */
+ /* <Description> */
+ /* A structure used to hold a simple doubly-linked list. These are */
+ /* used in many parts of FreeType. */
+ /* */
+ /* <Fields> */
+ /* head :: The head (first element) of doubly-linked list. */
+ /* */
+ /* tail :: The tail (last element) of doubly-linked list. */
+ /* */
+ typedef struct FT_ListRec_
+ {
+ FT_ListNode head;
+ FT_ListNode tail;
+
+ } FT_ListRec;
+
+
+ /* */
+
+#define FT_IS_EMPTY( list ) ( (list).head == 0 )
+
+ /* return base error code (without module-specific prefix) */
+#define FT_ERROR_BASE( x ) ( (x) & 0xFF )
+
+ /* return module error code */
+#define FT_ERROR_MODULE( x ) ( (x) & 0xFF00U )
+
+#define FT_BOOL( x ) ( (FT_Bool)( x ) )
+
+FT_END_HEADER
+
+#endif /* __FTTYPES_H__ */
+
+
+/* END */
diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h
index fa1b29f..5c13a58 100644
--- a/include/freetype/internal/ftobjs.h
+++ b/include/freetype/internal/ftobjs.h
@@ -78,6 +78,13 @@ FT_BEGIN_HEADER
#define ABS( a ) ( (a) < 0 ? -(a) : (a) )
#endif
+#define FT_PAD_FLOOR( x, n ) ( (x) & ~((n)-1) )
+#define FT_PAD_ROUND( x, n ) FT_PAD_FLOOR( (x)+((n)/2), n )
+#define FT_PAD_CEIL( x, n ) FT_PAD_FLOOR( (x)+((n)-1), n )
+
+#define FT_PIX_FLOOR( x ) ( (x) & ~63 )
+#define FT_PIX_ROUND( x ) FT_PIX_FLOOR( (x)+32 )
+#define FT_PIX_CEIL( x ) FT_PIX_FLOOR( (x)+63 )
/*************************************************************************/
/*************************************************************************/
diff --git a/src/autofit/afangles.c b/src/autofit/afangles.c
index eb0a042..83729e5 100644
--- a/src/autofit/afangles.c
+++ b/src/autofit/afangles.c
@@ -6,7 +6,7 @@
static const FT_Fixed
af_angle_arctan_table[9] =
{
- 90, 64, 38, 20, 10, 5, 3, 1, 1
+ 90, 64, 38, 20, 10, 5, 3, 1, 1
};
@@ -116,9 +116,9 @@
/* round theta */
if ( theta >= 0 )
- theta = ( theta + 2 ) & -4;
+ theta = FT_PAD_ROUND( theta, 4 );
else
- theta = - (( -theta + 2 ) & -4);
+ theta = - FT_PAD_ROUND( -theta, 4 );
vec->x = x;
vec->y = theta;
@@ -152,18 +152,18 @@
AF_Angle angle2 )
{
AF_Angle delta = angle2 - angle1;
-
+
delta %= AF_ANGLE_2PI;
if ( delta < 0 )
delta += AF_ANGLE_2PI;
-
+
if ( delta > AF_ANGLE_PI )
delta -= AF_ANGLE_2PI;
-
+
return delta;
- }
+ }
+
-
/* well, this needs to be somewhere, right :-)
*/
@@ -187,5 +187,5 @@
table[j - 1] = swap;
}
}
- }
+ }
\ No newline at end of file
diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c
index 70c563a..de727c0 100644
--- a/src/autofit/aflatin.c
+++ b/src/autofit/aflatin.c
@@ -1173,7 +1173,7 @@
}
}
- scaled = ( reference + 32 ) & -64;
+ scaled = FT_PIX_ROUND( reference );
if ( width >= reference )
{
@@ -1268,7 +1268,7 @@
dist += delta;
}
else
- dist = ( dist + 32 ) & -64;
+ dist = ( dist + 32 ) & ~63;
}
}
else
@@ -1282,7 +1282,7 @@
/* in the case of vertical hinting, always round */
/* the stem heights to integer pixels */
if ( dist >= 64 )
- dist = ( dist + 16 ) & -64;
+ dist = ( dist + 16 ) & ~63;
else
dist = 64;
}
@@ -1297,7 +1297,7 @@
if ( dist < 64 )
dist = 64;
else
- dist = ( dist + 32 ) & -64;
+ dist = ( dist + 32 ) & ~63;
}
else
{
@@ -1308,10 +1308,10 @@
dist = ( dist + 64 ) >> 1;
else if ( dist < 128 )
- dist = ( dist + 22 ) & -64;
+ dist = ( dist + 22 ) & ~63;
else
/* XXX: round otherwise to prevent color fringes in LCD mode */
- dist = ( dist + 32 ) & -64;
+ dist = ( dist + 32 ) & ~63;
}
}
}
@@ -1472,7 +1472,7 @@
{
org_center = edge->opos + ( org_len >> 1 );
- cur_pos1 = ( org_center + 32 ) & -64;
+ cur_pos1 = FT_PIX_ROUND( org_center );
error1 = org_center - ( cur_pos1 - u_off );
if ( error1 < 0 )
@@ -1492,7 +1492,7 @@
}
else
- edge->pos = ( edge->opos + 32 ) & -64;
+ edge->pos = FT_PIX_ROUND( edge->opos );
anchor = edge;
@@ -1518,7 +1518,7 @@
FT_Pos u_off, d_off;
- cur_pos1 = ( org_center + 32 ) & -64;
+ cur_pos1 = FT_PIX_ROUND( org_center );
if (cur_len <= 64 )
u_off = d_off = 32;
@@ -1553,12 +1553,12 @@
cur_len = af_compute_stem_width( hinter, dimension, org_len,
edge->flags, edge2->flags );
- cur_pos1 = ( org_pos + 32 ) & -64;
+ cur_pos1 = FT_PIX_ROUND( org_pos );
delta1 = ( cur_pos1 + ( cur_len >> 1 ) - org_center );
if ( delta1 < 0 )
delta1 = -delta1;
- cur_pos2 = ( ( org_pos + org_len + 32 ) & -64 ) - cur_len;
+ cur_pos2 = FT_PIX_ROUND( org_pos + org_len ) - cur_len;
delta2 = ( cur_pos2 + ( cur_len >> 1 ) - org_center );
if ( delta2 < 0 )
delta2 = -delta2;
@@ -1651,12 +1651,12 @@
af_align_serif_edge( hinter, edge->serif, edge, dimension );
else if ( !anchor )
{
- edge->pos = ( edge->opos + 32 ) & -64;
+ edge->pos = FT_PIX_ROUND( edge->opos );
anchor = edge;
}
else
edge->pos = anchor->pos +
- ( ( edge->opos-anchor->opos + 32 ) & -64 );
+ FT_PIX_ROUND( edge->opos - anchor->opos );
edge->flags |= AF_EDGE_DONE;
diff --git a/src/autohint/ahglyph.c b/src/autohint/ahglyph.c
index 85c3b38..ad2f46e 100644
--- a/src/autohint/ahglyph.c
+++ b/src/autohint/ahglyph.c
@@ -418,7 +418,7 @@
/* first of all, reallocate the contours array if necessary */
if ( num_contours > outline->max_contours )
{
- FT_Int new_contours = ( num_contours + 3 ) & -4;
+ FT_Int new_contours = FT_PAD_CEIL( num_contours, 4 );
if ( FT_RENEW_ARRAY( outline->contours,
@@ -435,7 +435,7 @@
/* */
if ( num_points + 2 > outline->max_points )
{
- FT_Int news = ( num_points + 2 + 7 ) & -8;
+ FT_Int news = FT_PAD_CEIL( num_points, 8 );
FT_Int max = outline->max_points;
diff --git a/src/autohint/ahhint.c b/src/autohint/ahhint.c
index aad5725..93bd3b6 100644
--- a/src/autohint/ahhint.c
+++ b/src/autohint/ahhint.c
@@ -71,7 +71,7 @@
}
}
- scaled = ( reference + 32 ) & -64;
+ scaled = FT_PIX_ROUND( reference );
if ( width >= reference )
{
@@ -167,7 +167,7 @@
dist += delta;
}
else
- dist = ( dist + 32 ) & -64;
+ dist = ( dist + 32 ) & ~63;
}
}
else
@@ -181,7 +181,7 @@
/* in the case of vertical hinting, always round */
/* the stem heights to integer pixels */
if ( dist >= 64 )
- dist = ( dist + 16 ) & -64;
+ dist = ( dist + 16 ) & ~63;
else
dist = 64;
}
@@ -196,7 +196,7 @@
if ( dist < 64 )
dist = 64;
else
- dist = ( dist + 32 ) & -64;
+ dist = ( dist + 32 ) & ~63;
}
else
{
@@ -207,10 +207,10 @@
dist = ( dist + 64 ) >> 1;
else if ( dist < 128 )
- dist = ( dist + 22 ) & -64;
+ dist = ( dist + 22 ) & ~63;
else
/* XXX: round otherwise to prevent color fringes in LCD mode */
- dist = ( dist + 32 ) & -64;
+ dist = ( dist + 32 ) & ~63;
}
}
}
@@ -284,7 +284,7 @@
dist += delta;
}
else
- dist = ( dist + 32 ) & -64;
+ dist = ( dist + 32 ) & ~63;
}
}
else
@@ -298,7 +298,7 @@
/* in the case of vertical hinting, always round */
/* the stem heights to integer pixels */
if ( dist >= 64 )
- dist = ( dist + 16 ) & -64;
+ dist = ( dist + 16 ) & ~63;
else
dist = 64;
}
@@ -313,7 +313,7 @@
if ( dist < 64 )
dist = 64;
else
- dist = ( dist + 32 ) & -64;
+ dist = ( dist + 32 ) & ~63;
}
else
{
@@ -324,10 +324,10 @@
dist = ( dist + 64 ) >> 1;
else if ( dist < 128 )
- dist = ( dist + 22 ) & -64;
+ dist = ( dist + 22 ) & ~63;
else
/* XXX: round otherwise to prevent color fringes in LCD mode */
- dist = ( dist + 32 ) & -64;
+ dist = ( dist + 32 ) & ~63;
}
}
}
@@ -396,7 +396,7 @@
if ( base->flags & AH_EDGE_DONE )
{
if ( dist >= 64 )
- dist = ( dist + 8 ) & -64;
+ dist = ( dist + 8 ) & ~63;
else if ( dist <= 32 && !vertical )
dist = ( dist + 33 ) >> 1;
@@ -545,7 +545,7 @@
{
org_center = edge->opos + ( org_len >> 1 );
- cur_pos1 = ( org_center + 32 ) & -64;
+ cur_pos1 = FT_PIX_ROUND( org_center );
error1 = org_center - ( cur_pos1 - u_off );
if ( error1 < 0 )
@@ -565,7 +565,7 @@
}
else
- edge->pos = ( edge->opos + 32 ) & -64;
+ edge->pos = FT_PIX_ROUND( edge->opos );
anchor = edge;
@@ -575,7 +575,7 @@
#else /* !FT_CONFIG_CHESTER_STEM */
- edge->pos = ( edge->opos + 32 ) & -64;
+ edge->pos = FT_PIX_ROUND( edge->opos );
anchor = edge;
edge->flags |= AH_EDGE_DONE;
@@ -614,7 +614,7 @@
FT_Pos u_off, d_off;
- cur_pos1 = ( org_center + 32 ) & -64;
+ cur_pos1 = FT_PIX_ROUND( org_center );
if (cur_len <= 64 )
u_off = d_off = 32;
@@ -649,12 +649,12 @@
cur_len = ah_compute_stem_width( hinter, dimension, org_len,
edge->flags, edge2->flags );
- cur_pos1 = ( org_pos + 32 ) & -64;
+ cur_pos1 = FT_PIX_ROUND( org_pos );
delta1 = ( cur_pos1 + ( cur_len >> 1 ) - org_center );
if ( delta1 < 0 )
delta1 = -delta1;
- cur_pos2 = ( ( org_pos + org_len + 32 ) & -64 ) - cur_len;
+ cur_pos2 = FT_PIX_ROUND( org_pos + org_len ) - cur_len;
delta2 = ( cur_pos2 + ( cur_len >> 1 ) - org_center );
if ( delta2 < 0 )
delta2 = -delta2;
@@ -665,12 +665,12 @@
#else /* !FT_CONFIG_CHESTER_STEM */
- cur_pos1 = ( org_pos + 32 ) & -64;
+ cur_pos1 = FT_PIX_ROUND( org_pos );
delta1 = ( cur_pos1 + ( cur_len >> 1 ) - org_center );
if ( delta1 < 0 )
delta1 = -delta1;
- cur_pos2 = ( ( org_pos + org_len + 32 ) & -64 ) - cur_len;
+ cur_pos2 = FT_PIX_ROUND( org_pos + org_len ) - cur_len;
delta2 = ( cur_pos2 + ( cur_len >> 1 ) - org_center );
if ( delta2 < 0 )
delta2 = -delta2;
@@ -764,12 +764,12 @@
ah_align_serif_edge( hinter, edge->serif, edge, dimension );
else if ( !anchor )
{
- edge->pos = ( edge->opos + 32 ) & -64;
+ edge->pos = FT_PIX_ROUND( edge->opos );
anchor = edge;
}
else
edge->pos = anchor->pos +
- ( ( edge->opos-anchor->opos + 32 ) & -64 );
+ FT_PIX_ROUND( edge->opos - anchor->opos );
edge->flags |= AH_EDGE_DONE;
@@ -1299,15 +1299,16 @@
if ( delta2 < 32 )
delta2 = 0;
else if ( delta2 < 64 )
- delta2 = 32 + ( ( ( delta2 - 32 ) + 16 ) & -32 );
+ delta2 = 32 + ( ( ( delta2 - 32 ) + 16 ) & ~31 );
else
- delta2 = ( delta2 + 32 ) & -64;
+ delta2 = FT_PIX_ROUND( delta2 );
if ( delta < 0 )
delta2 = -delta2;
scaled->blue_refs[n] =
- ( FT_MulFix( design->blue_refs[n], y_scale ) + 32 ) & -64;
+ FT_PIX_ROUND( FT_MulFix( design->blue_refs[n], y_scale ) );
+
scaled->blue_shoots[n] = scaled->blue_refs[n] + delta2;
}
@@ -1551,8 +1552,8 @@
old_lsb = edge1->opos;
new_lsb = edge1->pos;
- hinter->pp1.x = ( ( new_lsb - old_lsb ) + 32 ) & -64;
- hinter->pp2.x = ( ( edge2->pos + old_rsb ) + 32 ) & -64;
+ hinter->pp1.x = FT_PIX_ROUND( new_lsb - old_lsb );
+ hinter->pp2.x = FT_PIX_ROUND( edge2->pos + old_rsb );
#if 0
/* try to fix certain bad advance computations */
@@ -1677,8 +1678,8 @@
x = FT_MulFix( subglyph->arg1, x_scale );
y = FT_MulFix( subglyph->arg2, y_scale );
- x = ( x + 32 ) & -64;
- y = ( y + 32 ) & -64;
+ x = FT_PIX_ROUND(x);
+ y = FT_PIX_ROUND(y);
}
{
@@ -1715,10 +1716,10 @@
FT_Outline_Translate( &gloader->base.outline, -hinter->pp1.x, 0 );
FT_Outline_Get_CBox( &gloader->base.outline, &bbox );
- bbox.xMin &= -64;
- bbox.yMin &= -64;
- bbox.xMax = ( bbox.xMax + 63 ) & -64;
- bbox.yMax = ( bbox.yMax + 63 ) & -64;
+ bbox.xMin = FT_PIX_FLOOR( bbox.xMin );
+ bbox.yMin = FT_PIX_FLOOR( bbox.yMin );
+ bbox.xMax = FT_PIX_CEIL( bbox.xMax );
+ bbox.yMax = FT_PIX_CEIL( bbox.yMax );
slot->metrics.width = bbox.xMax - bbox.xMin;
slot->metrics.height = bbox.yMax - bbox.yMin;
@@ -1733,7 +1734,7 @@
slot->metrics.horiAdvance = FT_MulFix( slot->metrics.horiAdvance,
x_scale );
- slot->metrics.horiAdvance = ( slot->metrics.horiAdvance + 32 ) & -64;
+ slot->metrics.horiAdvance = FT_PIX_ROUND( slot->metrics.horiAdvance );
/* now copy outline into glyph slot */
ah_loader_rewind( slot->internal->loader );
@@ -1802,7 +1803,7 @@
if ( shoot > 0 )
{
FT_Pos scaled = FT_MulFix( shoot, y_scale );
- FT_Pos fitted = ( scaled + 32 ) & -64;
+ FT_Pos fitted = FT_PIX_ROUND( scaled );
if ( scaled != fitted )
diff --git a/src/base/ftcalc.c b/src/base/ftcalc.c
index f801cc4..4fb2366 100644
--- a/src/base/ftcalc.c
+++ b/src/base/ftcalc.c
@@ -74,8 +74,8 @@
FT_EXPORT_DEF( FT_Fixed )
FT_RoundFix( FT_Fixed a )
{
- return ( a >= 0 ) ? ( a + 0x8000L ) & -0x10000L
- : -((-a + 0x8000L ) & -0x10000L );
+ return ( a >= 0 ) ? ( a + 0x8000L ) & ~0xFFFFL
+ : -((-a + 0x8000L ) & ~0xFFFFL );
}
@@ -84,8 +84,8 @@
FT_EXPORT_DEF( FT_Fixed )
FT_CeilFix( FT_Fixed a )
{
- return ( a >= 0 ) ? ( a + 0xFFFFL ) & -0x10000L
- : -((-a + 0xFFFFL ) & -0x10000L );
+ return ( a >= 0 ) ? ( a + 0xFFFFL ) & ~0xFFFFL
+ : -((-a + 0xFFFFL ) & ~0xFFFFL );
}
@@ -94,8 +94,8 @@
FT_EXPORT_DEF( FT_Fixed )
FT_FloorFix( FT_Fixed a )
{
- return ( a >= 0 ) ? a & -0x10000L
- : -((-a) & -0x10000L );
+ return ( a >= 0 ) ? a & ~0xFFFFL
+ : -((-a) & ~0xFFFFL );
}
diff --git a/src/base/ftgloadr.c b/src/base/ftgloadr.c
index 5a2eb51..8c722ab 100644
--- a/src/base/ftgloadr.c
+++ b/src/base/ftgloadr.c
@@ -205,7 +205,7 @@
if ( new_max > old_max )
{
- new_max = ( new_max + 7 ) & -8;
+ new_max = FT_PAD_CEIL( new_max, 8 );
if ( FT_RENEW_ARRAY( base->points, old_max, new_max ) ||
FT_RENEW_ARRAY( base->tags, old_max, new_max ) )
@@ -225,7 +225,7 @@
n_contours;
if ( new_max > old_max )
{
- new_max = ( new_max + 3 ) & -4;
+ new_max = FT_PAD_CEIL( new_max, 4 );
if ( FT_RENEW_ARRAY( base->contours, old_max, new_max ) )
goto Exit;
@@ -261,7 +261,7 @@
old_max = loader->max_subglyphs;
if ( new_max > old_max )
{
- new_max = ( new_max + 1 ) & -2;
+ new_max = FT_PAD_CEIL( new_max, 2 );
if ( FT_RENEW_ARRAY( base->subglyphs, old_max, new_max ) )
goto Exit;
diff --git a/src/base/ftglyph.c b/src/base/ftglyph.c
index 9c62690..dd65915 100644
--- a/src/base/ftglyph.c
+++ b/src/base/ftglyph.c
@@ -546,10 +546,10 @@
if ( bbox_mode == FT_GLYPH_BBOX_GRIDFIT ||
bbox_mode == FT_GLYPH_BBOX_PIXELS )
{
- acbox->xMin &= -64;
- acbox->yMin &= -64;
- acbox->xMax = ( acbox->xMax + 63 ) & -64;
- acbox->yMax = ( acbox->yMax + 63 ) & -64;
+ acbox->xMin = FT_PIX_FLOOR( acbox->xMin );
+ acbox->yMin = FT_PIX_FLOOR( acbox->yMin );
+ acbox->xMax = FT_PIX_CEIL( acbox->xMax );
+ acbox->yMax = FT_PIX_CEIL( acbox->yMax );
}
/* convert to integer pixels if needed */
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index b84a371..7e040fe 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -1977,17 +1977,17 @@
{
/* Compute root ascender, descender, test height, and max_advance */
- metrics->ascender = ( FT_MulFix( face->ascender,
- metrics->y_scale ) + 63 ) & -64;
+ metrics->ascender = FT_PIX_CEIL( FT_MulFix( face->ascender,
+ metrics->y_scale ) );
- metrics->descender = ( FT_MulFix( face->descender,
- metrics->y_scale ) + 0 ) & -64;
+ metrics->descender = FT_PIX_FLOOR( FT_MulFix( face->descender,
+ metrics->y_scale ) );
- metrics->height = ( FT_MulFix( face->height,
- metrics->y_scale ) + 32 ) & -64;
+ metrics->height = FT_PIX_ROUND( FT_MulFix( face->height,
+ metrics->y_scale ) );
- metrics->max_advance = ( FT_MulFix( face->max_advance_width,
- metrics->x_scale ) + 32 ) & -64;
+ metrics->max_advance = FT_PIX_ROUND( FT_MulFix( face->max_advance_width,
+ metrics->x_scale ) );
}
@@ -2153,8 +2153,8 @@
if ( kern_mode != FT_KERNING_UNFITTED )
{
- akerning->x = ( akerning->x + 32 ) & -64;
- akerning->y = ( akerning->y + 32 ) & -64;
+ akerning->x = FT_PIX_ROUND( akerning->x );
+ akerning->y = FT_PIX_ROUND( akerning->y );
}
}
}
@@ -2516,7 +2516,7 @@
FT_Face face;
TT_CMapInfo cmap_info;
-
+
if ( !charmap || !charmap->face )
return 0;
diff --git a/src/base/ftsynth.c b/src/base/ftsynth.c
index 72979fa..428fda4 100644
--- a/src/base/ftsynth.c
+++ b/src/base/ftsynth.c
@@ -279,7 +279,7 @@
first = last + 1;
}
- slot->metrics.horiAdvance = ( slot->metrics.horiAdvance + distance*4 ) & -64;
+ slot->metrics.horiAdvance = ( slot->metrics.horiAdvance + distance*4 ) & ~63;
}
diff --git a/src/base/fttrigon.c b/src/base/fttrigon.c
index 82cd3b2..da17db1 100644
--- a/src/base/fttrigon.c
+++ b/src/base/fttrigon.c
@@ -271,9 +271,9 @@
/* round theta */
if ( theta >= 0 )
- theta = ( theta + 16 ) & -32;
+ theta = FT_PAD_ROUND( theta, 32 );
else
- theta = - (( -theta + 16 ) & -32);
+ theta = - FT_PAD_ROUND( -theta, 32 );
vec->x = x;
vec->y = theta;
diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c
index 4b214c4..a1c6d0a 100644
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -366,7 +366,7 @@
decoder->num_globals = cff->num_global_subrs;
decoder->globals = cff->global_subrs;
decoder->globals_bias = cff_compute_bias( decoder->num_globals );
-
+
decoder->hint_mode = hint_mode;
}
@@ -2488,11 +2488,11 @@
if ( hinting )
{
- metrics->horiAdvance = ( metrics->horiAdvance + 32 ) & -64;
- metrics->vertAdvance = ( metrics->vertAdvance + 32 ) & -64;
+ metrics->horiAdvance = FT_PIX_ROUND( metrics->horiAdvance );
+ metrics->vertAdvance = FT_PIX_ROUND( metrics->vertAdvance );
- metrics->vertBearingX = ( metrics->vertBearingX + 32 ) & -64;
- metrics->vertBearingY = ( metrics->vertBearingY + 32 ) & -64;
+ metrics->vertBearingX = FT_PIX_ROUND( metrics->vertBearingX );
+ metrics->vertBearingY = FT_PIX_ROUND( metrics->vertBearingY );
}
}
diff --git a/src/cid/cidgload.c b/src/cid/cidgload.c
index e07fb71..f038ae5 100644
--- a/src/cid/cidgload.c
+++ b/src/cid/cidgload.c
@@ -412,11 +412,11 @@
if ( hinting )
{
- metrics->horiAdvance = ( metrics->horiAdvance + 32 ) & -64;
- metrics->vertAdvance = ( metrics->vertAdvance + 32 ) & -64;
+ metrics->horiAdvance = FT_PIX_ROUND( metrics->horiAdvance );
+ metrics->vertAdvance = FT_PIX_ROUND( metrics->vertAdvance );
- metrics->vertBearingX = ( metrics->vertBearingX + 32 ) & -64;
- metrics->vertBearingY = ( metrics->vertBearingY + 32 ) & -64;
+ metrics->vertBearingX = FT_PIX_ROUND( metrics->vertBearingX );
+ metrics->vertBearingY = FT_PIX_ROUND( metrics->vertBearingY );
}
}
@@ -426,10 +426,10 @@
/* grid fit the bounding box if necessary */
if ( hinting )
{
- cbox.xMin &= -64;
- cbox.yMin &= -64;
- cbox.xMax = ( cbox.xMax + 63 ) & -64;
- cbox.yMax = ( cbox.yMax + 63 ) & -64;
+ cbox.xMin = FT_PIX_FLOOR( cbox.xMin );
+ cbox.yMin = FT_PIX_FLOOR( cbox.yMin );
+ cbox.xMax = FT_PIX_CEIL( cbox.xMax );
+ cbox.yMax = FT_PIX_CEIL( cbox.yMax );
}
metrics->width = cbox.xMax - cbox.xMin;
diff --git a/src/cid/cidload.c b/src/cid/cidload.c
index db302b2..9d20559 100644
--- a/src/cid/cidload.c
+++ b/src/cid/cidload.c
@@ -388,7 +388,7 @@
/* reallocate offsets array if needed */
if ( num_subrs + 1 > max_offsets )
{
- FT_UInt new_max = ( num_subrs + 1 + 3 ) & -4;
+ FT_UInt new_max = FT_PAD_CEIL( num_subrs + 1, 4 );
if ( FT_RENEW_ARRAY( offsets, max_offsets, new_max ) )
diff --git a/src/pfr/pfrgload.c b/src/pfr/pfrgload.c
index fdaf253..87ba684 100644
--- a/src/pfr/pfrgload.c
+++ b/src/pfr/pfrgload.c
@@ -276,7 +276,7 @@
/* re-allocate array when necessary */
if ( count > glyph->max_xy_control )
{
- FT_UInt new_max = ( count + 7 ) & -8;
+ FT_UInt new_max = FT_PAD_CEIL( count, 8 );
if ( FT_RENEW_ARRAY( glyph->x_control,
diff --git a/src/pfr/pfrload.c b/src/pfr/pfrload.c
index f3cdb04..19ced45 100644
--- a/src/pfr/pfrload.c
+++ b/src/pfr/pfrload.c
@@ -365,7 +365,7 @@
/* re-allocate when needed */
if ( phy_font->num_strikes + count > phy_font->max_strikes )
{
- FT_UInt new_max = ( phy_font->num_strikes + count + 3 ) & -4;
+ FT_UInt new_max = FT_PAD_CEIL( phy_font->num_strikes + count, 4 );
if ( FT_RENEW_ARRAY( phy_font->strikes,
diff --git a/src/pfr/pfrsbit.c b/src/pfr/pfrsbit.c
index dfc7eb2..da8fdba 100644
--- a/src/pfr/pfrsbit.c
+++ b/src/pfr/pfrsbit.c
@@ -635,7 +635,7 @@
glyph->root.metrics.height = (FT_Long)ysize << 6;
glyph->root.metrics.horiBearingX = xpos << 6;
glyph->root.metrics.horiBearingY = ypos << 6;
- glyph->root.metrics.horiAdvance = ( ( advance >> 2 ) + 32 ) & -64;
+ glyph->root.metrics.horiAdvance = FT_PIX_ROUND( ( advance >> 2 ) );
glyph->root.metrics.vertBearingX = - glyph->root.metrics.width >> 1;
glyph->root.metrics.vertBearingY = 0;
glyph->root.metrics.vertAdvance = size->root.metrics.height;
diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c
index b244675..5ce8721 100644
--- a/src/psaux/psobjs.c
+++ b/src/psaux/psobjs.c
@@ -181,7 +181,7 @@
/* increase size by 25% and round up to the nearest multiple
of 1024 */
new_size += ( new_size >> 2 ) + 1;
- new_size = ( new_size + 1023 ) & -1024;
+ new_size = FT_PAD_CEIL( new_size, 1024 );
}
error = reallocate_t1_table( table, new_size );
diff --git a/src/pshinter/pshalgo.c b/src/pshinter/pshalgo.c
index 3e76529..4b7a7dc 100644
--- a/src/pshinter/pshalgo.c
+++ b/src/pshinter/pshalgo.c
@@ -375,11 +375,11 @@
len += delta;
}
else
- len = ( len + 32 ) & -64;
+ len = FT_PIX_ROUND( len );
}
if ( do_snapping )
- len = ( len + 32 ) & -64;
+ len = FT_PIX_ROUND( len );
return len;
}
@@ -417,8 +417,8 @@
psh_hint_snap_stem_side_delta( FT_Fixed pos,
FT_Fixed len )
{
- FT_Fixed delta1 = ( ( pos + 32 ) & -64 ) - pos;
- FT_Fixed delta2 = ( ( pos + len + 32 ) & -64 ) - pos - len;
+ FT_Fixed delta1 = FT_PIX_ROUND( pos ) - pos;
+ FT_Fixed delta2 = FT_PIX_ROUND( pos + len ) - pos - len;
if ( ABS( delta1 ) <= ABS( delta2 ) )
@@ -534,10 +534,10 @@
* around the nearest pixel center
*/
#if 1
- pos = ( pos + ( len >> 1 ) ) & -64;
+ pos = FT_PIX_FLOOR( pos + ( len >> 1 ) );
#else
/* this seems to be a bug! */
- pos = ( pos + ( ( len >> 1 ) & -64 ) );
+ pos = pos + FT_PIX_FLOOR( len >> 1 );
#endif
len = 64;
}
@@ -562,7 +562,7 @@
if ( len < 64 )
len = 64;
else
- len = ( len + 32 ) & -64;
+ len = FT_PIX_ROUND( len );
switch ( align.align )
{
@@ -583,9 +583,9 @@
default:
hint->cur_len = len;
if ( len & 64 )
- pos = ( ( pos + ( len >> 1 ) ) & -64 ) + 32;
+ pos = FT_PIX_FLOOR( pos + ( len >> 1 ) ) + 32;
else
- pos = ( pos + ( len >> 1 ) + 32 ) & -64;
+ pos = FT_PIX_ROUND( pos + ( len >> 1 ) );
hint->cur_pos = pos - ( len >> 1 );
hint->cur_len = len;
@@ -739,13 +739,13 @@
if ( ( len / 64 ) & 1 )
{
- delta_a = ( center & -64 ) + 32 - center;
- delta_b = ( ( center + 32 ) & - 64 ) - center;
+ delta_a = FT_PIX_FLOOR( center ) + 32 - center;
+ delta_b = FT_PIX_ROUND( center ) - center;
}
else
{
- delta_a = ( ( center + 32 ) & - 64 ) - center;
- delta_b = ( center & -64 ) + 32 - center;
+ delta_a = FT_PIX_ROUND( center ) - center;
+ delta_b = FT_PIX_FLOOR( center ) + 32 - center;
}
/* We choose between B) and C) above based on the amount
@@ -762,7 +762,6 @@
FT_Fixed side_delta = psh_hint_snap_stem_side_delta ( pos,
len );
-
if ( ABS( side_delta ) < ABS( delta_b ) )
pos += side_delta;
else
@@ -1940,7 +1939,7 @@
scaled = FT_MulFix( globals->blues.normal_top.zones->org_ref, y_scale );
- fitted = ( scaled + 32 ) & -64;
+ fitted = FT_PIX_ROUND( scaled );
if (scaled != fitted ) {
y_scale = FT_MulDiv( y_scale, fitted, scaled );
diff --git a/src/pshinter/pshglob.c b/src/pshinter/pshglob.c
index 3ae5728..3971c59 100644
--- a/src/pshinter/pshglob.c
+++ b/src/pshinter/pshglob.c
@@ -448,7 +448,7 @@
zone->cur_delta = FT_MulFix( zone->org_delta, scale );
/* round scaled reference position */
- zone->cur_ref = ( zone->cur_ref + 32 ) & -64;
+ zone->cur_ref = FT_PIX_ROUND( zone->cur_ref );
#if 0
if ( zone->cur_ref > zone->cur_top )
@@ -654,7 +654,7 @@
write->org = priv->standard_height[0];
- write++;
+ write++;
read = priv->snap_heights;
for ( count = priv->num_snap_heights; count > 0; count-- )
{
diff --git a/src/pshinter/pshrec.c b/src/pshinter/pshrec.c
index b0fee3d..13e0795 100644
--- a/src/pshinter/pshrec.c
+++ b/src/pshinter/pshrec.c
@@ -68,7 +68,7 @@
if ( new_max > old_max )
{
/* try to grow the table */
- new_max = ( new_max + 7 ) & -8;
+ new_max = FT_PAD_CEIL( new_max, 8 );
if ( !FT_RENEW_ARRAY( table->hints, old_max, new_max ) )
table->max_hints = new_max;
}
@@ -142,7 +142,7 @@
if ( new_max > old_max )
{
- new_max = ( new_max + 7 ) & -8;
+ new_max = FT_PAD_CEIL( new_max, 8 );
if ( !FT_RENEW_ARRAY( mask->bytes, old_max, new_max ) )
mask->max_bits = new_max * 8;
}
@@ -239,7 +239,7 @@
if ( new_max > old_max )
{
- new_max = ( new_max + 7 ) & -8;
+ new_max = FT_PAD_CEIL( new_max, 8 );
if ( !FT_RENEW_ARRAY( table->masks, old_max, new_max ) )
table->max_masks = new_max;
}
@@ -1012,7 +1012,7 @@
FT_ERROR(( "ps_hints_t2mask: "
"called with invalid bitcount %d (instead of %d)\n",
bit_count, count1 + count2 ));
-
+
/* simply ignore the operator */
return;
}
@@ -1057,7 +1057,7 @@
FT_ERROR(( "ps_hints_t2counter: "
"called with invalid bitcount %d (instead of %d)\n",
bit_count, count1 + count2 ));
-
+
/* simply ignore the operator */
return;
}
diff --git a/src/raster/ftrend1.c b/src/raster/ftrend1.c
index b6c0f02..a17ef9b 100644
--- a/src/raster/ftrend1.c
+++ b/src/raster/ftrend1.c
@@ -140,10 +140,10 @@
/* compute the control box, and grid fit it */
FT_Outline_Get_CBox( outline, &cbox );
- cbox.xMin &= -64;
- cbox.yMin &= -64;
- cbox.xMax = ( cbox.xMax + 63 ) & -64;
- cbox.yMax = ( cbox.yMax + 63 ) & -64;
+ cbox.xMin = FT_PIX_FLOOR( cbox.xMin );
+ cbox.yMin = FT_PIX_FLOOR( cbox.yMin );
+ cbox.xMax = FT_PIX_CEIL( cbox.xMax );
+ cbox.yMax = FT_PIX_CEIL( cbox.yMax );
width = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 );
height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 );
@@ -161,7 +161,7 @@
if ( !( mode & FT_RENDER_MODE_MONO ) )
{
/* we pad to 32 bits, only for backwards compatibility with FT 1.x */
- pitch = ( width + 3 ) & -4;
+ pitch = FT_PAD_CEIL( width, 4 );
bitmap->pixel_mode = FT_PIXEL_MODE_GRAY;
bitmap->num_grays = 256;
}
@@ -193,9 +193,9 @@
/* render outline into the bitmap */
error = render->raster_render( render->raster, ¶ms );
-
+
FT_Outline_Translate( outline, cbox.xMin, cbox.yMin );
-
+
if ( error )
goto Exit;
diff --git a/src/sfnt/ttcmap0.c b/src/sfnt/ttcmap0.c
index 35f6532..b323016 100644
--- a/src/sfnt/ttcmap0.c
+++ b/src/sfnt/ttcmap0.c
@@ -393,7 +393,7 @@
{
/* a 16-bit character code */
p += char_hi * 2; /* jump to key entry */
- sub = subs + ( TT_PEEK_USHORT( p ) & -8 ); /* jump to sub-header */
+ sub = subs + ( FT_PAD_FLOOR( TT_PEEK_USHORT( p ), 8 ) ); /* jump to sub-header */
/* check that the hi byte isn't a valid one-byte value */
if ( sub == subs )
@@ -481,7 +481,7 @@
pos = (FT_UInt)( char_lo - start );
p += offset + pos * 2;
- charcode = ( charcode & -256 ) + char_lo;
+ charcode = FT_PAD_FLOOR( charcode, 256 ) + char_lo;
for ( ; pos < count; pos++, charcode++ )
{
@@ -501,7 +501,7 @@
/* jump to next sub-header, i.e. higher byte value */
Next_SubHeader:
- charcode = ( charcode & -256 ) + 256;
+ charcode = FT_PAD_FLOOR( charcode, 256 ) + 256;
}
Exit:
@@ -795,7 +795,7 @@
p = table + 6;
- num_segs2 = TT_PEEK_USHORT( p ) & -2; /* be paranoid! */
+ num_segs2 = FT_PAD_FLOOR( TT_PEEK_USHORT( p ), 2 ); /* be paranoid! */
#if 1
/* Some fonts have more than 170 segments in their charmaps! */
@@ -918,7 +918,7 @@
code = (FT_UInt)char_code + 1;
p = table + 6;
- num_segs2 = TT_PEEK_USHORT(p) & -2; /* ensure even-ness */
+ num_segs2 = FT_PAD_FLOOR( TT_PEEK_USHORT(p), 2 ); /* ensure even-ness */
#if 1
diff --git a/src/smooth/ftsmooth.c b/src/smooth/ftsmooth.c
index cc84acd..40d5f50 100644
--- a/src/smooth/ftsmooth.c
+++ b/src/smooth/ftsmooth.c
@@ -132,10 +132,10 @@
/* compute the control box, and grid fit it */
FT_Outline_Get_CBox( outline, &cbox );
- cbox.xMin &= -64;
- cbox.yMin &= -64;
- cbox.xMax = ( cbox.xMax + 63 ) & -64;
- cbox.yMax = ( cbox.yMax + 63 ) & -64;
+ cbox.xMin = FT_PIX_FLOOR( cbox.xMin );
+ cbox.yMin = FT_PIX_FLOOR( cbox.yMin );
+ cbox.xMax = FT_PIX_CEIL( cbox.xMax );
+ cbox.yMax = FT_PIX_CEIL( cbox.yMax );
width = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 );
height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 );
@@ -154,7 +154,7 @@
if ( hmul )
{
width = width * hmul;
- pitch = ( width + 3 ) & -4;
+ pitch = FT_PAD_CEIL( width, 4 );
}
if ( vmul )
diff --git a/src/truetype/ttdriver.c b/src/truetype/ttdriver.c
index 1a8f2a2..e23fc35 100644
--- a/src/truetype/ttdriver.c
+++ b/src/truetype/ttdriver.c
@@ -208,8 +208,8 @@
/* we need to use rounding in the following computations. Otherwise,
* the resulting hinted outlines will be very slightly distorted
*/
- dim_x = ( ( char_width * horz_resolution + (36+32*72) ) / 72 ) & -64;
- dim_y = ( ( char_height * vert_resolution + (36+32*72) ) / 72 ) & -64;
+ dim_x = ( ( char_width * horz_resolution + (36+32*72) ) / 72 ) & ~63;
+ dim_y = ( ( char_height * vert_resolution + (36+32*72) ) / 72 ) & ~63;
}
else
{
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index a8b82ee..78eb41a 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -690,12 +690,12 @@
FT_Pos x = zone->org[n_points-2].x;
- x = ( ( x + 32 ) & -64 ) - x;
+ x = FT_PIX_ROUND( x ) - x;
translate_array( n_points, zone->org, x, 0 );
org_to_cur( n_points, zone );
- zone->cur[n_points - 1].x = ( zone->cur[n_points - 1].x + 32 ) & -64;
+ zone->cur[n_points - 1].x = FT_PIX_ROUND( zone->cur[n_points - 1].x );
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
@@ -1202,8 +1202,8 @@
if ( subglyph->flags & ROUND_XY_TO_GRID )
{
- x = ( x + 32 ) & -64;
- y = ( y + 32 ) & -64;
+ x = FT_PIX_ROUND( x );
+ y = FT_PIX_ROUND( y );
}
}
}
@@ -1296,8 +1296,8 @@
/* if hinting, round the phantom points */
if ( IS_HINTED( loader->load_flags ) )
{
- pp1[0].x = ( ( loader->pp1.x + 32 ) & -64 );
- pp1[1].x = ( ( loader->pp2.x + 32 ) & -64 );
+ pp1[0].x = FT_PIX_ROUND( loader->pp1.x );
+ pp1[1].x = FT_PIX_ROUND( loader->pp2.x );
}
{
@@ -1390,10 +1390,10 @@
if ( IS_HINTED( loader->load_flags ) )
{
/* grid-fit the bounding box */
- bbox.xMin &= -64;
- bbox.yMin &= -64;
- bbox.xMax = ( bbox.xMax + 63 ) & -64;
- bbox.yMax = ( bbox.yMax + 63 ) & -64;
+ bbox.xMin = FT_PIX_FLOOR( bbox.xMin );
+ bbox.yMin = FT_PIX_FLOOR( bbox.yMin );
+ bbox.xMax = FT_PIX_CEIL( bbox.xMax );
+ bbox.yMax = FT_PIX_CEIL( bbox.yMax );
}
}
else
@@ -1425,7 +1425,7 @@
/* don't forget to hint the advance when we need to */
if ( IS_HINTED( loader->load_flags ) )
- glyph->metrics.horiAdvance = ( glyph->metrics.horiAdvance + 32 ) & -64;
+ glyph->metrics.horiAdvance = FT_PIX_ROUND( glyph->metrics.horiAdvance );
/* Now take care of vertical metrics. In the case where there is */
/* no vertical information within the font (relatively common), make */
@@ -1538,9 +1538,9 @@
/* grid-fit them if necessary */
if ( IS_HINTED( loader->load_flags ) )
{
- left &= -64;
- top = ( top + 63 ) & -64;
- advance = ( advance + 32 ) & -64;
+ left = FT_PIX_FLOOR( left );
+ top = FT_PIX_CEIL( top );
+ advance = FT_PIX_ROUND( advance );
}
glyph->metrics.vertBearingX = left;
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index e895bcc..7329973 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -1781,7 +1781,7 @@
}
else
{
- val = -( ( compensation - distance + 32 ) & -64 );
+ val = -FT_PIX_ROUND( compensation - distance );
if ( val > 0 )
val = 0;
}
@@ -1817,13 +1817,13 @@
if ( distance >= 0 )
{
- val = ( ( distance + compensation ) & -64 ) + 32;
+ val = FT_PIX_FLOOR( distance + compensation ) + 32;
if ( distance && val < 0 )
val = 0;
}
else
{
- val = -( ( (compensation - distance) & -64 ) + 32 );
+ val = -( FT_PIX_FLOOR( compensation - distance ) + 32 );
if ( val > 0 )
val = 0;
}
@@ -1911,7 +1911,7 @@
}
else
{
- val = -( ( compensation - distance + 63 ) & -64 );
+ val = - FT_PIX_CEIL( compensation - distance );
if ( val > 0 )
val = 0;
}
@@ -1955,7 +1955,7 @@
}
else
{
- val = -( ( compensation - distance + 16 ) & -32 );
+ val = -FT_PAD_ROUND( compensation - distance, 32 );
if ( val > 0 )
val = 0;
}
@@ -2994,11 +2994,11 @@
#define DO_FLOOR \
- args[0] &= -64;
+ args[0] = FT_PIX_FLOOR( args[0] );
#define DO_CEILING \
- args[0] = ( args[0] + 63 ) & -64;
+ args[0] = FT_PIX_CEIL( args[0] );
#define DO_RS \
@@ -5288,7 +5288,7 @@
{
*x = 0;
*y = d;
- }
+ }
}
else
#endif
diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c
index 30da6d3..cd5f6a7 100644
--- a/src/truetype/ttobjs.c
+++ b/src/truetype/ttobjs.c
@@ -12,7 +12,7 @@
/* 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. */
-/* */
+/* s */
/***************************************************************************/
@@ -590,14 +590,14 @@
}
/* Compute root ascender, descender, text height, and max_advance */
- metrics->ascender = ( FT_MulFix( face->root.ascender,
- metrics->y_scale ) + 32 ) & -64;
- metrics->descender = ( FT_MulFix( face->root.descender,
- metrics->y_scale ) + 32 ) & -64;
- metrics->height = ( FT_MulFix( face->root.height,
- metrics->y_scale ) + 32 ) & -64;
- metrics->max_advance = ( FT_MulFix( face->root.max_advance_width,
- metrics->x_scale ) + 32 ) & -64;
+ metrics->ascender = FT_PIX_ROUND( FT_MulFix( face->root.ascender,
+ metrics->y_scale ) );
+ metrics->descender = FT_PIX_ROUND( FT_MulFix( face->root.descender,
+ metrics->y_scale ) );
+ metrics->height = FT_PIX_ROUND( FT_MulFix( face->root.height,
+ metrics->y_scale ) );
+ metrics->max_advance = FT_PIX_ROUND( FT_MulFix( face->root.max_advance_width,
+ metrics->x_scale ) );
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
@@ -748,7 +748,8 @@
sbit_metrics->descender = strike->hori.descender << 6;
/* XXX: Is this correct? */
- sbit_metrics->height = sbit_metrics->ascender - sbit_metrics->descender;
+ sbit_metrics->height = sbit_metrics->ascender -
+ sbit_metrics->descender;
/* XXX: Is this correct? */
sbit_metrics->max_advance = ( strike->hori.min_origin_SB +
diff --git a/src/type1/t1gload.c b/src/type1/t1gload.c
index 2d8644f..c8d1db7 100644
--- a/src/type1/t1gload.c
+++ b/src/type1/t1gload.c
@@ -121,7 +121,7 @@
FT_UInt glyph_index )
{
FT_Data glyph_data;
- FT_Error error = T1_Parse_Glyph_And_Get_Char_String(
+ FT_Error error = T1_Parse_Glyph_And_Get_Char_String(
decoder, glyph_index, &glyph_data );
@@ -187,7 +187,7 @@
error = T1_Parse_Glyph( &decoder, glyph_index );
if ( glyph_index == 0 || decoder.builder.advance.x > *max_advance )
*max_advance = decoder.builder.advance.x;
-
+
/* ignore the error if one occurred - skip to next glyph */
}
@@ -374,11 +374,11 @@
if ( hinting )
{
- metrics->horiAdvance = ( metrics->horiAdvance + 32 ) & -64;
- metrics->vertAdvance = ( metrics->vertAdvance + 32 ) & -64;
+ metrics->horiAdvance = FT_PIX_ROUND( metrics->horiAdvance );
+ metrics->vertAdvance = FT_PIX_ROUND( metrics->vertAdvance );
- metrics->vertBearingX = ( metrics->vertBearingX + 32 ) & -64;
- metrics->vertBearingY = ( metrics->vertBearingY + 32 ) & -64;
+ metrics->vertBearingX = FT_PIX_ROUND( metrics->vertBearingX );
+ metrics->vertBearingY = FT_PIX_ROUND( metrics->vertBearingY );
}
}
@@ -388,10 +388,10 @@
/* grid fit the bounding box if necessary */
if ( hinting )
{
- cbox.xMin &= -64;
- cbox.yMin &= -64;
- cbox.xMax = ( cbox.xMax+63 ) & -64;
- cbox.yMax = ( cbox.yMax+63 ) & -64;
+ cbox.xMin = FT_PIX_FLOOR( cbox.xMin );
+ cbox.yMin = FT_PIX_FLOOR( cbox.yMin );
+ cbox.xMax = FT_PIX_CEIL( cbox.xMax );
+ cbox.yMax = FT_PIX_CEIL( cbox.yMax );
}
metrics->width = cbox.xMax - cbox.xMin;