yet another logical transformation of the internals to make them more consistent and understandable.. mainly, changing things like PS_Table => PS_TableRec + *PS_Table
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122
diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h
index fe53a23..c7221e0 100644
--- a/include/freetype/internal/ftobjs.h
+++ b/include/freetype/internal/ftobjs.h
@@ -137,18 +137,24 @@ FT_BEGIN_HEADER
} FT_ValidatorRec;
+ FT_BASE( void )
+ ft_validator_init( FT_Validator valid,
+ FT_Byte* base,
+ FT_Byte* limit,
+ FT_ValidationLevel level );
+
/* sets the error field in a validator, then calls 'longjmp' to return */
/* to high-level caller. Using 'setjmp/longjmp' avoids many stupid */
/* error checks within the validation routines.. */
/* */
FT_BASE( void )
- ft_validate_error( FT_Valid valid,
- FT_Error error );
+ ft_validator_error( FT_Validator valid,
+ FT_Error error );
/* calls ft_validate_error. Assumes that the 'valid' local variable holds */
/* a pointer to the current validator object.. */
/* */
-#define FT_INVALID(_error) ft_validate_error( valid, _error )
+#define FT_INVALID(_error) ft_validator_error( valid, _error )
/* called when a broken table is detected */
#define FT_INVALID_TOO_SHORT FT_INVALID( FT_Err_Invalid_Format )
@@ -206,9 +212,6 @@ FT_BEGIN_HEADER
typedef void (*FT_CMap_DoneFunc)( FT_CMap cmap );
- typedef FT_Error (*FT_CMap_ValidateFunc)( FT_Pointer cmap_data,
- FT_Validator valid );
-
typedef FT_UInt (*FT_CMap_CharIndexFunc)( FT_Pointer cmap_data,
FT_ULong char_code );
@@ -220,13 +223,24 @@ FT_BEGIN_HEADER
FT_UInt size;
FT_CMap_InitFunc init;
FT_CMap_DoneFunc done;
- FT_CMap_ValidateFunc validate;
FT_CMap_CharIndexFunc char_index;
FT_CMap_CharNextFunc char_next;
} FT_CMap_ClassRec;
+ /* create a new charmap and add it to charmap->face */
+ FT_BASE( FT_Error )
+ FT_CMap_New( FT_CMap_Class clazz,
+ FT_Pointer data,
+ FT_CharMap charmap,
+ FT_CMap *acmap );
+
+ /* destroy a charmap (don't remove it from face's list though) */
+ FT_BASE( void )
+ FT_CMap_Done( FT_CMap cmap );
+
+
/*************************************************************************/
/* */
/* <Struct> */
diff --git a/include/freetype/internal/psaux.h b/include/freetype/internal/psaux.h
index 57265b7..f3e7271 100644
--- a/include/freetype/internal/psaux.h
+++ b/include/freetype/internal/psaux.h
@@ -38,13 +38,14 @@ FT_BEGIN_HEADER
/*************************************************************************/
- typedef struct PS_Table_ PS_Table;
+ typedef struct PS_TableRec_* PS_Table;
+ typedef const struct PS_Table_FuncsRec_* PS_Table_Funcs;
/*************************************************************************/
/* */
/* <Struct> */
- /* PS_Table_Funcs */
+ /* PS_Table_FuncsRec */
/* */
/* <Description> */
/* A set of function pointers to manage PS_Table objects. */
@@ -58,32 +59,32 @@ FT_BEGIN_HEADER
/* */
/* table_release :: Releases table data, then finalizes it. */
/* */
- typedef struct PS_Table_Funcs_
+ typedef struct PS_Table_FuncsRec_
{
FT_Error
- (*init)( PS_Table* table,
+ (*init)( PS_Table table,
FT_Int count,
FT_Memory memory );
void
- (*done)( PS_Table* table );
+ (*done)( PS_Table table );
FT_Error
- (*add)( PS_Table* table,
+ (*add)( PS_Table table,
FT_Int index,
void* object,
FT_Int length );
void
- (*release)( PS_Table* table );
+ (*release)( PS_Table table );
- } PS_Table_Funcs;
+ } PS_Table_FuncsRec;
/*************************************************************************/
/* */
/* <Struct> */
- /* PS_Table */
+ /* PS_TableRec */
/* */
/* <Description> */
/* A PS_Table is a simple object used to store an array of objects in */
@@ -112,7 +113,7 @@ FT_BEGIN_HEADER
/* */
/* funcs :: A table of method pointers for this object. */
/* */
- struct PS_Table_
+ typedef struct PS_TableRec_
{
FT_Byte* block; /* current memory block */
FT_Offset cursor; /* current cursor in memory block */
@@ -124,10 +125,10 @@ FT_BEGIN_HEADER
FT_Byte** elements; /* addresses of table elements */
FT_Int* lengths; /* lengths of table elements */
- FT_Memory memory;
- PS_Table_Funcs funcs;
+ FT_Memory memory;
+ PS_Table_FuncsRec funcs;
- };
+ } PS_TableRec;
/*************************************************************************/
@@ -138,46 +139,51 @@ FT_BEGIN_HEADER
/*************************************************************************/
/*************************************************************************/
- typedef struct T1_Parser_ T1_Parser;
+ typedef struct PS_ParserRec_* PS_Parser;
+
+ typedef struct T1_TokenRec_* T1_Token;
+
+ typedef struct T1_FieldRec_* T1_Field;
+
/* simple enumeration type used to identify token types */
typedef enum T1_Token_Type_
{
- t1_token_none = 0,
- t1_token_any,
- t1_token_string,
- t1_token_array,
+ T1_TOKEN_TYPE_NONE = 0,
+ T1_TOKEN_TYPE_ANY,
+ T1_TOKEN_TYPE_STRING,
+ T1_TOKEN_TYPE_ARRAY,
/* do not remove */
- t1_token_max
+ T1_TOKEN_TYPE_MAX
} T1_Token_Type;
/* a simple structure used to identify tokens */
- typedef struct T1_Token_
+ typedef struct T1_TokenRec_
{
FT_Byte* start; /* first character of token in input stream */
FT_Byte* limit; /* first character after the token */
T1_Token_Type type; /* type of token */
- } T1_Token;
+ } T1_TokenRec;
/* enumeration type used to identify object fields */
typedef enum T1_Field_Type_
{
- t1_field_none = 0,
- t1_field_bool,
- t1_field_integer,
- t1_field_fixed,
- t1_field_string,
- t1_field_integer_array,
- t1_field_fixed_array,
- t1_field_callback,
+ T1_FIELD_TYPE_NONE = 0,
+ T1_FIELD_TYPE_BOOL,
+ T1_FIELD_TYPE_INTEGER,
+ T1_FIELD_TYPE_FIXED,
+ T1_FIELD_TYPE_STRING,
+ T1_FIELD_TYPE_INTEGER_ARRAY,
+ T1_FIELD_TYPE_FIXED_ARRAY,
+ T1_FIELD_TYPE_CALLBACK,
/* do not remove */
- t1_field_max
+ T1_FIELD_TYPE_MAX
} T1_Field_Type;
@@ -200,7 +206,7 @@ FT_BEGIN_HEADER
/* structure type used to model object fields */
- typedef struct T1_Field_
+ typedef struct T1_FieldRec_
{
const char* ident; /* field identifier */
T1_Field_Location location;
@@ -212,7 +218,7 @@ FT_BEGIN_HEADER
/* array */
FT_UInt count_offset; /* offset of element count for */
/* arrays */
- } T1_Field;
+ } T1_FieldRec;
#define T1_NEW_SIMPLE_FIELD( _ident, _type, _fname ) \
@@ -226,7 +232,7 @@ FT_BEGIN_HEADER
#define T1_NEW_CALLBACK_FIELD( _ident, _reader ) \
{ \
- _ident, T1CODE, t1_field_callback, \
+ _ident, T1CODE, T1_FIELD_TYPE_CALLBACK, \
(T1_Field_Parser)_reader, \
0, 0, \
0, 0 \
@@ -252,32 +258,32 @@ FT_BEGIN_HEADER
},
-#define T1_FIELD_BOOL( _ident, _fname ) \
- T1_NEW_SIMPLE_FIELD( _ident, t1_field_bool, _fname )
+#define T1_FIELD_TYPE_BOOL( _ident, _fname ) \
+ T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_BOOL, _fname )
#define T1_FIELD_NUM( _ident, _fname ) \
- T1_NEW_SIMPLE_FIELD( _ident, t1_field_integer, _fname )
+ T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_INTEGER, _fname )
#define T1_FIELD_FIXED( _ident, _fname ) \
- T1_NEW_SIMPLE_FIELD( _ident, t1_field_fixed, _fname )
+ T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED, _fname )
#define T1_FIELD_STRING( _ident, _fname ) \
- T1_NEW_SIMPLE_FIELD( _ident, t1_field_string, _fname )
+ T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_STRING, _fname )
#define T1_FIELD_NUM_TABLE( _ident, _fname, _fmax ) \
- T1_NEW_TABLE_FIELD( _ident, t1_field_integer_array, \
+ T1_NEW_TABLE_FIELD( _ident, T1_FIELD_TYPE_INTEGER_ARRAY, \
_fname, _fmax )
#define T1_FIELD_FIXED_TABLE( _ident, _fname, _fmax ) \
- T1_NEW_TABLE_FIELD( _ident, t1_field_fixed_array, \
+ T1_NEW_TABLE_FIELD( _ident, T1_FIELD_TYPE_FIXED_ARRAY, \
_fname, _fmax )
#define T1_FIELD_NUM_TABLE2( _ident, _fname, _fmax ) \
- T1_NEW_TABLE_FIELD2( _ident, t1_field_integer_array, \
+ T1_NEW_TABLE_FIELD2( _ident, T1_FIELD_TYPE_INTEGER_ARRAY, \
_fname, _fmax )
#define T1_FIELD_FIXED_TABLE2( _ident, _fname, _fmax ) \
- T1_NEW_TABLE_FIELD2( _ident, t1_field_fixed_array, \
+ T1_NEW_TABLE_FIELD2( _ident, T1_FIELD_TYPE_FIXED_ARRAY, \
_fname, _fmax )
#define T1_FIELD_CALLBACK( _ident, _name ) \
@@ -294,70 +300,72 @@ FT_BEGIN_HEADER
/*************************************************************************/
/*************************************************************************/
- typedef struct T1_Parser_Funcs_
+ typedef const struct PS_Parser_FuncsRec_* PS_Parser_Funcs;
+
+ typedef struct PS_Parser_FuncsRec_
{
void
- (*init)( T1_Parser* parser,
+ (*init)( PS_Parser parser,
FT_Byte* base,
FT_Byte* limit,
FT_Memory memory );
void
- (*done)( T1_Parser* parser );
+ (*done)( PS_Parser parser );
void
- (*skip_spaces)( T1_Parser* parser );
+ (*skip_spaces)( PS_Parser parser );
void
- (*skip_alpha)( T1_Parser* parser );
+ (*skip_alpha)( PS_Parser parser );
FT_Long
- (*to_int)( T1_Parser* parser );
+ (*to_int)( PS_Parser parser );
FT_Fixed
- (*to_fixed)( T1_Parser* parser,
+ (*to_fixed)( PS_Parser parser,
FT_Int power_ten );
FT_Int
- (*to_coord_array)( T1_Parser* parser,
+ (*to_coord_array)( PS_Parser parser,
FT_Int max_coords,
FT_Short* coords );
FT_Int
- (*to_fixed_array)( T1_Parser* parser,
+ (*to_fixed_array)( PS_Parser parser,
FT_Int max_values,
FT_Fixed* values,
FT_Int power_ten );
void
- (*to_token)( T1_Parser* parser,
- T1_Token* token );
+ (*to_token)( PS_Parser parser,
+ T1_Token token );
void
- (*to_token_array)( T1_Parser* parser,
- T1_Token* tokens,
+ (*to_token_array)( PS_Parser parser,
+ T1_Token tokens,
FT_UInt max_tokens,
FT_Int* pnum_tokens );
FT_Error
- (*load_field)( T1_Parser* parser,
- const T1_Field* field,
+ (*load_field)( PS_Parser parser,
+ const T1_Field field,
void** objects,
FT_UInt max_objects,
FT_ULong* pflags );
FT_Error
- (*load_field_table)( T1_Parser* parser,
- const T1_Field* field,
+ (*load_field_table)( PS_Parser parser,
+ const T1_Field field,
void** objects,
FT_UInt max_objects,
FT_ULong* pflags );
- } T1_Parser_Funcs;
+ } PS_Parser_FuncsRec;
/*************************************************************************/
/* */
/* <Struct> */
- /* T1_Parser */
+ /* PS_ParserRec */
/* */
/* <Description> */
- /* A T1_Parser is an object used to parse a Type 1 font very quickly. */
+ /* A PS_Parser is an object used to parse a Type 1 font very quickly. */
/* */
/* <Fields> */
/* cursor :: The current position in the text. */
@@ -372,16 +380,17 @@ FT_BEGIN_HEADER
/* */
/* funcs :: A table of functions for the parser. */
/* */
- struct T1_Parser_
+ typedef struct PS_ParserRec_
{
- FT_Byte* cursor;
- FT_Byte* base;
- FT_Byte* limit;
- FT_Error error;
- FT_Memory memory;
+ FT_Byte* cursor;
+ FT_Byte* base;
+ FT_Byte* limit;
+ FT_Error error;
+ FT_Memory memory;
- T1_Parser_Funcs funcs;
- };
+ PS_Parser_FuncsRec funcs;
+
+ } PS_ParserRec;
@@ -567,28 +576,28 @@ FT_BEGIN_HEADER
#endif /* 0 */
- typedef struct T1_Decoder_Zone_
+ typedef struct T1_Decoder_ZoneRec_
{
FT_Byte* cursor;
FT_Byte* base;
FT_Byte* limit;
- } T1_Decoder_Zone;
+ } T1_Decoder_ZoneRec, *T1_Decoder_Zone;
- typedef struct T1_Decoder_ T1_Decoder;
- typedef struct T1_Decoder_Funcs_ T1_Decoder_Funcs;
+ typedef struct T1_DecoderRec_* T1_Decoder;
+ typedef const struct T1_Decoder_FuncsRec_* T1_Decoder_Funcs;
typedef FT_Error
- (*T1_Decoder_Callback)( T1_Decoder* decoder,
- FT_UInt glyph_index );
+ (*T1_Decoder_Callback)( T1_Decoder decoder,
+ FT_UInt glyph_index );
- struct T1_Decoder_Funcs_
+ typedef struct T1_Decoder_FuncsRec_
{
FT_Error
- (*init) ( T1_Decoder* decoder,
+ (*init) ( T1_Decoder decoder,
FT_Face face,
FT_Size size,
FT_GlyphSlot slot,
@@ -598,26 +607,27 @@ FT_BEGIN_HEADER
T1_Decoder_Callback callback );
void
- (*done) ( T1_Decoder* decoder );
+ (*done) ( T1_Decoder decoder );
FT_Error
- (*parse_charstrings)( T1_Decoder* decoder,
+ (*parse_charstrings)( T1_Decoder decoder,
FT_Byte* base,
FT_UInt len );
- };
+
+ } T1_Decoder_FuncsRec;
- struct T1_Decoder_
+ typedef struct T1_DecoderRec_
{
T1_Builder builder;
FT_Long stack[T1_MAX_CHARSTRINGS_OPERANDS];
FT_Long* top;
- T1_Decoder_Zone zones[T1_MAX_SUBRS_CALLS + 1];
- T1_Decoder_Zone* zone;
+ T1_Decoder_ZoneRec zones[T1_MAX_SUBRS_CALLS + 1];
+ T1_Decoder_Zone zone;
- PSNames_Interface* psnames; /* for seac */
+ PSNames_Service psnames; /* for seac */
FT_UInt num_glyphs;
FT_Byte** glyph_names;
@@ -636,8 +646,9 @@ FT_BEGIN_HEADER
T1_Blend* blend; /* for multiple master support */
T1_Decoder_Callback parse_callback;
- T1_Decoder_Funcs funcs;
- };
+ T1_Decoder_FuncsRec funcs;
+
+ } T1_DecoderRec;
/*************************************************************************/
@@ -650,10 +661,10 @@ FT_BEGIN_HEADER
typedef struct PSAux_Interface_
{
- const PS_Table_Funcs* ps_table_funcs;
- const T1_Parser_Funcs* t1_parser_funcs;
+ const PS_Table_Funcs ps_table_funcs;
+ const PS_Parser_Funcs ps_parser_funcs;
const T1_Builder_Funcs* t1_builder_funcs;
- const T1_Decoder_Funcs* t1_decoder_funcs;
+ const T1_Decoder_Funcs t1_decoder_funcs;
void
(*t1_decrypt)( FT_Byte* buffer,
@@ -662,6 +673,7 @@ FT_BEGIN_HEADER
} PSAux_Interface;
+ typedef PSAux_Interface* PSAux_Service;
FT_END_HEADER
diff --git a/include/freetype/internal/pshints.h b/include/freetype/internal/pshints.h
index 87a4d80..edec32d 100644
--- a/include/freetype/internal/pshints.h
+++ b/include/freetype/internal/pshints.h
@@ -607,8 +607,9 @@ FT_BEGIN_HEADER
T1_Hints_Funcs (*get_t1_funcs) ( FT_Module module );
T2_Hints_Funcs (*get_t2_funcs) ( FT_Module module );
- } PSHinter_Interface, *PSHinter_InterfacePtr;
+ } PSHinter_Interface;
+ typedef PSHinter_Interface* PSHinter_Service;
FT_END_HEADER
diff --git a/include/freetype/internal/psnames.h b/include/freetype/internal/psnames.h
index a70b7a9..d3875bb 100644
--- a/include/freetype/internal/psnames.h
+++ b/include/freetype/internal/psnames.h
@@ -226,9 +226,12 @@ FT_BEGIN_HEADER
const unsigned short* adobe_expert_encoding;
PS_Next_Unicode_Func next_unicode;
+
} PSNames_Interface;
+ typedef PSNames_Interface* PSNames_Service;
+
FT_END_HEADER
#endif /* __PSNAMES_H__ */
diff --git a/include/freetype/internal/sfnt.h b/include/freetype/internal/sfnt.h
index bfcce5d..b637c2d 100644
--- a/include/freetype/internal/sfnt.h
+++ b/include/freetype/internal/sfnt.h
@@ -522,6 +522,9 @@ FT_BEGIN_HEADER
} SFNT_Interface;
+ /* transitional */
+ typedef SFNT_Interface* SFNT_Service;
+
FT_END_HEADER
#endif /* __SFNT_H__ */
diff --git a/include/freetype/internal/tttypes.h b/include/freetype/internal/tttypes.h
index 0b1efa8..f5f9802 100644
--- a/include/freetype/internal/tttypes.h
+++ b/include/freetype/internal/tttypes.h
@@ -1101,6 +1101,20 @@ FT_BEGIN_HEADER
} TT_CharMapRec;
+
+ typedef const struct TT_CMap_ClassRec_* TT_CMap_Class;
+
+ typedef FT_Error (*TT_CMap_ValidateFunc)( FT_Byte* data,
+ FT_Validator valid );
+
+ typedef struct TT_CMap_ClassRec_
+ {
+ FT_CMap_ClassRec clazz;
+ TT_CMap_ValidateFunc validate;
+
+ } TT_CMap_ClassRec;
+
+
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 5d56b2e..27a5233 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -1374,6 +1374,76 @@
}
+ FT_BASE_DEF( void )
+ FT_CMap_Done( FT_CMap cmap )
+ {
+ if ( cmap )
+ {
+ FT_CMap_Class clazz = cmap->clazz;
+ FT_Face face = cmap->charmap.face;
+ FT_Memory memory = FT_FACE_MEMORY(face);
+
+ if ( clazz->done )
+ clazz->done( cmap->data );
+
+ FREE( cmap );
+ }
+ }
+
+
+ FT_BASE_DEF( FT_Error )
+ FT_CMap_New( FT_CMap_Class clazz,
+ FT_Pointer data,
+ FT_CharMap charmap,
+ FT_CMap *acmap )
+ {
+ FT_Error error = 0;
+ FT_Face face;
+ FT_Memory memory;
+ FT_CMap cmap;
+
+ if ( clazz == NULL || charmap == NULL || charmap->face == NULL )
+ return FT_Err_Invalid_Argument;
+
+ face = charmap->face;
+ memory = FT_FACE_MEMORY(face);
+
+ if ( !ALLOC( cmap, clazz->size ) )
+ {
+ cmap->charmap = *charmap;
+ cmap->clazz = clazz;
+ cmap->data = data;
+
+ if ( clazz->init )
+ {
+ error = clazz->init( cmap, data );
+ if (error)
+ goto Fail;
+ }
+
+ /* add it to our list of charmaps */
+ if ( REALLOC_ARRAY( face->charmaps,
+ face->num_charmaps,
+ face->num_charmaps+1,
+ FT_CharMap* ) )
+ goto Fail;
+
+ face->charmaps[ face->num_charmaps++ ] = (FT_CharMap) cmap;
+ }
+
+ Exit:
+ if ( acmap )
+ *acmap = cmap;
+
+ return error;
+
+ Fail:
+ FT_CMap_Done( cmap );
+ cmap = NULL;
+ goto Exit;
+ }
+
+
/* documentation is in freetype.h */
FT_EXPORT_DEF( FT_UInt )
diff --git a/src/cff/cffdrivr.c b/src/cff/cffdrivr.c
index 24e4200..84d295a 100644
--- a/src/cff/cffdrivr.c
+++ b/src/cff/cffdrivr.c
@@ -22,6 +22,7 @@
#include FT_INTERNAL_STREAM_H
#include FT_INTERNAL_SFNT_H
#include FT_TRUETYPE_IDS_H
+#include FT_INTERNAL_POSTSCRIPT_NAMES_H
#include "cffdrivr.h"
#include "cffgload.h"
@@ -231,10 +232,10 @@
FT_Memory memory = FT_FACE_MEMORY( face );
FT_String* gname;
FT_UShort sid;
- PSNames_Interface* psnames;
+ PSNames_Service psnames;
FT_Error error;
- psnames = (PSNames_Interface*)FT_Get_Module_Interface(
+ psnames = (PSNames_Service)FT_Get_Module_Interface(
face->root.driver->root.library, "psnames" );
if ( !psnames )
@@ -303,7 +304,7 @@
/* Load table if needed */
if ( !cmap->loaded )
{
- SFNT_Interface* sfnt = (SFNT_Interface*)face->sfnt;
+ SFNT_Service sfnt = (SFNT_Service)face->sfnt;
error = sfnt->load_charmap( face, cmap, face->root.stream );
@@ -347,7 +348,7 @@
/* Load table if needed */
if ( !cmap->loaded )
{
- SFNT_Interface* sfnt = (SFNT_Interface*)face->sfnt;
+ SFNT_Service sfnt = (SFNT_Service)face->sfnt;
error = sfnt->load_charmap( face, cmap, face->root.stream );
@@ -382,20 +383,20 @@
cff_get_name_index( CFF_Face face,
FT_String* glyph_name )
{
- CFF_Font* cff;
- CFF_Charset* charset;
- PSNames_Interface* psnames;
- FT_Memory memory = FT_FACE_MEMORY( face );
- FT_String* name;
- FT_UShort sid;
- FT_UInt i;
- FT_Int result;
+ CFF_Font* cff;
+ CFF_Charset* charset;
+ PSNames_Service psnames;
+ FT_Memory memory = FT_FACE_MEMORY( face );
+ FT_String* name;
+ FT_UShort sid;
+ FT_UInt i;
+ FT_Int result;
cff = face->extra.data;
charset = &cff->charset;
- psnames = (PSNames_Interface*)FT_Get_Module_Interface(
+ psnames = (PSNames_Service)FT_Get_Module_Interface(
face->root.driver->root.library, "psnames" );
for ( i = 0; i < cff->num_glyphs; i++ )
@@ -405,7 +406,7 @@
if ( sid > 390 )
name = CFF_Get_Name( &cff->string_index, sid - 391 );
else
- name = (FT_String *)psnames->adobe_std_strings( sid );
+ name = (FT_String *) psnames->adobe_std_strings( sid );
result = strcmp( glyph_name, name );
diff --git a/src/cff/cffload.c b/src/cff/cffload.c
index 155bba4..f002071 100644
--- a/src/cff/cffload.c
+++ b/src/cff/cffload.c
@@ -1313,7 +1313,7 @@
FT_LOCAL_DEF FT_String*
CFF_Get_String( CFF_Index* index,
FT_UInt sid,
- PSNames_Interface* interface )
+ PSNames_Service interface )
{
/* if it is not a standard string, return it */
if ( sid > 390 )
diff --git a/src/cff/cffload.h b/src/cff/cffload.h
index eedabc3..329c709 100644
--- a/src/cff/cffload.h
+++ b/src/cff/cffload.h
@@ -38,7 +38,7 @@ FT_BEGIN_HEADER
FT_LOCAL FT_String*
CFF_Get_String( CFF_Index* index,
FT_UInt sid,
- PSNames_Interface* interface );
+ PSNames_Service interface );
FT_LOCAL FT_Error
diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c
index a869839..e4a468e 100644
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -59,10 +59,10 @@
static PSH_Globals_Funcs
CFF_Size_Get_Globals_Funcs( CFF_Size size )
{
- CFF_Face face = (CFF_Face)size->face;
- CFF_Font* font = face->extra.data;
- PSHinter_Interface* pshinter = font->pshinter;
- FT_Module module;
+ CFF_Face face = (CFF_Face)size->face;
+ CFF_Font* font = face->extra.data;
+ PSHinter_Service pshinter = font->pshinter;
+ FT_Module module;
module = FT_Get_Module( size->face->driver->root.library,
@@ -197,7 +197,7 @@
{
CFF_Face face = (CFF_Face)slot->root.face;
CFF_Font* font = face->extra.data;
- PSHinter_Interface* pshinter = font->pshinter;
+ PSHinter_Service pshinter = font->pshinter;
if ( pshinter )
@@ -255,7 +255,7 @@
static FT_Error
CFF_Build_Unicode_Charmap( CFF_Face face,
FT_ULong base_offset,
- PSNames_Interface* psnames )
+ PSNames_Service psnames )
{
CFF_Font* font = (CFF_Font*)face->extra.data;
FT_Memory memory = FT_FACE_MEMORY(face);
@@ -449,22 +449,22 @@
FT_Parameter* params )
{
FT_Error error;
- SFNT_Interface* sfnt;
- PSNames_Interface* psnames;
- PSHinter_Interface* pshinter;
+ SFNT_Service sfnt;
+ PSNames_Service psnames;
+ PSHinter_Service pshinter;
FT_Bool pure_cff = 1;
FT_Bool sfnt_format = 0;
- sfnt = (SFNT_Interface*)FT_Get_Module_Interface(
+ sfnt = (SFNT_Service)FT_Get_Module_Interface(
face->root.driver->root.library, "sfnt" );
if ( !sfnt )
goto Bad_Format;
- psnames = (PSNames_Interface*)FT_Get_Module_Interface(
+ psnames = (PSNames_Service)FT_Get_Module_Interface(
face->root.driver->root.library, "psnames" );
- pshinter = (PSHinter_Interface*)FT_Get_Module_Interface(
+ pshinter = (PSHinter_Service)FT_Get_Module_Interface(
face->root.driver->root.library, "pshinter" );
/* create input stream from resource */
@@ -704,7 +704,7 @@
CFF_Face_Done( CFF_Face face )
{
FT_Memory memory = face->root.memory;
- SFNT_Interface* sfnt = (SFNT_Interface*)face->sfnt;
+ SFNT_Service sfnt = (SFNT_Service)face->sfnt;
if ( sfnt )
diff --git a/src/cid/cidgload.c b/src/cid/cidgload.c
index e7a70e8..f201162 100644
--- a/src/cid/cidgload.c
+++ b/src/cid/cidgload.c
@@ -37,8 +37,8 @@
FT_CALLBACK_DEF( FT_Error )
- cid_load_glyph( T1_Decoder* decoder,
- FT_UInt glyph_index )
+ cid_load_glyph( T1_Decoder decoder,
+ FT_UInt glyph_index )
{
CID_Face face = (CID_Face)decoder->builder.face;
CID_Info* cid = &face->cid;
@@ -143,10 +143,10 @@
FT_Int* max_advance )
{
FT_Error error;
- T1_Decoder decoder;
+ T1_DecoderRec decoder;
FT_Int glyph_index;
- PSAux_Interface* psaux = (PSAux_Interface*)face->psaux;
+ PSAux_Service psaux = (PSAux_Service)face->psaux;
*max_advance = 0;
@@ -208,13 +208,13 @@
FT_Int load_flags )
{
FT_Error error;
- T1_Decoder decoder;
+ T1_DecoderRec decoder;
CID_Face face = (CID_Face)glyph->root.face;
FT_Bool hinting;
- PSAux_Interface* psaux = (PSAux_Interface*)face->psaux;
- FT_Matrix font_matrix;
- FT_Vector font_offset;
+ PSAux_Service psaux = (PSAux_Service)face->psaux;
+ FT_Matrix font_matrix;
+ FT_Vector font_offset;
if ( load_flags & FT_LOAD_NO_RECURSE )
diff --git a/src/cid/cidload.c b/src/cid/cidload.c
index 5611291..1aea67e 100644
--- a/src/cid/cidload.c
+++ b/src/cid/cidload.c
@@ -90,7 +90,7 @@
static FT_Error
cid_load_keyword( CID_Face face,
CID_Loader* loader,
- const T1_Field* keyword )
+ const T1_Field keyword )
{
FT_Error error;
CID_Parser* parser = &loader->parser;
@@ -100,7 +100,7 @@
/* if the keyword has a dedicated callback, call it */
- if ( keyword->type == t1_field_callback )
+ if ( keyword->type == T1_FIELD_TYPE_CALLBACK )
{
keyword->reader( (FT_Face)face, parser );
error = parser->root.error;
@@ -147,8 +147,8 @@
dummy_object = object;
/* now, load the keyword data in the object's field(s) */
- if ( keyword->type == t1_field_integer_array ||
- keyword->type == t1_field_fixed_array )
+ if ( keyword->type == T1_FIELD_TYPE_INTEGER_ARRAY ||
+ keyword->type == T1_FIELD_TYPE_FIXED_ARRAY )
error = CID_Load_Field_Table( &loader->parser, keyword,
&dummy_object );
else
@@ -270,7 +270,7 @@
static
- const T1_Field cid_field_records[] =
+ const T1_FieldRec cid_field_records[] =
{
#include "cidtoken.h"
@@ -278,7 +278,7 @@
T1_FIELD_CALLBACK( "FontBBox", parse_font_bbox )
T1_FIELD_CALLBACK( "FDArray", parse_fd_array )
T1_FIELD_CALLBACK( "FontMatrix", parse_font_matrix )
- { 0, t1_field_cid_info, t1_field_none, 0, 0, 0, 0, 0 }
+ { 0, t1_field_cid_info, T1_FIELD_TYPE_NONE, 0, 0, 0, 0, 0 }
};
@@ -339,7 +339,7 @@
if ( len > 0 && len < 22 )
{
/* now compare the immediate name to the keyword table */
- const T1_Field* keyword = cid_field_records;
+ T1_Field keyword = (T1_Field) cid_field_records;
for (;;)
@@ -527,7 +527,7 @@
parser = &loader.parser;
error = CID_New_Parser( parser, face->root.stream, face->root.memory,
- (PSAux_Interface*)face->psaux );
+ (PSAux_Service)face->psaux );
if ( error )
goto Exit;
diff --git a/src/cid/cidobjs.c b/src/cid/cidobjs.c
index c42d0e8..dee607a 100644
--- a/src/cid/cidobjs.c
+++ b/src/cid/cidobjs.c
@@ -55,7 +55,7 @@
CID_GlyphSlot_Init( CID_GlyphSlot slot )
{
CID_Face face;
- PSHinter_Interface* pshinter;
+ PSHinter_Service pshinter;
face = (CID_Face) slot->root.face;
@@ -93,7 +93,7 @@
CID_Size_Get_Globals_Funcs( CID_Size size )
{
CID_Face face = (CID_Face)size->root.face;
- PSHinter_Interface* pshinter = face->pshinter;
+ PSHinter_Service pshinter = face->pshinter;
FT_Module module;
@@ -270,9 +270,9 @@
FT_Parameter* params )
{
FT_Error error;
- PSNames_Interface* psnames;
- PSAux_Interface* psaux;
- PSHinter_Interface* pshinter;
+ PSNames_Service psnames;
+ PSAux_Service psaux;
+ PSHinter_Service pshinter;
FT_UNUSED( num_params );
FT_UNUSED( params );
@@ -282,28 +282,28 @@
face->root.num_faces = 1;
- psnames = (PSNames_Interface*)face->psnames;
+ psnames = (PSNames_Service)face->psnames;
if ( !psnames )
{
- psnames = (PSNames_Interface*)FT_Get_Module_Interface(
+ psnames = (PSNames_Service)FT_Get_Module_Interface(
FT_FACE_LIBRARY( face ), "psnames" );
face->psnames = psnames;
}
- psaux = (PSAux_Interface*)face->psaux;
+ psaux = (PSAux_Service)face->psaux;
if ( !psaux )
{
- psaux = (PSAux_Interface*)FT_Get_Module_Interface(
+ psaux = (PSAux_Service)FT_Get_Module_Interface(
FT_FACE_LIBRARY( face ), "psaux" );
face->psaux = psaux;
}
- pshinter = (PSHinter_Interface*)face->pshinter;
+ pshinter = (PSHinter_Service)face->pshinter;
if ( !pshinter )
{
- pshinter = (PSHinter_Interface*)FT_Get_Module_Interface(
+ pshinter = (PSHinter_Service)FT_Get_Module_Interface(
FT_FACE_LIBRARY( face ), "pshinter" );
face->pshinter = pshinter;
@@ -436,7 +436,7 @@
/* module */
if ( face->psnames )
{
- PSNames_Interface* psnames = (PSNames_Interface*)face->psnames;
+ PSNames_Service psnames = (PSNames_Service)face->psnames;
if ( psnames->unicode_value )
diff --git a/src/cid/cidparse.c b/src/cid/cidparse.c
index f87e09d..2f4b08c 100644
--- a/src/cid/cidparse.c
+++ b/src/cid/cidparse.c
@@ -54,7 +54,7 @@
CID_New_Parser( CID_Parser* parser,
FT_Stream stream,
FT_Memory memory,
- PSAux_Interface* psaux )
+ PSAux_Service psaux )
{
FT_Error error;
FT_ULong base_offset, offset, ps_len;
@@ -63,7 +63,7 @@
MEM_Set( parser, 0, sizeof ( *parser ) );
- psaux->t1_parser_funcs->init( &parser->root, 0, 0, memory );
+ psaux->ps_parser_funcs->init( &parser->root, 0, 0, memory );
parser->stream = stream;
diff --git a/src/cid/cidparse.h b/src/cid/cidparse.h
index a2bd1fa..813af00 100644
--- a/src/cid/cidparse.h
+++ b/src/cid/cidparse.h
@@ -39,7 +39,7 @@ FT_BEGIN_HEADER
/* quickly. */
/* */
/* <Fields> */
- /* root :: the root T1_Parser fields */
+ /* root :: the root PS_ParserRec fields */
/* */
/* stream :: The current input stream. */
/* */
@@ -57,16 +57,16 @@ FT_BEGIN_HEADER
/* */
typedef struct CID_Parser_
{
- T1_Parser root;
- FT_Stream stream;
+ PS_ParserRec root;
+ FT_Stream stream;
- FT_Byte* postscript;
- FT_Int postscript_len;
+ FT_Byte* postscript;
+ FT_Int postscript_len;
- FT_ULong data_offset;
+ FT_ULong data_offset;
- CID_Info* cid;
- FT_Int num_dict;
+ CID_Info* cid;
+ FT_Int num_dict;
} CID_Parser;
@@ -75,7 +75,7 @@ FT_BEGIN_HEADER
CID_New_Parser( CID_Parser* parser,
FT_Stream stream,
FT_Memory memory,
- PSAux_Interface* psaux );
+ PSAux_Service psaux );
FT_LOCAL void
CID_Done_Parser( CID_Parser* parser );
diff --git a/src/cid/cidriver.c b/src/cid/cidriver.c
index 21f0594..8f72654 100644
--- a/src/cid/cidriver.c
+++ b/src/cid/cidriver.c
@@ -107,11 +107,11 @@
{
T1_Face face;
FT_UInt result = 0;
- PSNames_Interface* psnames;
+ PSNames_Service psnames;
face = (T1_Face)charmap->face;
- psnames = (PSNames_Interface*)face->psnames;
+ psnames = (PSNames_Service)face->psnames;
if ( psnames )
switch ( charmap->encoding )
{
@@ -206,11 +206,11 @@
FT_Long charcode )
{
T1_Face face;
- PSNames_Interface* psnames;
+ PSNames_Service psnames;
face = (T1_Face)charmap->face;
- psnames = (PSNames_Interface*)face->psnames;
+ psnames = (PSNames_Service)face->psnames;
if ( psnames )
switch ( charmap->encoding )
diff --git a/src/cid/cidtoken.h b/src/cid/cidtoken.h
index 487355d..50b5c56 100644
--- a/src/cid/cidtoken.h
+++ b/src/cid/cidtoken.h
@@ -45,7 +45,7 @@
T1_FIELD_STRING( "FamilyName", family_name )
T1_FIELD_STRING( "Weight", weight )
T1_FIELD_FIXED ( "ItalicAngle", italic_angle )
- T1_FIELD_BOOL ( "isFixedPitch", is_fixed_pitch )
+ T1_FIELD_TYPE_BOOL ( "isFixedPitch", is_fixed_pitch )
T1_FIELD_NUM ( "UnderlinePosition", underline_position )
T1_FIELD_NUM ( "UnderlineThickness", underline_thickness )
diff --git a/src/psaux/psauxmod.c b/src/psaux/psauxmod.c
index 559f9d0..72a9b82 100644
--- a/src/psaux/psauxmod.c
+++ b/src/psaux/psauxmod.c
@@ -23,7 +23,7 @@
FT_CALLBACK_TABLE_DEF
- const PS_Table_Funcs ps_table_funcs =
+ const PS_Table_FuncsRec ps_table_funcs =
{
PS_Table_New,
PS_Table_Done,
@@ -33,20 +33,20 @@
FT_CALLBACK_TABLE_DEF
- const T1_Parser_Funcs t1_parser_funcs =
+ const PS_Parser_FuncsRec ps_parser_funcs =
{
- T1_Init_Parser,
- T1_Done_Parser,
- T1_Skip_Spaces,
- T1_Skip_Alpha,
- T1_ToInt,
- T1_ToFixed,
- T1_ToCoordArray,
- T1_ToFixedArray,
- T1_ToToken,
- T1_ToTokenArray,
- T1_Load_Field,
- T1_Load_Field_Table
+ PS_Parser_Init,
+ PS_Parser_Done,
+ PS_Parser_SkipSpaces,
+ PS_Parser_SkipAlpha,
+ PS_Parser_ToInt,
+ PS_Parser_ToFixed,
+ PS_Parser_ToCoordArray,
+ PS_Parser_ToFixedArray,
+ PS_Parser_ToToken,
+ PS_Parser_ToTokenArray,
+ PS_Parser_LoadField,
+ PS_Parser_LoadFieldTable
};
@@ -65,7 +65,7 @@
FT_CALLBACK_TABLE_DEF
- const T1_Decoder_Funcs t1_decoder_funcs =
+ const T1_Decoder_FuncsRec t1_decoder_funcs =
{
T1_Decoder_Init,
T1_Decoder_Done,
@@ -77,7 +77,7 @@
const PSAux_Interface psaux_interface =
{
&ps_table_funcs,
- &t1_parser_funcs,
+ &ps_parser_funcs,
&t1_builder_funcs,
&t1_decoder_funcs,
diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c
index 4856b21..68cd4ee 100644
--- a/src/psaux/psobjs.c
+++ b/src/psaux/psobjs.c
@@ -54,7 +54,7 @@
/* FreeType error code. 0 means success. */
/* */
FT_LOCAL_DEF FT_Error
- PS_Table_New( PS_Table* table,
+ PS_Table_New( PS_Table table,
FT_Int count,
FT_Memory memory )
{
@@ -72,7 +72,8 @@
table->block = 0;
table->capacity = 0;
table->cursor = 0;
- table->funcs = ps_table_funcs;
+
+ *(PS_Table_FuncsRec*)&table->funcs = ps_table_funcs;
Exit:
if ( error )
@@ -83,7 +84,7 @@
static void
- shift_elements( PS_Table* table,
+ shift_elements( PS_Table table,
FT_Byte* old_base )
{
FT_Long delta = (FT_Long)( table->block - old_base );
@@ -100,7 +101,7 @@
static FT_Error
- reallocate_t1_table( PS_Table* table,
+ reallocate_t1_table( PS_Table table,
FT_Int new_size )
{
FT_Memory memory = table->memory;
@@ -132,7 +133,7 @@
/* PS_Table_Add */
/* */
/* <Description> */
- /* Adds an object to a PS_Table, possibly growing its memory block. */
+ /* Adds an object to a PS_TableRec, possibly growing its memory block. */
/* */
/* <InOut> */
/* table :: The target table. */
@@ -149,7 +150,7 @@
/* reallocation fails. */
/* */
FT_LOCAL_DEF FT_Error
- PS_Table_Add( PS_Table* table,
+ PS_Table_Add( PS_Table table,
FT_Int index,
void* object,
FT_Int length )
@@ -199,7 +200,7 @@
/* PS_Table_Done */
/* */
/* <Description> */
- /* Finalizes a PS_Table (i.e., reallocate it to its current cursor). */
+ /* Finalizes a PS_TableRec (i.e., reallocate it to its current cursor). */
/* */
/* <InOut> */
/* table :: The target table. */
@@ -209,7 +210,7 @@
/* to the caller to clean it, or reference it in its own structures. */
/* */
FT_LOCAL_DEF void
- PS_Table_Done( PS_Table* table )
+ PS_Table_Done( PS_Table table )
{
FT_Memory memory = table->memory;
FT_Error error;
@@ -233,7 +234,7 @@
FT_LOCAL_DEF void
- PS_Table_Release( PS_Table* table )
+ PS_Table_Release( PS_Table table )
{
FT_Memory memory = table->memory;
@@ -264,7 +265,7 @@
FT_LOCAL_DEF void
- T1_Skip_Spaces( T1_Parser* parser )
+ PS_Parser_SkipSpaces( PS_Parser parser )
{
FT_Byte* cur = parser->cursor;
FT_Byte* limit = parser->limit;
@@ -284,7 +285,7 @@
FT_LOCAL_DEF void
- T1_Skip_Alpha( T1_Parser* parser )
+ PS_Parser_SkipAlpha( PS_Parser parser )
{
FT_Byte* cur = parser->cursor;
FT_Byte* limit = parser->limit;
@@ -304,8 +305,8 @@
FT_LOCAL_DEF void
- T1_ToToken( T1_Parser* parser,
- T1_Token* token )
+ PS_Parser_ToToken( PS_Parser parser,
+ T1_Token token )
{
FT_Byte* cur;
FT_Byte* limit;
@@ -313,12 +314,12 @@
FT_Int embed;
- token->type = t1_token_none;
+ token->type = T1_TOKEN_TYPE_NONE;
token->start = 0;
token->limit = 0;
/* first of all, skip space */
- T1_Skip_Spaces( parser );
+ PS_Parser_SkipSpaces( parser );
cur = parser->cursor;
limit = parser->limit;
@@ -329,19 +330,19 @@
{
/************* check for strings ***********************/
case '(':
- token->type = t1_token_string;
+ token->type = T1_TOKEN_TYPE_STRING;
ender = ')';
goto Lookup_Ender;
/************* check for programs/array ****************/
case '{':
- token->type = t1_token_array;
+ token->type = T1_TOKEN_TYPE_ARRAY;
ender = '}';
goto Lookup_Ender;
/************* check for table/array ******************/
case '[':
- token->type = t1_token_array;
+ token->type = T1_TOKEN_TYPE_ARRAY;
ender = ']';
Lookup_Ender:
@@ -368,7 +369,7 @@
/* **************** otherwise, it's any token **********/
default:
token->start = cur++;
- token->type = t1_token_any;
+ token->type = T1_TOKEN_TYPE_ANY;
while ( cur < limit && !IS_T1_SPACE( *cur ) )
cur++;
@@ -378,7 +379,7 @@
if ( !token->limit )
{
token->start = 0;
- token->type = t1_token_none;
+ token->type = T1_TOKEN_TYPE_NONE;
}
parser->cursor = cur;
@@ -387,23 +388,23 @@
FT_LOCAL_DEF void
- T1_ToTokenArray( T1_Parser* parser,
- T1_Token* tokens,
+ PS_Parser_ToTokenArray( PS_Parser parser,
+ T1_Token tokens,
FT_UInt max_tokens,
FT_Int* pnum_tokens )
{
- T1_Token master;
+ T1_TokenRec master;
*pnum_tokens = -1;
- T1_ToToken( parser, &master );
- if ( master.type == t1_token_array )
+ PS_Parser_ToToken( parser, &master );
+ if ( master.type == T1_TOKEN_TYPE_ARRAY )
{
FT_Byte* old_cursor = parser->cursor;
FT_Byte* old_limit = parser->limit;
- T1_Token* cur = tokens;
- T1_Token* limit = cur + max_tokens;
+ T1_Token cur = tokens;
+ T1_Token limit = cur + max_tokens;
parser->cursor = master.start;
@@ -411,10 +412,10 @@
while ( parser->cursor < parser->limit )
{
- T1_Token token;
+ T1_TokenRec token;
- T1_ToToken( parser, &token );
+ PS_Parser_ToToken( parser, &token );
if ( !token.type )
break;
@@ -783,13 +784,13 @@
/* Load a simple field (i.e. non-table) into the current list of objects */
FT_LOCAL_DEF FT_Error
- T1_Load_Field( T1_Parser* parser,
- const T1_Field* field,
+ PS_Parser_LoadField( PS_Parser parser,
+ const T1_Field field,
void** objects,
FT_UInt max_objects,
FT_ULong* pflags )
{
- T1_Token token;
+ T1_TokenRec token;
FT_Byte* cur;
FT_Byte* limit;
FT_UInt count;
@@ -797,7 +798,7 @@
FT_Error error;
- T1_ToToken( parser, &token );
+ PS_Parser_ToToken( parser, &token );
if ( !token.type )
goto Fail;
@@ -806,7 +807,7 @@
cur = token.start;
limit = token.limit;
- if ( token.type == t1_token_array )
+ if ( token.type == T1_TOKEN_TYPE_ARRAY )
{
/* if this is an array, and we have no blend, an error occurs */
if ( max_objects == 0 )
@@ -825,15 +826,15 @@
switch ( field->type )
{
- case t1_field_bool:
+ case T1_FIELD_TYPE_BOOL:
val = t1_tobool( &cur, limit );
goto Store_Integer;
- case t1_field_fixed:
+ case T1_FIELD_TYPE_FIXED:
val = t1_tofixed( &cur, limit, 3 );
goto Store_Integer;
- case t1_field_integer:
+ case T1_FIELD_TYPE_INTEGER:
val = t1_toint( &cur, limit );
Store_Integer:
@@ -856,7 +857,7 @@
}
break;
- case t1_field_string:
+ case T1_FIELD_TYPE_STRING:
{
FT_Memory memory = parser->memory;
FT_UInt len = (FT_UInt)( limit - cur );
@@ -904,27 +905,27 @@
FT_LOCAL_DEF FT_Error
- T1_Load_Field_Table( T1_Parser* parser,
- const T1_Field* field,
+ PS_Parser_LoadFieldTable( PS_Parser parser,
+ const T1_Field field,
void** objects,
FT_UInt max_objects,
FT_ULong* pflags )
{
- T1_Token elements[T1_MAX_TABLE_ELEMENTS];
- T1_Token* token;
+ T1_TokenRec elements[T1_MAX_TABLE_ELEMENTS];
+ T1_Token token;
FT_Int num_elements;
FT_Error error = 0;
FT_Byte* old_cursor;
FT_Byte* old_limit;
- T1_Field fieldrec = *(T1_Field*)field;
+ T1_FieldRec fieldrec = *(T1_Field)field;
#if 1
- fieldrec.type = t1_field_integer;
- if ( field->type == t1_field_fixed_array )
- fieldrec.type = t1_field_fixed;
+ fieldrec.type = T1_FIELD_TYPE_INTEGER;
+ if ( field->type == T1_FIELD_TYPE_FIXED_ARRAY )
+ fieldrec.type = T1_FIELD_TYPE_FIXED;
#endif
- T1_ToTokenArray( parser, elements, 32, &num_elements );
+ PS_Parser_ToTokenArray( parser, elements, 32, &num_elements );
if ( num_elements < 0 )
goto Fail;
@@ -944,7 +945,7 @@
{
parser->cursor = token->start;
parser->limit = token->limit;
- T1_Load_Field( parser, &fieldrec, objects, max_objects, 0 );
+ PS_Parser_LoadField( parser, &fieldrec, objects, max_objects, 0 );
fieldrec.offset += fieldrec.size;
}
@@ -968,14 +969,14 @@
FT_LOCAL_DEF FT_Long
- T1_ToInt( T1_Parser* parser )
+ PS_Parser_ToInt( PS_Parser parser )
{
return t1_toint( &parser->cursor, parser->limit );
}
FT_LOCAL_DEF FT_Fixed
- T1_ToFixed( T1_Parser* parser,
+ PS_Parser_ToFixed( PS_Parser parser,
FT_Int power_ten )
{
return t1_tofixed( &parser->cursor, parser->limit, power_ten );
@@ -983,7 +984,7 @@
FT_LOCAL_DEF FT_Int
- T1_ToCoordArray( T1_Parser* parser,
+ PS_Parser_ToCoordArray( PS_Parser parser,
FT_Int max_coords,
FT_Short* coords )
{
@@ -993,7 +994,7 @@
FT_LOCAL_DEF FT_Int
- T1_ToFixedArray( T1_Parser* parser,
+ PS_Parser_ToFixedArray( PS_Parser parser,
FT_Int max_values,
FT_Fixed* values,
FT_Int power_ten )
@@ -1006,14 +1007,14 @@
#if 0
FT_LOCAL_DEF FT_String*
- T1_ToString( T1_Parser* parser )
+ T1_ToString( PS_Parser parser )
{
return t1_tostring( &parser->cursor, parser->limit, parser->memory );
}
FT_LOCAL_DEF FT_Bool
- T1_ToBool( T1_Parser* parser )
+ T1_ToBool( PS_Parser parser )
{
return t1_tobool( &parser->cursor, parser->limit );
}
@@ -1022,7 +1023,7 @@
FT_LOCAL_DEF void
- T1_Init_Parser( T1_Parser* parser,
+ PS_Parser_Init( PS_Parser parser,
FT_Byte* base,
FT_Byte* limit,
FT_Memory memory )
@@ -1032,12 +1033,12 @@
parser->limit = limit;
parser->cursor = base;
parser->memory = memory;
- parser->funcs = t1_parser_funcs;
+ parser->funcs = ps_parser_funcs;
}
FT_LOCAL_DEF void
- T1_Done_Parser( T1_Parser* parser )
+ PS_Parser_Done( PS_Parser parser )
{
FT_UNUSED( parser );
}
diff --git a/src/psaux/psobjs.h b/src/psaux/psobjs.h
index 16dfe5c..84cd0b9 100644
--- a/src/psaux/psobjs.h
+++ b/src/psaux/psobjs.h
@@ -37,32 +37,32 @@ FT_BEGIN_HEADER
FT_CALLBACK_TABLE
- const PS_Table_Funcs ps_table_funcs;
+ const PS_Table_FuncsRec ps_table_funcs;
FT_CALLBACK_TABLE
- const T1_Parser_Funcs t1_parser_funcs;
+ const PS_Parser_FuncsRec ps_parser_funcs;
FT_CALLBACK_TABLE
- const T1_Builder_Funcs t1_builder_funcs;
+ const T1_Builder_Funcs t1_builder_funcs;
FT_LOCAL FT_Error
- PS_Table_New( PS_Table* table,
+ PS_Table_New( PS_Table table,
FT_Int count,
FT_Memory memory );
FT_LOCAL FT_Error
- PS_Table_Add( PS_Table* table,
+ PS_Table_Add( PS_Table table,
FT_Int index,
void* object,
FT_Int length );
FT_LOCAL void
- PS_Table_Done( PS_Table* table );
+ PS_Table_Done( PS_Table table );
FT_LOCAL void
- PS_Table_Release( PS_Table* table );
+ PS_Table_Release( PS_Table table );
/*************************************************************************/
@@ -75,64 +75,64 @@ FT_BEGIN_HEADER
FT_LOCAL void
- T1_Skip_Spaces( T1_Parser* parser );
+ PS_Parser_SkipSpaces( PS_Parser parser );
FT_LOCAL void
- T1_Skip_Alpha( T1_Parser* parser );
+ PS_Parser_SkipAlpha( PS_Parser parser );
FT_LOCAL void
- T1_ToToken( T1_Parser* parser,
- T1_Token* token );
+ PS_Parser_ToToken( PS_Parser parser,
+ T1_Token token );
FT_LOCAL void
- T1_ToTokenArray( T1_Parser* parser,
- T1_Token* tokens,
+ PS_Parser_ToTokenArray( PS_Parser parser,
+ T1_Token tokens,
FT_UInt max_tokens,
FT_Int* pnum_tokens );
FT_LOCAL FT_Error
- T1_Load_Field( T1_Parser* parser,
- const T1_Field* field,
+ PS_Parser_LoadField( PS_Parser parser,
+ const T1_Field field,
void** objects,
FT_UInt max_objects,
FT_ULong* pflags );
FT_LOCAL FT_Error
- T1_Load_Field_Table( T1_Parser* parser,
- const T1_Field* field,
+ PS_Parser_LoadFieldTable( PS_Parser parser,
+ const T1_Field field,
void** objects,
FT_UInt max_objects,
FT_ULong* pflags );
FT_LOCAL FT_Long
- T1_ToInt( T1_Parser* parser );
+ PS_Parser_ToInt( PS_Parser parser );
FT_LOCAL FT_Fixed
- T1_ToFixed( T1_Parser* parser,
+ PS_Parser_ToFixed( PS_Parser parser,
FT_Int power_ten );
FT_LOCAL FT_Int
- T1_ToCoordArray( T1_Parser* parser,
+ PS_Parser_ToCoordArray( PS_Parser parser,
FT_Int max_coords,
FT_Short* coords );
FT_LOCAL FT_Int
- T1_ToFixedArray( T1_Parser* parser,
+ PS_Parser_ToFixedArray( PS_Parser parser,
FT_Int max_values,
FT_Fixed* values,
FT_Int power_ten );
FT_LOCAL void
- T1_Init_Parser( T1_Parser* parser,
+ PS_Parser_Init( PS_Parser parser,
FT_Byte* base,
FT_Byte* limit,
FT_Memory memory );
FT_LOCAL void
- T1_Done_Parser( T1_Parser* parser );
+ PS_Parser_Done( PS_Parser parser );
/*************************************************************************/
diff --git a/src/psaux/t1decode.c b/src/psaux/t1decode.c
index fcd5cc9..32a9b5d 100644
--- a/src/psaux/t1decode.c
+++ b/src/psaux/t1decode.c
@@ -121,12 +121,12 @@
/* glyph wasn't found. */
/* */
static FT_Int
- t1_lookup_glyph_by_stdcharcode( T1_Decoder* decoder,
+ t1_lookup_glyph_by_stdcharcode( T1_Decoder decoder,
FT_Int charcode )
{
FT_UInt n;
const FT_String* glyph_name;
- PSNames_Interface* psnames = decoder->psnames;
+ PSNames_Service psnames = decoder->psnames;
/* check range of standard char code */
@@ -175,7 +175,7 @@
/* FreeType error code. 0 means success. */
/* */
static FT_Error
- t1operator_seac( T1_Decoder* decoder,
+ t1operator_seac( T1_Decoder decoder,
FT_Pos asb,
FT_Pos adx,
FT_Pos ady,
@@ -331,12 +331,12 @@
/* FreeType error code. 0 means success. */
/* */
FT_LOCAL_DEF FT_Error
- T1_Decoder_Parse_Charstrings( T1_Decoder* decoder,
+ T1_Decoder_Parse_Charstrings( T1_Decoder decoder,
FT_Byte* charstring_base,
FT_UInt charstring_len )
{
FT_Error error;
- T1_Decoder_Zone* zone;
+ T1_Decoder_Zone zone;
FT_Byte* ip;
FT_Byte* limit;
T1_Builder* builder = &decoder->builder;
@@ -1098,7 +1098,7 @@
/* parse a single Type 1 glyph */
FT_LOCAL_DEF FT_Error
- T1_Decoder_Parse_Glyph( T1_Decoder* decoder,
+ T1_Decoder_Parse_Glyph( T1_Decoder decoder,
FT_UInt glyph )
{
return decoder->parse_callback( decoder, glyph );
@@ -1107,7 +1107,7 @@
/* initialise T1 decoder */
FT_LOCAL_DEF FT_Error
- T1_Decoder_Init( T1_Decoder* decoder,
+ T1_Decoder_Init( T1_Decoder decoder,
FT_Face face,
FT_Size size,
FT_GlyphSlot slot,
@@ -1120,10 +1120,10 @@
/* retrieve PSNames interface from list of current modules */
{
- PSNames_Interface* psnames = 0;
+ PSNames_Service psnames = 0;
- psnames = (PSNames_Interface*)FT_Get_Module_Interface(
+ psnames = (PSNames_Service)FT_Get_Module_Interface(
FT_FACE_LIBRARY(face), "psnames" );
if ( !psnames )
{
@@ -1149,7 +1149,7 @@
/* finalize T1 decoder */
FT_LOCAL_DEF void
- T1_Decoder_Done( T1_Decoder* decoder )
+ T1_Decoder_Done( T1_Decoder decoder )
{
T1_Builder_Done( &decoder->builder );
}
diff --git a/src/psaux/t1decode.h b/src/psaux/t1decode.h
index fd58870..500291f 100644
--- a/src/psaux/t1decode.h
+++ b/src/psaux/t1decode.h
@@ -30,20 +30,20 @@ FT_BEGIN_HEADER
FT_CALLBACK_TABLE
- const T1_Decoder_Funcs t1_decoder_funcs;
+ const T1_Decoder_FuncsRec t1_decoder_funcs;
FT_LOCAL FT_Error
- T1_Decoder_Parse_Glyph( T1_Decoder* decoder,
+ T1_Decoder_Parse_Glyph( T1_Decoder decoder,
FT_UInt glyph_index );
FT_LOCAL FT_Error
- T1_Decoder_Parse_Charstrings( T1_Decoder* decoder,
+ T1_Decoder_Parse_Charstrings( T1_Decoder decoder,
FT_Byte* base,
FT_UInt len );
FT_LOCAL FT_Error
- T1_Decoder_Init( T1_Decoder* decoder,
+ T1_Decoder_Init( T1_Decoder decoder,
FT_Face face,
FT_Size size,
FT_GlyphSlot slot,
@@ -53,7 +53,7 @@ FT_BEGIN_HEADER
T1_Decoder_Callback parse_glyph );
FT_LOCAL void
- T1_Decoder_Done( T1_Decoder* decoder );
+ T1_Decoder_Done( T1_Decoder decoder );
FT_END_HEADER
diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c
index d0432a2..c4e8d98 100644
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -186,19 +186,19 @@
FT_Int num_params,
FT_Parameter* params )
{
- FT_Error error;
- FT_Library library = face->root.driver->root.library;
- SFNT_Interface* sfnt;
- SFNT_Header sfnt_header;
+ FT_Error error;
+ FT_Library library = face->root.driver->root.library;
+ SFNT_Service sfnt;
+ SFNT_Header sfnt_header;
/* for now, parameters are unused */
FT_UNUSED( num_params );
FT_UNUSED( params );
- sfnt = (SFNT_Interface*)face->sfnt;
+ sfnt = (SFNT_Service)face->sfnt;
if ( !sfnt )
{
- sfnt = (SFNT_Interface*)FT_Get_Module_Interface( library, "sfnt" );
+ sfnt = (SFNT_Service)FT_Get_Module_Interface( library, "sfnt" );
if ( !sfnt )
{
error = SFNT_Err_Invalid_File_Format;
@@ -211,7 +211,7 @@
if ( !face->psnames )
{
- face->psnames = (PSNames_Interface*)
+ face->psnames = (PSNames_Service)
FT_Get_Module_Interface( library, "psnames" );
}
@@ -253,7 +253,7 @@
FT_Bool has_outline;
FT_Bool is_apple_sbit;
- SFNT_Interface* sfnt = (SFNT_Interface*)face->sfnt;
+ SFNT_Service sfnt = (SFNT_Service)face->sfnt;
FT_UNUSED( face_index );
FT_UNUSED( num_params );
@@ -596,7 +596,7 @@
SFNT_Done_Face( TT_Face face )
{
FT_Memory memory = face->root.memory;
- SFNT_Interface* sfnt = (SFNT_Interface*)face->sfnt;
+ SFNT_Service sfnt = (SFNT_Service)face->sfnt;
if ( sfnt )
diff --git a/src/sfnt/ttcmap0.c b/src/sfnt/ttcmap0.c
index d416b1b..2ac62c4 100644
--- a/src/sfnt/ttcmap0.c
+++ b/src/sfnt/ttcmap0.c
@@ -44,6 +44,35 @@
#define TT_NEXT_Long FT_NEXT_LONG_BE
#define TT_NEXT_ULong FT_NEXT_ULONG_BE
+
+ typedef struct TT_CMap_InfoRec_
+ {
+ FT_ByteP base;
+ FT_ByteP limit;
+ FT_ValidationLevel level;
+
+ } TT_CMap_InfoRec, *TT_CMap_Info;
+
+
+ FT_CALLBACK_DEF FT_Error
+ tt_cmap_init( FT_CMap cmap,
+ TT_CMap_Info info )
+ {
+ FT_Error error;
+ TT_CMap_Class clazz = (TT_CMap_Class) FT_CMAP_CLASS(cmap);
+ FT_ValidatorRec valid;
+
+ cmap->data = info->base;
+
+ ft_validator_init( &valid, info->base, info->limit, info->level );
+
+ if ( setjmp( valid->jump_buffer, 0 ) == 0 )
+ clazz->validate( info->base, &valid );
+
+ return valid.error;
+ }
+
+
/************************************************************************/
/************************************************************************/
/***** *****/
@@ -68,7 +97,7 @@
#ifdef TT_CONFIG_CMAP_FORMAT_0
- static void
+ FT_CALLBACK_DEF void
tt_cmap0_validate( FT_Byte* table,
FT_Validator valid )
{
@@ -94,7 +123,7 @@
}
- static FT_UInt
+ FT_CALLBACK_DEF FT_UInt
tt_cmap0_char_index( FT_Byte* table,
FT_ULong char_code )
{
@@ -102,7 +131,7 @@
}
- static FT_ULong
+ FT_CALLBACK_DEF FT_ULong
tt_cmap0_char_next( FT_Byte* table,
FT_ULong char_code,
FT_UInt *agindex )
@@ -127,13 +156,22 @@
return result;
}
- static const TT_Cmap_ClassRec tt_cmap0_class_rec =
+
+ FT_CALLBACK_TABLE const TT_Cmap_ClassRec tt_cmap0_class_rec =
{
- (TT_CMap_ValidateFunc) tt_cmap0_validate,
- (TT_CMap_CharIndexFunc) tt_cmap0_char_index,
- (TT_CMap_CharNextFunc) tt_cmap0_char_next
+ {
+ sizeof( FT_CMapRec ),
+
+ (FT_CMap_InitFunc) tt_cmap_init,
+ (FT_CMap_DoneFunc) NULL,
+ (FT_CMap_CharIndexFunc) tt_cmap0_char_index,
+ (FT_CMap_CharNextFunc) tt_cmap0_char_next
+ },
+ (TT_CMap_ValidateFunc) tt_cmap0_validate
};
+ FT_LOCAL_DEF TT_CMap_Class tt_cmap0_class = &tt_cmap0_class_rec;
+
#endif /* TT_CONFIG_CMAP_FORMAT_0 */
@@ -224,7 +262,7 @@
#ifdef TT_CONFIG_CMAP_FORMAT_2
- static void
+ FT_CALLBACK_DEF void
tt_cmap2_validate( FT_Byte* table,
FT_Validator valid )
{
@@ -362,7 +400,7 @@
}
- static FT_UInt
+ FT_CALLBACK_DEF FT_UInt
tt_cmap2_char_index( FT_Byte* table,
FT_ULong char_code )
{
@@ -398,7 +436,7 @@
- static FT_UInt
+ FT_CALLBACK_DEF FT_UInt
tt_cmap2_char_next( FT_Byte* table,
FT_ULong char_code,
FT_UInt *agindex )
@@ -464,13 +502,21 @@
return result;
}
- static const TT_Cmap_ClassRec tt_cmap2_class_rec =
+ FT_CALLBACK_TABLE const TT_Cmap_ClassRec tt_cmap2_class_rec =
{
- (TT_CMap_ValidateFunc) tt_cmap2_validate,
- (TT_CMap_CharIndexFunc) tt_cmap2_char_index,
- (TT_CMap_CharNextFunc) tt_cmap2_char_next
+ {
+ sizeof( FT_CMapRec ),
+
+ (FT_CMap_InitFunc) tt_cmap_init,
+ (FT_CMap_DoneFunc) NULL,
+ (FT_CMap_CharIndexFunc) tt_cmap2_char_index,
+ (FT_CMap_CharNextFunc) tt_cmap2_char_next
+ },
+ (TT_CMap_ValidateFunc) tt_cmap2_validate
};
+ FT_LOCAL_DEF TT_CMap_Class tt_cmap2_class = &tt_cmap2_class_rec;
+
#endif /* TT_CONFIG_CMAP_FORMAT_2 */
@@ -536,7 +582,7 @@
#ifdef TT_CONFIG_CMAP_FORMAT_4
- static void
+ FT_CALLBACK_DEF void
tt_cmap4_validate( FT_Byte* table,
FT_Validator valid )
{
@@ -653,7 +699,7 @@
- static FT_UInt
+ FT_CALLBACK_DEF FT_UInt
tt_cmap4_char_index( FT_Byte* table,
FT_ULong char_code )
{
@@ -703,7 +749,7 @@
- static FT_ULong
+ FT_CALLBACK_DEF FT_ULong
tt_cmap4_char_next( FT_Byte* table,
FT_ULong char_code,
FT_UInt *agindex )
@@ -784,13 +830,21 @@
return result;
}
- static const TT_Cmap_ClassRec tt_cmap4_class_rec =
+ FT_CALLBACK_TABLE const TT_Cmap_ClassRec tt_cmap4_class_rec =
{
- (TT_CMap_ValidateFunc) tt_cmap4_validate,
- (TT_CMap_CharIndexFunc) tt_cmap4_char_index,
- (TT_CMap_CharNextFunc) tt_cmap4_char_next
+ {
+ sizeof( FT_CMapRec ),
+
+ (FT_CMap_InitFunc) tt_cmap_init,
+ (FT_CMap_DoneFunc) NULL,
+ (FT_CMap_CharIndexFunc) tt_cmap4_char_index,
+ (FT_CMap_CharNextFunc) tt_cmap4_char_next
+ },
+ (TT_CMap_ValidateFunc) tt_cmap4_validate
};
+ FT_LOCAL_DEF TT_CMap_Class tt_cmap4_class = &tt_cmap4_class_rec;
+
#endif /* TT_CONFIG_CMAP_FORMAT_4 */
/************************************************************************/
@@ -822,7 +876,7 @@
#ifdef TT_CONFIG_CMAP_FORMAT_6
- static void
+ FT_CALLBACK_DEF void
tt_cmap6_validate( FT_Byte* table,
FT_Validator valid )
{
@@ -857,7 +911,7 @@
}
- static FT_UInt
+ FT_CALLBACK_DEF FT_UInt
tt_cmap6_char_index( FT_Byte* table,
FT_ULong char_code )
{
@@ -876,7 +930,7 @@
}
- static FT_ULong
+ FT_CALLBACK_DEF FT_ULong
tt_cmap6_char_next( FT_Byte* table,
FT_ULong char_code,
FT_UInt *agindex )
@@ -916,13 +970,22 @@
return result;
}
- static const TT_Cmap_ClassRec tt_cmap6_class_rec =
+
+ FT_CALLBACK_TABLE const TT_Cmap_ClassRec tt_cmap6_class_rec =
{
- (TT_CMap_ValidateFunc) tt_cmap6_validate,
- (TT_CMap_CharIndexFunc) tt_cmap6_char_index,
- (TT_CMap_CharNextFunc) tt_cmap6_char_next
+ {
+ sizeof( FT_CMapRec ),
+
+ (FT_CMap_InitFunc) tt_cmap_init,
+ (FT_CMap_DoneFunc) NULL,
+ (FT_CMap_CharIndexFunc) tt_cmap6_char_index,
+ (FT_CMap_CharNextFunc) tt_cmap6_char_next
+ },
+ (TT_CMap_ValidateFunc) tt_cmap6_validate
};
+ FT_LOCAL_DEF TT_CMap_Class tt_cmap6_class = &tt_cmap6_class_rec;
+
#endif /* TT_CONFIG_CMAP_FORMAT_6 */
@@ -985,7 +1048,7 @@
#ifdef TT_CONFIG_CMAP_FORMAT_8
- static void
+ FT_CALLBACK_DEF void
tt_cmap8_validate( FT_Byte* table,
FT_Validator valid )
{
@@ -1075,7 +1138,7 @@
}
- static FT_UInt
+ FT_CALLBACK_DEF FT_UInt
tt_cmap8_char_index( FT_Byte* table,
FT_ULong char_code )
{
@@ -1103,7 +1166,7 @@
}
- static FT_ULong
+ FT_CALLBACK_DEF FT_ULong
tt_cmap8_char_next( FT_Byte* table,
FT_ULong char_code,
FT_UInt *agindex )
@@ -1145,13 +1208,21 @@
}
- static const TT_Cmap_ClassRec tt_cmap8_class_rec =
+ FT_CALLBACK_TABLE const TT_Cmap_ClassRec tt_cmap8_class_rec =
{
- (TT_CMap_ValidateFunc) tt_cmap8_validate,
- (TT_CMap_CharIndexFunc) tt_cmap8_char_index,
- (TT_CMap_CharNextFunc) tt_cmap8_char_next
+ {
+ sizeof( FT_CMapRec ),
+
+ (FT_CMap_InitFunc) tt_cmap_init,
+ (FT_CMap_DoneFunc) NULL,
+ (FT_CMap_CharIndexFunc) tt_cmap8_char_index,
+ (FT_CMap_CharNextFunc) tt_cmap8_char_next
+ },
+ (TT_CMap_ValidateFunc) tt_cmap8_validate
};
+ FT_LOCAL_DEF TT_CMap_Class tt_cmap8_class = &tt_cmap8_class_rec;
+
#endif /* TT_CONFIG_CMAP_FORMAT_8 */
/************************************************************************/
@@ -1181,7 +1252,7 @@
#ifdef TT_CONFIG_CMAP_FORMAT_10
- static void
+ FT_CALLBACK_DEF void
tt_cmap10_validate( FT_Byte* table,
FT_Validator valid )
{
@@ -1214,7 +1285,7 @@
}
- static FT_UInt
+ FT_CALLBACK_DEF FT_UInt
tt_cmap10_char_index( FT_Byte* table,
FT_ULong char_code )
{
@@ -1233,7 +1304,7 @@
}
- static FT_ULong
+ FT_CALLBACK_DEF FT_ULong
tt_cmap10_char_next( FT_Byte* table,
FT_ULong char_code,
FT_UInt *agindex )
@@ -1270,13 +1341,22 @@
return result;
}
- static const TT_Cmap_ClassRec tt_cmap10_class_rec =
+
+ FT_CALLBACK_TABLE const TT_Cmap_ClassRec tt_cmap10_class_rec =
{
- (TT_CMap_ValidateFunc) tt_cmap10_validate,
- (TT_CMap_CharIndexFunc) tt_cmap10_char_index,
- (TT_CMap_CharNextFunc) tt_cmap10_char_next
+ {
+ sizeof( FT_CMapRec ),
+
+ (FT_CMap_InitFunc) tt_cmap_init,
+ (FT_CMap_DoneFunc) NULL,
+ (FT_CMap_CharIndexFunc) tt_cmap10_char_index,
+ (FT_CMap_CharNextFunc) tt_cmap10_char_next
+ },
+ (TT_CMap_ValidateFunc) tt_cmap10_validate
};
+ FT_LOCAL_DEF TT_CMap_Class tt_cmap10_class = &tt_cmap10_class_rec;
+
#endif /* TT_CONFIG_CMAP_FORMAT_10 */
@@ -1312,7 +1392,7 @@
#ifdef TT_CONFIG_CMAP_FORMAT_12
- static void
+ FT_CALLBACK_DEF void
tt_cmap12_validate( FT_Byte* table,
FT_Validator valid )
{
@@ -1364,7 +1444,7 @@
- static FT_UInt
+ FT_CALLBACK_DEF FT_UInt
tt_cmap12_char_index( FT_Byte* table,
FT_ULong char_code )
{
@@ -1392,7 +1472,7 @@
}
- static FT_ULong
+ FT_CALLBACK_DEF FT_ULong
tt_cmap12_char_next( FT_Byte* table,
FT_ULong char_code,
FT_UInt *agindex )
@@ -1434,13 +1514,21 @@
}
- static const TT_Cmap_ClassRec tt_cmap12_class_rec =
+ FT_CALLBACK_TABLE const TT_Cmap_ClassRec tt_cmap12_class_rec =
{
- (TT_CMap_ValidateFunc) tt_cmap12_validate,
- (TT_CMap_CharIndexFunc) tt_cmap12_char_index,
- (TT_CMap_CharNextFunc) tt_cmap12_char_next
+ {
+ sizeof( FT_CMapRec ),
+
+ (FT_CMap_InitFunc) tt_cmap_init,
+ (FT_CMap_DoneFunc) NULL,
+ (FT_CMap_CharIndexFunc) tt_cmap12_char_index,
+ (FT_CMap_CharNextFunc) tt_cmap12_char_next
+ },
+ (TT_CMap_ValidateFunc) tt_cmap12_validate
};
+ FT_LOCAL_DEF TT_CMap_Class tt_cmap12_class = &tt_cmap12_class_rec;
+
#endif /* TT_CONFIG_CMAP_FORMAT_12 */
/* END */
diff --git a/src/sfnt/ttpost.c b/src/sfnt/ttpost.c
index c228706..6942ff4 100644
--- a/src/sfnt/ttpost.c
+++ b/src/sfnt/ttpost.c
@@ -450,7 +450,7 @@
TT_Post_Names* names;
#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
- PSNames_Interface* psnames;
+ PSNames_Service psnames;
#endif
@@ -461,7 +461,7 @@
return SFNT_Err_Invalid_Glyph_Index;
#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
- psnames = (PSNames_Interface*)face->psnames;
+ psnames = (PSNames_Service)face->psnames;
if ( !psnames )
return SFNT_Err_Unimplemented_Feature;
#endif
diff --git a/src/truetype/ttdriver.c b/src/truetype/ttdriver.c
index 5df3e31..dba942e 100644
--- a/src/truetype/ttdriver.c
+++ b/src/truetype/ttdriver.c
@@ -376,7 +376,7 @@
/* Load table if needed */
if ( !cmap->loaded )
{
- SFNT_Interface* sfnt = (SFNT_Interface*)face->sfnt;
+ SFNT_Service sfnt = (SFNT_Service)face->sfnt;
error = sfnt->load_charmap( face, cmap, face->root.stream );
@@ -423,7 +423,7 @@
/* Load table if needed */
if ( !cmap->loaded )
{
- SFNT_Interface* sfnt = (SFNT_Interface*)face->sfnt;
+ SFNT_Service sfnt = (SFNT_Service)face->sfnt;
error = sfnt->load_charmap( face, cmap, face->root.stream );
@@ -459,13 +459,13 @@
{
FT_Module sfntd = FT_Get_Module( driver->root.root.library,
"sfnt" );
- SFNT_Interface* sfnt;
+ SFNT_Service sfnt;
/* only return the default interface from the SFNT module */
if ( sfntd )
{
- sfnt = (SFNT_Interface*)( sfntd->clazz->module_interface );
+ sfnt = (SFNT_Service)( sfntd->clazz->module_interface );
if ( sfnt )
return sfnt->get_interface( FT_MODULE( driver ), interface );
}
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index 7053caa..32c5a35 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -1422,7 +1422,7 @@
FT_UShort glyph_index,
FT_UInt load_flags )
{
- SFNT_Interface* sfnt;
+ SFNT_Service sfnt;
TT_Face face;
FT_Stream stream;
FT_Error error;
@@ -1430,7 +1430,7 @@
face = (TT_Face)glyph->face;
- sfnt = (SFNT_Interface*)face->sfnt;
+ sfnt = (SFNT_Service)face->sfnt;
stream = face->root.stream;
error = 0;
diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c
index 7fee693..6e0663d 100644
--- a/src/truetype/ttobjs.c
+++ b/src/truetype/ttobjs.c
@@ -162,11 +162,11 @@
{
FT_Error error;
FT_Library library;
- SFNT_Interface* sfnt;
+ SFNT_Service sfnt;
library = face->root.driver->root.library;
- sfnt = (SFNT_Interface*)FT_Get_Module_Interface( library, "sfnt" );
+ sfnt = (SFNT_Service)FT_Get_Module_Interface( library, "sfnt" );
if ( !sfnt )
goto Bad_Format;
@@ -230,7 +230,7 @@
FT_Memory memory = face->root.memory;
FT_Stream stream = face->root.stream;
- SFNT_Interface* sfnt = (SFNT_Interface*)face->sfnt;
+ SFNT_Service sfnt = (SFNT_Service)face->sfnt;
/* for `extended TrueType formats' (i.e. compressed versions) */
@@ -679,7 +679,7 @@
FT_ULong strike_index;
FT_Size_Metrics* metrics;
FT_Size_Metrics* sbit_metrics;
- SFNT_Interface* sfnt;
+ SFNT_Service sfnt;
metrics = &size->root.metrics;
@@ -688,7 +688,7 @@
return TT_Err_Ok;
face = (TT_Face)size->root.face;
- sfnt = (SFNT_Interface*)face->sfnt;
+ sfnt = (SFNT_Service)face->sfnt;
sbit_metrics = &size->strike_metrics;
diff --git a/src/type1/t1cmap.c b/src/type1/t1cmap.c
index cd956f4..e511575 100644
--- a/src/type1/t1cmap.c
+++ b/src/type1/t1cmap.c
@@ -13,7 +13,7 @@
FT_Int is_expert )
{
T1_Face face = (T1_Face) FT_CMAP_FACE(cmap);
- PSNames_Interface* psnames = face->psnames;
+ PSNames_Service psnames = face->psnames;
cmap->num_glyphs = face->type1.num_glyphs;
cmap->glyph_names = face->type1.glyph_names;
diff --git a/src/type1/t1driver.c b/src/type1/t1driver.c
index 0e9c3b8..b3760c6 100644
--- a/src/type1/t1driver.c
+++ b/src/type1/t1driver.c
@@ -250,11 +250,11 @@
{
T1_Face face;
FT_UInt result = 0;
- PSNames_Interface* psnames;
+ PSNames_Service psnames;
face = (T1_Face)charmap->face;
- psnames = (PSNames_Interface*)face->psnames;
+ psnames = (PSNames_Service)face->psnames;
if ( psnames )
switch ( charmap->encoding )
{
@@ -365,11 +365,11 @@
FT_Long charcode )
{
T1_Face face;
- PSNames_Interface* psnames;
+ PSNames_Service psnames;
face = (T1_Face)charmap->face;
- psnames = (PSNames_Interface*)face->psnames;
+ psnames = (PSNames_Service)face->psnames;
if ( psnames )
switch ( charmap->encoding )
diff --git a/src/type1/t1gload.c b/src/type1/t1gload.c
index 78fa41f..b47e494 100644
--- a/src/type1/t1gload.c
+++ b/src/type1/t1gload.c
@@ -56,7 +56,7 @@
FT_CALLBACK_DEF( FT_Error )
- T1_Parse_Glyph( T1_Decoder* decoder,
+ T1_Parse_Glyph( T1_Decoder decoder,
FT_UInt glyph_index )
{
T1_Face face = (T1_Face)decoder->builder.face;
@@ -78,10 +78,10 @@
FT_Int* max_advance )
{
FT_Error error;
- T1_Decoder decoder;
+ T1_DecoderRec decoder;
FT_Int glyph_index;
T1_Font* type1 = &face->type1;
- PSAux_Interface* psaux = (PSAux_Interface*)face->psaux;
+ PSAux_Service psaux = (PSAux_Service)face->psaux;
*max_advance = 0;
@@ -143,12 +143,12 @@
FT_Int load_flags )
{
FT_Error error;
- T1_Decoder decoder;
+ T1_DecoderRec decoder;
T1_Face face = (T1_Face)glyph->root.face;
FT_Bool hinting;
T1_Font* type1 = &face->type1;
- PSAux_Interface* psaux = (PSAux_Interface*)face->psaux;
- const T1_Decoder_Funcs* decoder_funcs = psaux->t1_decoder_funcs;
+ PSAux_Service psaux = (PSAux_Service)face->psaux;
+ const T1_Decoder_Funcs decoder_funcs = psaux->t1_decoder_funcs;
FT_Matrix font_matrix;
FT_Vector font_offset;
diff --git a/src/type1/t1load.c b/src/type1/t1load.c
index 8b512a5..44fda3b 100644
--- a/src/type1/t1load.c
+++ b/src/type1/t1load.c
@@ -384,11 +384,11 @@
parse_blend_axis_types( T1_Face face,
T1_Loader* loader )
{
- T1_Token axis_tokens[ T1_MAX_MM_AXIS ];
- FT_Int n, num_axis;
- FT_Error error = 0;
- T1_Blend* blend;
- FT_Memory memory;
+ T1_TokenRec axis_tokens[ T1_MAX_MM_AXIS ];
+ FT_Int n, num_axis;
+ FT_Error error = 0;
+ T1_Blend* blend;
+ FT_Memory memory;
/* take an array of objects */
@@ -413,7 +413,7 @@
/* each token is an immediate containing the name of the axis */
for ( n = 0; n < num_axis; n++ )
{
- T1_Token* token = axis_tokens + n;
+ T1_Token token = axis_tokens + n;
FT_Byte* name;
FT_Int len;
@@ -445,10 +445,10 @@
parse_blend_design_positions( T1_Face face,
T1_Loader* loader )
{
- T1_Token design_tokens[ T1_MAX_MM_DESIGNS ];
+ T1_TokenRec design_tokens[ T1_MAX_MM_DESIGNS ];
FT_Int num_designs;
FT_Int num_axis;
- T1_ParserRec* parser = &loader->parser;
+ T1_Parser parser = &loader->parser;
FT_Error error = 0;
T1_Blend* blend;
@@ -476,8 +476,8 @@
for ( n = 0; n < (FT_UInt)num_designs; n++ )
{
- T1_Token axis_tokens[ T1_MAX_MM_DESIGNS ];
- T1_Token* token;
+ T1_TokenRec axis_tokens[ T1_MAX_MM_DESIGNS ];
+ T1_Token token;
FT_Int axis, n_axis;
@@ -505,7 +505,7 @@
/* now, read each axis token into the design position */
for ( axis = 0; axis < n_axis; axis++ )
{
- T1_Token* token2 = axis_tokens + axis;
+ T1_Token token2 = axis_tokens + axis;
parser->root.cursor = token2->start;
@@ -528,9 +528,9 @@
T1_Loader* loader )
{
FT_Error error = 0;
- T1_ParserRec* parser = &loader->parser;
+ T1_Parser parser = &loader->parser;
T1_Blend* blend;
- T1_Token axis_tokens[ T1_MAX_MM_AXIS ];
+ T1_TokenRec axis_tokens[ T1_MAX_MM_AXIS ];
FT_Int n, num_axis;
FT_Byte* old_cursor;
FT_Byte* old_limit;
@@ -557,7 +557,7 @@
for ( n = 0; n < num_axis; n++ )
{
T1_DesignMap* map = blend->design_map + n;
- T1_Token* token;
+ T1_Token token;
FT_Int p, num_points;
@@ -609,9 +609,9 @@
T1_Loader* loader )
{
FT_Error error = 0;
- T1_ParserRec* parser = &loader->parser;
+ T1_Parser parser = &loader->parser;
T1_Blend* blend = face->blend;
- T1_Token master;
+ T1_TokenRec master;
FT_UInt n;
FT_Byte* old_cursor;
FT_Byte* old_limit;
@@ -625,7 +625,7 @@
}
T1_ToToken( parser, &master );
- if ( master.type != t1_token_array )
+ if ( master.type != T1_TOKEN_TYPE_ARRAY )
{
FT_ERROR(( "parse_weight_vector: incorrect format!\n" ));
error = T1_Err_Invalid_File_Format;
@@ -660,7 +660,7 @@
parse_shared_dict( T1_Face face,
T1_Loader* loader )
{
- T1_ParserRec* parser = &loader->parser;
+ T1_Parser parser = &loader->parser;
FT_UNUSED( face );
@@ -684,7 +684,7 @@
/*************************************************************************/
/* */
/* First of all, define the token field static variables. This is a set */
- /* of T1_Field variables used later. */
+ /* of T1_FieldRec variables used later. */
/* */
/*************************************************************************/
@@ -692,7 +692,7 @@
static FT_Error
t1_load_keyword( T1_Face face,
T1_Loader* loader,
- T1_Field* field )
+ T1_Field field )
{
FT_Error error;
void* dummy_object;
@@ -702,7 +702,7 @@
/* if the keyword has a dedicated callback, call it */
- if ( field->type == t1_field_callback )
+ if ( field->type == T1_FIELD_TYPE_CALLBACK )
{
field->reader( (FT_Face)face, loader );
error = loader->parser.root.error;
@@ -743,8 +743,8 @@
max_objects = 0;
}
- if ( field->type == t1_field_integer_array ||
- field->type == t1_field_fixed_array )
+ if ( field->type == T1_FIELD_TYPE_INTEGER_ARRAY ||
+ field->type == T1_FIELD_TYPE_FIXED_ARRAY )
error = T1_Load_Field_Table( &loader->parser, field,
objects, max_objects, 0 );
else
@@ -774,7 +774,7 @@
static int
- read_binary_data( T1_ParserRec* parser,
+ read_binary_data( T1_Parser parser,
FT_Int* size,
FT_Byte** base )
{
@@ -819,7 +819,7 @@
parse_font_name( T1_Face face,
T1_Loader* loader )
{
- T1_ParserRec* parser = &loader->parser;
+ T1_Parser parser = &loader->parser;
FT_Error error;
FT_Memory memory = parser->root.memory;
FT_Int len;
@@ -865,7 +865,7 @@
parse_font_bbox( T1_Face face,
T1_Loader* loader )
{
- T1_ParserRec* parser = &loader->parser;
+ T1_Parser parser = &loader->parser;
FT_Fixed temp[4];
FT_BBox* bbox = &face->type1.font_bbox;
@@ -882,7 +882,7 @@
parse_font_matrix( T1_Face face,
T1_Loader* loader )
{
- T1_ParserRec* parser = &loader->parser;
+ T1_Parser parser = &loader->parser;
FT_Matrix* matrix = &face->type1.font_matrix;
FT_Vector* offset = &face->type1.font_offset;
FT_Face root = (FT_Face)&face->root;
@@ -931,11 +931,11 @@
parse_encoding( T1_Face face,
T1_Loader* loader )
{
- T1_ParserRec* parser = &loader->parser;
+ T1_Parser parser = &loader->parser;
FT_Byte* cur = parser->root.cursor;
FT_Byte* limit = parser->root.limit;
- PSAux_Interface* psaux = (PSAux_Interface*)face->psaux;
+ PSAux_Service psaux = (PSAux_Service)face->psaux;
/* skip whitespace */
@@ -956,7 +956,7 @@
{
T1_Encoding* encode = &face->type1.encoding;
FT_Int count, n;
- PS_Table* char_table = &loader->encoding_table;
+ PS_Table char_table = &loader->encoding_table;
FT_Memory memory = parser->root.memory;
FT_Error error;
@@ -1099,13 +1099,13 @@
parse_subrs( T1_Face face,
T1_Loader* loader )
{
- T1_ParserRec* parser = &loader->parser;
- PS_Table* table = &loader->subrs;
+ T1_Parser parser = &loader->parser;
+ PS_Table table = &loader->subrs;
FT_Memory memory = parser->root.memory;
FT_Error error;
FT_Int n;
- PSAux_Interface* psaux = (PSAux_Interface*)face->psaux;
+ PSAux_Service psaux = (PSAux_Service)face->psaux;
if ( loader->num_subrs )
@@ -1197,14 +1197,14 @@
parse_charstrings( T1_Face face,
T1_Loader* loader )
{
- T1_ParserRec* parser = &loader->parser;
- PS_Table* code_table = &loader->charstrings;
- PS_Table* name_table = &loader->glyph_names;
- PS_Table* swap_table = &loader->swap_table;
+ T1_Parser parser = &loader->parser;
+ PS_Table code_table = &loader->charstrings;
+ PS_Table name_table = &loader->glyph_names;
+ PS_Table swap_table = &loader->swap_table;
FT_Memory memory = parser->root.memory;
FT_Error error;
- PSAux_Interface* psaux = (PSAux_Interface*)face->psaux;
+ PSAux_Service psaux = (PSAux_Service)face->psaux;
FT_Byte* cur;
FT_Byte* limit = parser->root.limit;
@@ -1457,7 +1457,7 @@
static
- const T1_Field t1_keywords[] =
+ const T1_FieldRec t1_keywords[] =
{
#include "t1tokens.h"
@@ -1478,7 +1478,7 @@
T1_FIELD_CALLBACK( "shareddict", parse_shared_dict )
#endif
- { 0, t1_field_cid_info, t1_field_none, 0, 0, 0, 0, 0 }
+ { 0, t1_field_cid_info, T1_FIELD_TYPE_NONE, 0, 0, 0, 0, 0 }
};
@@ -1488,7 +1488,7 @@
FT_Byte* base,
FT_Long size )
{
- T1_ParserRec* parser = &loader->parser;
+ T1_Parser parser = &loader->parser;
parser->root.cursor = base;
@@ -1520,7 +1520,7 @@
if ( cur < limit )
{
- T1_Token token;
+ T1_TokenRec token;
/* skip the `known' keyword and the token following it */
@@ -1529,7 +1529,7 @@
T1_ToToken( &loader->parser, &token );
/* if the last token was an array, skip it! */
- if ( token.type == t1_token_array )
+ if ( token.type == T1_TOKEN_TYPE_ARRAY )
cur2 = parser->root.cursor;
}
cur = cur2;
@@ -1551,7 +1551,7 @@
{
{
/* now, compare the immediate name to the keyword table */
- T1_Field* keyword = (T1_Field*)t1_keywords;
+ T1_Field keyword = (T1_Field)t1_keywords;
for (;;)
@@ -1622,7 +1622,7 @@
static void
t1_done_loader( T1_Loader* loader )
{
- T1_ParserRec* parser = &loader->parser;
+ T1_Parser parser = &loader->parser;
/* finalize tables */
@@ -1640,12 +1640,12 @@
FT_LOCAL_DEF FT_Error
T1_Open_Face( T1_Face face )
{
- T1_Loader loader;
- T1_ParserRec* parser;
- T1_Font* type1 = &face->type1;
- FT_Error error;
+ T1_Loader loader;
+ T1_Parser parser;
+ T1_Font* type1 = &face->type1;
+ FT_Error error;
- PSAux_Interface* psaux = (PSAux_Interface*)face->psaux;
+ PSAux_Service psaux = (PSAux_Service)face->psaux;
t1_init_loader( &loader, face );
diff --git a/src/type1/t1load.h b/src/type1/t1load.h
index 23082bc..815f634 100644
--- a/src/type1/t1load.h
+++ b/src/type1/t1load.h
@@ -36,16 +36,16 @@ FT_BEGIN_HEADER
T1_ParserRec parser; /* parser used to read the stream */
FT_Int num_chars; /* number of characters in encoding */
- PS_Table encoding_table; /* PS_Table used to store the */
+ PS_TableRec encoding_table; /* PS_Table used to store the */
/* encoding character names */
FT_Int num_glyphs;
- PS_Table glyph_names;
- PS_Table charstrings;
- PS_Table swap_table; /* For moving .notdef glyph to index 0. */
+ PS_TableRec glyph_names;
+ PS_TableRec charstrings;
+ PS_TableRec swap_table; /* For moving .notdef glyph to index 0. */
FT_Int num_subrs;
- PS_Table subrs;
+ PS_TableRec subrs;
FT_Bool fontdata;
} T1_Loader;
diff --git a/src/type1/t1objs.c b/src/type1/t1objs.c
index 172ee51..67caad1 100644
--- a/src/type1/t1objs.c
+++ b/src/type1/t1objs.c
@@ -59,7 +59,7 @@
T1_Size_Get_Globals_Funcs( T1_Size size )
{
T1_Face face = (T1_Face) size->root.face;
- PSHinter_Interface* pshinter = face->pshinter;
+ PSHinter_Service pshinter = face->pshinter;
FT_Module module;
@@ -144,7 +144,7 @@
T1_GlyphSlot_Init( T1_GlyphSlot slot )
{
T1_Face face;
- PSHinter_Interface* pshinter;
+ PSHinter_Service pshinter;
face = (T1_Face) slot->root.face;
pshinter = face->pshinter;
@@ -275,9 +275,9 @@
FT_Parameter* params )
{
FT_Error error;
- PSNames_Interface* psnames;
- PSAux_Interface* psaux;
- PSHinter_Interface* pshinter;
+ PSNames_Service psnames;
+ PSAux_Service psaux;
+ PSHinter_Service pshinter;
FT_UNUSED( num_params );
FT_UNUSED( params );
@@ -287,28 +287,28 @@
face->root.num_faces = 1;
- psnames = (PSNames_Interface*)face->psnames;
+ psnames = (PSNames_Service)face->psnames;
if ( !psnames )
{
- psnames = (PSNames_Interface*)
+ psnames = (PSNames_Service)
FT_Get_Module_Interface( FT_FACE_LIBRARY( face ), "psnames" );
face->psnames = psnames;
}
- psaux = (PSAux_Interface*)face->psaux;
+ psaux = (PSAux_Service)face->psaux;
if ( !psaux )
{
- psaux = (PSAux_Interface*)
+ psaux = (PSAux_Service)
FT_Get_Module_Interface( FT_FACE_LIBRARY( face ), "psaux" );
face->psaux = psaux;
}
- pshinter = (PSHinter_Interface*)face->pshinter;
+ pshinter = (PSHinter_Service)face->pshinter;
if ( !pshinter )
{
- pshinter = (PSHinter_Interface*)
+ pshinter = (PSHinter_Service)
FT_Get_Module_Interface( FT_FACE_LIBRARY( face ), "pshinter" );
face->pshinter = pshinter;
diff --git a/src/type1/t1parse.c b/src/type1/t1parse.c
index 7faab53..e3ae476 100644
--- a/src/type1/t1parse.c
+++ b/src/type1/t1parse.c
@@ -119,17 +119,17 @@
FT_LOCAL_DEF FT_Error
- T1_New_Parser( T1_ParserRec* parser,
- FT_Stream stream,
- FT_Memory memory,
- PSAux_Interface* psaux )
+ T1_New_Parser( T1_Parser parser,
+ FT_Stream stream,
+ FT_Memory memory,
+ PSAux_Service psaux )
{
FT_Error error;
FT_UShort tag;
FT_Long size;
- psaux->t1_parser_funcs->init( &parser->root,0, 0, memory );
+ psaux->ps_parser_funcs->init( &parser->root,0, 0, memory );
parser->stream = stream;
parser->base_len = 0;
@@ -228,7 +228,7 @@
FT_LOCAL_DEF void
- T1_Finalize_Parser( T1_ParserRec* parser )
+ T1_Finalize_Parser( T1_Parser parser )
{
FT_Memory memory = parser->root.memory;
@@ -268,8 +268,8 @@
FT_LOCAL_DEF FT_Error
- T1_Get_Private_Dict( T1_ParserRec* parser,
- PSAux_Interface* psaux )
+ T1_Get_Private_Dict( T1_Parser parser,
+ PSAux_Service psaux )
{
FT_Stream stream = parser->stream;
FT_Memory memory = parser->root.memory;
@@ -449,7 +449,7 @@
/* we now decrypt the encoded binary private dictionary */
psaux->t1_decrypt( parser->private_dict, parser->private_len, 55665U );
- parser->root.base = parser->private_dict;
+ parser->root.base = parser->private_dict;
parser->root.cursor = parser->private_dict;
parser->root.limit = parser->root.cursor + parser->private_len;
diff --git a/src/type1/t1parse.h b/src/type1/t1parse.h
index 51be1b6..4f6c81e 100644
--- a/src/type1/t1parse.h
+++ b/src/type1/t1parse.h
@@ -34,7 +34,7 @@ FT_BEGIN_HEADER
/* T1_ParserRec */
/* */
/* <Description> */
- /* A T1_ParserRec is an object used to parse a Type 1 fonts very */
+ /* A PS_ParserRec is an object used to parse a Type 1 fonts very */
/* quickly. */
/* */
/* <Fields> */
@@ -60,20 +60,20 @@ FT_BEGIN_HEADER
/* */
typedef struct T1_ParserRec_
{
- T1_Parser root;
- FT_Stream stream;
+ PS_ParserRec root;
+ FT_Stream stream;
- FT_Byte* base_dict;
- FT_Int base_len;
+ FT_Byte* base_dict;
+ FT_Int base_len;
- FT_Byte* private_dict;
- FT_Int private_len;
+ FT_Byte* private_dict;
+ FT_Int private_len;
- FT_Byte in_pfb;
- FT_Byte in_memory;
- FT_Byte single_block;
+ FT_Byte in_pfb;
+ FT_Byte in_memory;
+ FT_Byte single_block;
- } T1_ParserRec;
+ } T1_ParserRec, *T1_Parser;
#define T1_Add_Table( p, i, o, l ) (p)->funcs.add( (p), i, o, l )
@@ -108,22 +108,23 @@ FT_BEGIN_HEADER
#define T1_Load_Field( p, f, o, m, pf ) \
(p)->root.funcs.load_field( &(p)->root, f, o, m, pf )
+
#define T1_Load_Field_Table( p, f, o, m, pf ) \
(p)->root.funcs.load_field_table( &(p)->root, f, o, m, pf )
FT_LOCAL FT_Error
- T1_New_Parser( T1_ParserRec* parser,
- FT_Stream stream,
- FT_Memory memory,
- PSAux_Interface* psaux );
+ T1_New_Parser( T1_Parser parser,
+ FT_Stream stream,
+ FT_Memory memory,
+ PSAux_Service psaux );
FT_LOCAL FT_Error
- T1_Get_Private_Dict( T1_ParserRec* parser,
- PSAux_Interface* psaux );
+ T1_Get_Private_Dict( T1_Parser parser,
+ PSAux_Service psaux );
FT_LOCAL void
- T1_Finalize_Parser( T1_ParserRec* parser );
+ T1_Finalize_Parser( T1_Parser parser );
FT_END_HEADER
diff --git a/src/type1/t1tokens.h b/src/type1/t1tokens.h
index f0a0c5d..0fd638b 100644
--- a/src/type1/t1tokens.h
+++ b/src/type1/t1tokens.h
@@ -28,7 +28,7 @@
T1_FIELD_STRING( "Weight", weight )
T1_FIELD_NUM ( "ItalicAngle", italic_angle )
- T1_FIELD_BOOL ( "isFixedPitch", is_fixed_pitch )
+ T1_FIELD_TYPE_BOOL ( "isFixedPitch", is_fixed_pitch )
T1_FIELD_NUM ( "UnderlinePosition", underline_position )
T1_FIELD_NUM ( "UnderlineThickness", underline_thickness )