/usr/share/doc/xgridfit/html/reference.html is in xgridfit-doc 2.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Xgridfit</title>
<link rel="stylesheet" href="oeg.css" media="screen" type="text/css" />
<link rel="stylesheet" href="parchment.css" media="screen"
type="text/css" title="parchment" />
<link rel="alternate stylesheet" href="legible.css" media="screen"
type="text/css" title="legible" />
<style type="text/css" media="print"> @import "oeg.print.css"; </style>
<meta name="AUTHOR" content="Peter S. Baker" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<div id="jumplist">
<a href="http://sourceforge.net"><img
src=""
width="125" height="37" border="0" alt="SourceForge.net Logo" /></a>
<a href="http://Xgridfit.sourceforge.net/">Home Page</a>
<a href="http://sourceforge.net/projects/Xgridfit">Project Page</a>
<a href="http://sourceforge.net/project/showfiles.php?group_id=159705">Download</a>
<a href="http://xgridfit.cvs.sourceforge.net/xgridfit/xgridfit/">CVS repository</a>
<hr/>
<a href="#absolute"><absolute></a>
<a href="#add"><add></a>
<a href="#alias"><alias></a>
<a href="#align"><align></a>
<a href="#align-midway"><align-midway></a>
<a href="#call-function"><call-function></a>
<a href="#call-glyph"><call-glyph></a>
<a href="#call-macro"><call-macro></a>
<a href="#call-param"><call-param></a>
<a href="#ceiling"><ceiling></a>
<a href="#command"><command></a>
<a href="#compile-if"><compile-if></a>
<a href="#constant"><constant></a>
<a href="#contour"><contour></a>
<a href="#control-values"><control-value></a>
<a href="#control-value-delta"><control-value-delta></a>
<a href="#control-value-index"><control-value-index></a>
<a href="#default-el"><default></a>
<a href="#delta"><delta></a>
<a href="#delta-set"><delta-set></a>
<a href="#diagonal-stem"><diagonal-stem></a>
<a href="#disable-instructions"><disable-instructions></a>
<a href="#divide"><divide></a>
<a href="#else-el"><else></a>
<a href="#enable-instructions"><enable-instructions></a>
<a href="#entry"><entry></a>
<a href="#flip-on"><flip-off></a>
<a href="#flip-on"><flip-on></a>
<a href="#floor"><floor></a>
<a href="#formula"><formula></a>
<a href="#functions"><function></a>
<a href="#get-coordinate"><get-coordinate></a>
<a href="#getinfo"><getinfo></a>
<a href="#glyph"><glyph></a>
<a href="#glyph-select"><glyph-select></a>
<a href="#if-el"><if></a>
<a href="#infile"><infile></a>
<a href="#interpolate"><interpolate></a>
<a href="#interpolate-untouched-points"><interpolate-untouched-points></a>
<a href="#legacy-functions"><legacy-functions></a>
<a href="#line"><line></a>
<a href="#macros"><macro></a>
<a href="#maximum"><maximum></a>
<a href="#mdap"><mdap></a>
<a href="#mdrp"><mdrp></a>
<a href="#measure-distance"><measure-distance></a>
<a href="#message"><message></a>
<a href="#miap"><miap></a>
<a href="#minimum"><minimum></a>
<a href="#mirp"><mirp></a>
<a href="#modifier"><modifier></a>
<a href="#move"><move></a>
<a href="#move-point-to-intersection"><move-point-to-intersection></a>
<a href="#multiply"><multiply></a>
<a href="#negate"><negate></a>
<a href="#no-compile"><no-compile></a>
<a href="#no-round"><no-round></a>
<a href="#no-warning"><no-warning></a>
<a href="#outfile"><outfile></a>
<a href="#outfile-base"><outfile-base></a>
<a href="#outfile-script-name"><outfile-script-name></a>
<a href="#params"><param></a>
<a href="#param-set"><param-set></a>
<a href="#point"><point></a>
<a href="#pre-program"><pre-program></a>
<a href="#ps-private"><ps-private></a>
<a href="#push"><push></a>
<a href="#range"><range></a>
<a href="#restore-default"><restore-default></a>
<a href="#reference"><reference></a>
<a href="#round"><round></a>
<a href="#round-state"><round-state></a>
<a href="#set"><set></a>
<a href="#set-auto-flip"><set-auto-flip></a>
<a href="#set-control-value"><set-control-value></a>
<a href="#set-control-value-cut-in"><set-control-value-cut-in></a>
<a href="#set-coordinate"><set-coordinate></a>
<a href="#set-delta-base"><set-delta-base></a>
<a href="#set-delta-shift"><set-delta-shift></a>
<a href="#set-dropout-control"><set-dropout-control></a>
<a href="#set-dropout-type"><set-dropout-type></a>
<a href="#set-dual-projection-vector"><set-dual-projection-vector></a>
<a href="#set-equal"><set-equal></a>
<a href="#set-freedom-vector"><set-freedom-vector></a>
<a href="#set-minimum-distance"><set-minimum-distance></a>
<a href="#set-projection-vector"><set-projection-vector></a>
<a href="#set-round-state"><set-round-state></a>
<a href="#set-single-width"><set-single-width></a>
<a href="#set-single-width-cut-in"><set-single-width-cut-in></a>
<a href="#set-vectors"><set-vectors></a>
<a href="#shift"><shift></a>
<a href="#shift-absolute"><shift-absolute></a>
<a href="#srp"><srp></a>
<a href="#store-projection-vector"><store-freedom-vector></a>
<a href="#store-projection-vector"><store-projection-vector></a>
<a href="#subtract"><subtract></a>
<a href="#szp"><szp></a>
<a href="#toggle-points"><toggle-points></a>
<a href="#to-stack"><to-stack></a>
<a href="#untouch"><untouch></a>
<a href="#variables"><variable></a>
<a href="#function-variant"><variant></a>
<a href="#set-control-value"><with-control-value></a>
<a href="#set-control-value-cut-in"><with-control-value-cut-in></a>
<a href="#set-delta-base"><with-delta-base></a>
<a href="#set-delta-shift"><with-delta-shift></a>
<a href="#set-freedom-vector"><with-freedom-vector></a>
<a href="#set-minimum-distance"><with-minimum-distance></a>
<a href="#with-param"><with-param></a>
<a href="#set-projection-vector"><with-projection-vector></a>
<a href="#set-round-state"><with-round-state></a>
<a href="#set-single-width"><with-single-width></a>
<a href="#set-single-width-cut-in"><with-single-width-cut-in></a>
<a href="#set-vectors"><with-vectors></a>
<a href="#xgridfit-el"><xgridfit></a>
<a href="#zone"><zone></a>
</div>
<div id="content">
<h1>Element Reference</h1>
<h2 id="absolute"><absolute></h2>
<p>
Converts negative to positive numbers; positive numbers stay
positive.
</p>
<pre>
<absolute value="line-width" result-to="lw"/></pre>
<h3>Content</h3>
<p>None.</p>
<h3>Attributes</h3>
<dl>
<dt>value</dt>
<dd>
Required, except when <absolute> is the child of a
<formula>. Any value or expression. The value to operate on.
</dd>
<dt>result-to</dt>
<dd>
Optional; not allowed when <absolute> is the child of
a <formula>. The name of a variable or control value
in which to store the result. If <tt>result-to</tt> is
omitted where allowed and <tt>value</tt> is a variable or
control value, the result is written to <tt>value</tt>. If
<tt>value</tt> cannot be written to, the compiler issues a
warning and the result is left on the stack.
</dd>
</dl>
<h2 id="add"><add></h2>
<p>
Adds two numbers together.
</p>
<pre>
<add value1="line-width" value2="1p"/></pre>
<h3>Content</h3>
<p>None.</p>
<h3>Attributes</h3>
<dl>
<dt>value1, value2</dt>
<dd>
Required, except when <add> is the child of a
<formula>. Any value or expression. These are the values to
add together.
</dd>
<dt>result-to</dt>
<dd>
Optional; not allowed when <add> is the child of a
<formula>. If <tt>result-to</tt> is omitted where
allowed, Xgridfit attempts to write the result to
<tt>value1</tt>. If <tt>value1</tt> cannot be written to,
the compiler issues a warning and the result is left on the
stack.
</dd>
</dl>
<h2 id="alias"><alias></h2>
<p>
Provides access to a value under some other name. The value
can be a control-value, constant, variable, or any value that
can be resolved to a number either at compile time or run
time. The <alias> element can appear at the top level of
a program (as a child of <xgridfit>), or along with
other declarations at the beginning of <glyph>,
<function>, <macro> or <pre-program>
elements. An alias takes precedence over all other elements,
so in the case of name collisions the alias is always
used. Here is a simple example:
</p>
<pre>
<control-value name="lc-vert-stroke" value="0"/>
<alias name="lc-vert-stem" target="lc-vert-stroke"/></pre>
<p>
Now a <move> element with attribute
<tt>distance="lc-vert-stem"</tt> will use the control-value
named <tt>lc-vert-stroke</tt>. If another control-value is
named <tt>lc-vert-stem</tt> it will be invisible. If you want
the alias to be used in just one glyph program, declare it as
a child of <glyph> rather than as a child of
<xgridfit>.
</p>
<h3>Content</h3>
<p>None.</p>
<h3>Attributes</h3>
<dl>
<dt>name</dt>
<dd>
Required. A name: any sequence of letters, numbers, hyphens,
periods; no spaces permitted. This is the name under which
the program may now access the value.
</dd>
<dt>target</dt>
<dd>
Required. A name: any sequence of letters, numbers, hyphens,
periods; no spaces permitted. The name of the value which is
being renamed.
</dd>
</dl>
<h2 id="align"><align></h2>
<p>
Moves one or more points along the freedom vector until
aligned with a reference point. Points are "aligned" when
their distance from each other, measured along the projection
vector, is zero. When the projection vector is "x," aligned
points end up stacked vertically; when it is "y" they end up
in a horizontal line. When the projection vector is set to a
line, the aligned points end up arrayed along an imaginary
line orthogonal to the projection vector.
</p>
<p>
The <align> element must contain at least one object to
align. It may contain any number of <point>s,
<range>s and <set>s. An optional
<reference> element contains the point to align with. If
the reference point is omitted, the current setting of RP0 is
used.
</p>
<p>
<align> can and frequently should be nested inside a
<move> element, in which case points are aligned
relative to the point that is the target of the
<move>. In both of the following cases point "m" is
aligned with point "r":
</p>
<pre>
<align>
<reference>
<point num="r"/>
</reference>
<point num="m"/>
</align>
<move>
<point num="r"/>
<align>
<point num="m"/>
</align>
</move></pre>
<h3>Content</h3>
<p>
One or more <point>, <range> and <set>
elements.
</p>
<h3>Attribute</h3>
<dl>
<dt>compile-if</dt>
<dd>
Optional. Any value or expression that can be resolved to a
number at compile time. If true (non-zero), the
<align> element is compiled; otherwise the compiler
passes it over.
</dd>
</dl>
<h2 id="align-midway"><align-midway></h2>
<p>
Must contain two <point> elements. Moves these along the
freedom vector until they are aligned midway between their
original positions. Measurement is along the projection
vector.
</p>
<pre>
<align-midway>
<point num="a"/>
<point num="b"/>
</align-midway></pre>
<h3>Content</h3>
<p>
Two <point> elements, both required.
</p>
<h3>Attributes</h3>
<p>None.</p>
<h2 id="call-function"><call-function></h2>
<p>
Calls a function (defined via the <function> element) by
name. Parameters may be passed to the function by including
several <with-param> elements; or, if the function is to
be called repeatedly, several <param-set> elements, each
containing the <with-param> elements for one call to the
function.
</p>
<p>
If the function returns a value, it can be assigned to a
variable via the <tt>result-to</tt> attribute. Note, however,
that if a <call-function> element contains more than one
<param-set>, only the value returned by the last
iteration of the function is returned.
</p>
<pre>
<call-function name="cap-serif-width">
<param-set>
<with-param name="ref-pt" value="left-left"/>
<with-param name="move-pt" value="top-serif-end"/>
</param-set>
<param-set>
<with-param name="ref-pt" value="left-left"/>
<with-param name="move-pt" value="bottom-serif-end"/>
</param-set>
</call-function></pre>
<h3>Contents</h3>
<p>
Either several <with-param> elements (if the function is
to be called just once) or several <param-set> elements.
</p>
<h3>Attribute</h3>
<dl>
<dt>name</dt>
<dd>
Required. The name of the function to call.
</dd>
<dt>result-to</dt>
<dd>
Optional. The name of a variable or control value in which
to store the value returned by the function.
</dd>
</dl>
<h2 id="call-glyph"><call-glyph></h2>
<p>
The <call-glyph> element causes code for the whole of a
glyph program to be compiled and inserted, in the manner of a
macro. Like <call-macro>, <call-glyph> can contain
<with-param> elements, passing values to the glyph
program. For a detailed account of its use, see the chapter on
<a href="functions.html#glyph">functions, macros and glyph
programs</a>.
</p>
<h3>Content</h3>
<p>
If the glyph being called has one or more <param>
elements, one or more <with-param>
elements. <param-set> elements are not permitted here.
</p>
<h3>Attribute</h3>
<dl>
<dt>ps-name</dt>
<dd>
Required. Must match the <tt>ps-name</tt> attribute of the
<glyph> element being called.
</dd>
</dl>
<h2 id="call-macro"><call-macro></h2>
<p>
Causes a macro to be compiled and its code inserted at the
present location.
</p>
<pre>
<call-macro name="lc-vert-stem-with-serif">
<with-param name="anchor" value="left-left"/>
<with-param name="distance-from-anchor" value="hn-width"/>
<with-param name="stem-a" value="right-right"/>
<with-param name="serif-a" value="right-serif-right"/>
<with-param name="stem-b" value="right-left"/>
<with-param name="serif-b" value="right-serif-left"/>
</call-macro></pre>
<h3>Content</h3>
<p>
Either one or more <with-param> elements, one for each
parameter defined in the <macro> element, or several
<param-set> elements if the macro is to be compiled and
inserted at this place more than once. <with-param> may
be omitted for each <param> element with a
<tt>value</tt> attribute.
</p>
<h3>Attribute</h3>
<dl>
<dt>name</dt>
<dd>
Required. The name of the macro to call.
</dd>
</dl>
<h2 id="call-param"><call-param></h2>
<p>
This element may be used within a <glyph> or
<macro> element containing <param> elements. It
will cause to be executed a snippet of code passed into a
called <glyph> or <macro> via a <with-param>
element. For details, see the <a
href="functions.html#callable">"Callable Parameters"</a>
section of <a href="functions">Functions, Macros and Glyph
Programs</a>.
</p>
<h3>Content</h3>
<p>None.</p>
<h3>Attribute</h3>
<dl>
<dt>name</dt>
<dd>
Required. The name of the <param> to call.
</dd>
</dl>
<h2 id="ceiling"><ceiling></h2>
<p>Yields the smallest integer greater than or equal to
<tt>value</tt>.</p>
<h3>Content</h3>
<p>None.</p>
<h3>Attributes</h3>
<dl>
<dt>value</dt>
<dd>
Required, except when <ceiling> is the child of a
<formula>. Any value or expression. The value to operate on.
</dd>
<dt>result-to</dt>
<dd>
Optional; not allowed when <ceiling> is the child of a
<formula>. If <tt>result-to</tt> is omitted where
allowed, Xgridfit attempts to write the result to
<tt>value</tt>. If <tt>value</tt> cannot be written to, the
compiler issues a warning and the result is left on the
stack.
</dd>
</dl>
<h2 id="command"><command></h2>
<p>
Causes any TrueType instruction (except the PUSHB and PUSHW
instructions) to be inserted at this place in the output.
<tt>name</tt> is the name of the command; <tt>modifier</tt>,
is simply copied into brackets after the instruction that is
generated. This element
</p>
<pre>
<command name="MIRP" modifier="10110"/></pre>
<p>
is compiled to "MIRP[10110]". The <tt>modifier</tt> attribute
lacks portability, since it is copied in literally. A better
solution is to use <modifier> elements within the
<command> element, thus:
</p>
<pre>
<command name="MIRP">
<modifier type="rp0" value="yes"/>
<modifier type="minimum-distance" value="no"/>
<modifier type="round" value="no"/>
<modifier type="color" value="black"/>
</command></pre>
<p>
Though verbose, this style allows Xgridfit to check the input
code and has the potential to allow Xgridfit to vary the
syntax of its output. (Since Xgridfit now produces scripts
only for FontForge, the latter capability is not exploited.)
</p>
<h3>Content</h3>
<p>
One or more <a href="#modifier"><modifier></a> elements,
if required by the instruction and if the <tt>modifier</tt>
attribute is not used.
</p>
<h3>Attributes</h3>
<dl>
<dt>name</dt>
<dd>
Required. The name of the TrueType instruction to be
output. The compiler checks this against a list of
instructions.
</dd>
<dt>modifier</dt>
<dd>
A modifier string to be inserted <i>literatim</i> in the
TrueType instruction. For example, if <tt>command</tt> is
"MIRP" and <tt>modifier</tt> is "rnd", then
<tt>MIRP[rnd]</tt> is output.
</dd>
</dl>
<h2 id="compile-if"><compile-if></h2>
<p>
Code within <compile-if> is compiled only if the
<tt>test</tt> attribute evaluates to true (non-zero). The
compiler must be able to evaluate <tt>test</tt> at compile
time: thus it may contain only constants, number literals,
control value indexes and a few operators (<tt>+ - = !=
&gt; &lt; &gt;= &lt;= or and not</tt>).
</p>
<p>
Here is a simple example of <compile-if>:
</p>
<pre>
<compile-if test="bold-italic">
<delta>
<delta-set size="3" distance="-2">
<point num="pt"/>
</delta-set>
</delta>
</compile-if></pre>
<p>
The delta is compiled and inserted in the output code only if
<tt>bold-italic</tt> (a global constant) is non-zero.
</p>
<p>
The <compile-if> element may also contain an
<else> element, which must come last. If <tt>test</tt>
evaluates to false (zero), the code contained in <else>
is compiled.
</p>
<h3>Content</h3>
<p>
Programming to be conditionally compiled.
</p>
<h3>Attribute</h3>
<dl>
<dt>test</dt>
<dd>
Required. Any value or expression that can be resolved to a
number at compile time. If it evaluates as true (non-zero),
the content of this element is compiled.
</dd>
</dl>
<h2 id="constant"><constant></h2>
<p>
A constant is a named number. The <tt>value</tt> can be an
integer, either of the two kinds of fixed-point number
(e.g. "2.3" for a distance on the grid or "1.0v" for a
component of a vector), or the name of another constant, in
which case it creates an alias for that constant. It can also
be a simple expression (usually addition or subtraction)
based on another constant:
</p>
<pre>
<constant name="bottom-left" value="3"/>
<constant name="bottom" value="bottom-left"/>
<constant name="bottom-right" value="bottom + 4"/></pre>
<p>
Constants can be referenced just about anywhere that numbers
are called for. To refer to a constant belonging to another
glyph program, use the glyph's <tt>ps-name</tt> followed by a
slash and the name of the constant, e.g.
</p>
<pre>
<point num="macron/bottom"/></pre>
<p>
This is useful when instructing composite glyphs.
</p>
<p>
Constants can be declared at the beginning of a <glyph>
program, or as a child of the <xgridfit> element.
</p>
<h3>Content</h3>
<p>None.</p>
<h3>Attributes</h3>
<dl>
<dt>name</dt>
<dd>
Required. A name: any sequence of letters, numbers, hyphens,
periods; no spaces permitted. Other elements can refer to
the constant by this name.
</dd>
<dt>value</dt>
<dd>
Required. A number or simple expression. It should be
possible to resolve this attribute to a number at compile
time.
</dd>
</dl>
<h2 id="contour"><contour></h2>
<p>
Specifies a contour to be shifted by a <shift>
instruction.
</p>
<h3>Content</h3>
<p>None.</p>
<h3>Attributes</h3>
<dl>
<dt>num</dt>
<dd>
Required. A number or simple expression, the number of the
contour. It should be possible to resolve this attribute to
a number at compile time.
</dd>
<dt>zone</dt>
<dd>
Optional. Possible values are "glyph" and "twilight."
Include the attribute <tt>zone="twilight"</tt> if this
contour is in the twilight zone; otherwise the compiler will
assume that it is in the glyph zone.
</dd>
</dl>
<h2 id="control-values"><control-value></h2>
<p>
The font's Control Value Table is built from the
<control-value> elements. Each <control-value> has an
<tt>name</tt> (which must be unique) and a numerical value. The
index of the <control-value> is generated by Xgridfit, and
no attempt should be made to predict it: Xgridfit instructions
should use only the names of <control-value>s, though the
index may be derived and used at run time.
</p>
<pre>
<control-value name="curved-char-bottom" value="-25"/>
<control-value name="lc-x-height" value="850"/>
<control-value name="lc-descender-depth" value="-555"/>
<control-value name="lc-ascender-height" value="1485"/></pre>
<h3>Content</h3>
<p>None.</p>
<h3>Attributes</h3>
<dl>
<dt>name</dt>
<dd>
Required. A name: any sequence of letters, numbers, hyphens,
periods; no spaces permitted.
</dd>
<dt>value</dt>
<dd>
Required. A number in font units (the units of the grid on
which the font was designed, normally 100 units per em or
2048 units per em).
</dd>
<dt>index</dt>
<dd>
Optional, and consulted only in merge-mode. Specifies how to
determine a control-value's index. "Auto" (the default)
means that if a control-value with this one's <tt>value</tt>
is found in the font, it should be re-used; otherwise this
control value should be appended to the end of the
control-value table. "Append" means that the control-value
should always be appended to the end of the control-value
table. A number specifies the index at which the
control-value should be placed. If the <tt>value</tt> of
this control-value is different from the value of that of
the control-value at that index in the existing font, the
control-value is updated.
</dd>
</dl>
<h2 id="control-value-delta"><control-value-delta></h2>
<p>
The <control-value-delta> element works like the
<delta> element, but operates on the Control Value Table
rather than on a point. It should normally be invoked in the
<pre-program>. Each <delta-set> inside a
control-value-delta element must have <tt>cv</tt>,
<tt>size</tt> and <tt>distance</tt> attributes, but it may not
contain a point.
</p>
<p>
The setting of the vectors has no effect on the
<control-value-delta>. Rather, the <delta-set>
specifies an amount to add to or subtract from the value
stored there.
</p>
<pre>
<control-value-delta>
<delta-set cv="pq-char-width" size="6" distance="-8"/>
<delta-set cv="pq-char-width" size="9" distance="-8"/>
</control-value-delta></pre>
<h3>Content</h3>
<p>
One or more <delta-set> elements.
</p>
<h3>Attributes</h3>
<p>None.</p>
<h2 id="control-value-index"><control-value-index></h2>
<p>
Assigns the index of a control value to a variable. Use this
if you need to get such an index for any reason, since the
<set-equal> instruction yields the value, not the index,
of a control value.
</p>
<h3>Content</h3>
<p>None.</p>
<h3>Attributes</h3>
<dl>
<dt>value</dt>
<dd>
Required. The name of the control value whose index you want
to retrieve. No other kind of value is recognized here.
</dd>
<dt>result-to</dt>
<dd>
Required. The name of a <variable> in which to store
the index of the control value.. Only a variable is
permitted here--not, for example, the name of another
control value.
</dd>
</dl>
<h2 id="default-el"><default></h2>
<p>
This element, which may appear as a child of <xgridfit>,
declares a default value. If the type is "minimum-distance,"
"control-value-cut-in," "single-width," "single-width-cut-in,"
"delta-base," "delta-shift" or "round-state," Xgridfit also
inserts code in the prep program to set a font-wide default in
the TrueType engine. Another way of setting these defaults is
simply to include elements that set these values in the
<pre-program>, and the effect is the same. If you want
the TrueType engine to reject all attempts to set defaults
(that is, if you want to use only the defaults that are
standard for TrueType), include this:
</p>
<pre>
<default type="use-truetype-defaults" value="yes"/></pre>
<p>
In addition to TrueType defaults, stored in the font file,
this element controls several defaults that govern how
Xgridfit operates.
</p>
<h3>Content</h3>
<p>None.</p>
<h3>Attributes</h3>
<dl>
<dt>type</dt>
<dd>
Required. Must be one of the following: "minimum-distance",
"control-value-cut-in", "single-width",
"single-width-cut-in", "delta-base", "delta-shift",
"delta-break", "max-twilight-points", "max-storage",
"legacy-storage", "max-stack", "use-truetype-defaults",
"round-state", "function-base", "init-graphics", "color",
"delete-all", "combine-prep", "auto-instr", "auto-hint",
"cv-num-in-compile". For details about the meanings of these
types, see <a href="graphics.html">The Graphics State and
Xgridfit Defaults</a> and <a
href="merge-mode.html">Merge-mode</a>.
</dd>
<dt>value</dt>
<dd>
Required. For permissible values, see <a
href="graphics.html">The Graphics State and Xgridfit
Defaults</a>.
</dd>
</dl>
<h2 id="delta"><delta></h2>
<p>
A delta instruction moves points at particular sizes. The
<delta> element may contain any number of
<delta-set> elements, each one specifying a point to
move, a size at which to move it, and a distance to move it.
</p>
<p>
The direction of the move is determined by the current setting
of the freedom vector. The available specifications are fuzzy
as to the details. You will experience no surprises when the
vectors are set to x or y; you may experiment with the vectors
set at other angles.
</p>
<p>
When the first element of a <delta> is a <point>,
that point is the default, which every <delta-set>
element will move unless it contains its own
<point>. These two <delta> elements are
equivalent:
</p>
<pre>
<delta>
<delta-set size="3" distance="8">
<point num="p1"/>
</delta-set>
<delta-set size="4" distance="8">
<point num="p1"/>
</delta-set>
</delta>
<delta>
<point num="p1"/>
<delta-set size="3" distance="8"/>
<delta-set size="4" distance="8"/>
</delta></pre>
<p>
Note that a <move> element may contain <delta>
elements. When a <delta-set> element inside one of these
<delta> elements lacks a <point>, it operates on
the point moved by the parent <move>.
</p>
<h3>Content</h3>
<p>
An optional <point> element, followed by one or more
<delta-set> elements.
</p>
<h3>Attributes</h3>
<dl>
<dt>compile-if</dt>
<dd>
Optional. Any value or expression that can be resolved to a
number at compile time. If true (non-zero), the
<delta> element is compiled; otherwise the compiler
passes it over.
</dd>
</dl>
<h2 id="delta-set"><delta-set></h2>
<p>
The <delta-set> element encapsulates the essential
information about a single delta move or adjustment: the
resolution at which to apply the delta, the magnitude of the
adjustment, and the point or control value that will be
affected.
</p>
<p>
The resolution is determined by the <tt>size</tt> attribute,
which can be a number from 0 to 47. It is added to the value
set by the <set-delta-base> or <with-delta-base>
instruction to obtain the resolution (in pixels per em or
"ppem") at which the move should take place. The default delta
base is 9; if you don't change it, a <tt>size</tt> of "0"
means 9 ppem, "9" means 18 ppem, and so forth up to "47,"
which means 56 ppem.
</p>
<p>
The <tt>distance</tt> attribute is the distance to shift the
point along the freedom vector, or the amount to add to or
subtract from the control value. Legal values are from -8 to 8
(excluding 0). When moving points, negative numbers shift
against the direction of the freedom vector (generally down or
left) and positive numbers shift in the direction of the
freedom vector.
</p>
<p>
The default unit by which pixels are moved and control values
adjusted is 1/8 pixel. The unit is controlled by means of the
<set-delta-shift> or the <with-delta-shift>
instruction.
</p>
<p>
A <delta-set> that is the child of a <delta> will
normally contain a single <point>. However, the
<point> may be omitted in either of two circumstances:
First, when the <delta> is the child of a <move>
element, the <point>, when not specified, is implicitly
the <point> that is the child of the parent
<move>. Second, when the first child element of the
<delta> is <point>, that point will be moved by
any <delta-set> that lacks a child <point>. A
<delta-set> that is the child of a
<control-value-delta> element may not contain a
<point>, but it must have a <tt>cv</tt> attribute.
</p>
<p>
All attribute values in a <delta-set> and a child
<point> must be capable of being resolved to numerical
values at compile time. Variables and function parameters are
not permitted.
</p>
<h3>Content</h3>
<p>
When the <delta-set> is the child of a <delta>
element, it may contain a <point>; this is the point to
move. It <i>must</i> contain a <point> when it the
parent <delta> is not the child of a <move> and
the first child of the <delta> is not a
<point>. When the <delta-set> is the child of
<control-value-delta> it has no content.
</p>
<h3>Attributes</h3>
<dl>
<dt>cv</dt>
<dd>
Required when the <delta-set> is the child of
<control-value-delta>. The name of the control value
to adjust.
</dd>
<dt>size</dt>
<dd>
Required. An integer from 0 to 47. The resolution at which
to move the point or adjust the control value, as explained
above.
</dd>
<dt>distance</dt>
<dd>
Required. An integer from -8 to 8, excluding 0. The distance
to move the point or the amount to adjust the control value,
as explained above.
</dd>
</dl>
<h2 id="diagonal-stem"><diagonal-stem></h2>
<p>Given two lines (making up a diagonal stem),
makes the second line parallel to the first, subject to the
operation of the Control Value cut-in. If one <align> element is
present, the points it contains are aligned with the second line;
if there are two, the first set of points is aligned with the
first line and the second set with the second line. You may, and
often should, set a new minimum distance value with the <tt>min-distance</tt>
attribute. At the end of this instruction the minimum distance
is reset to its former value.</p>
<p>Usually it doesn't make a lot of sense to round the distance
when calling this instruction; and yet the default value of
<tt>round</tt> is <tt>yes</tt> for compatibility with other, similar instructions.
You'll probably want to set the <tt>round</tt> attribute to <tt>no</tt>; but
if you have several <diagonal-stem> instructions together,
enclose them in a <tt><with-round-state round="no"></tt> element to
turn off rounding beforehand
and on again afterwards. In this case, do not include the <tt>round</tt>
attribute with the <diagonal-stem> elements.</p>
<p>By default this instruction does not set the Freedom Vector, since
the best setting of that vector varies with circumstances. If
you want the Freedom Vector to be the same as the Projection
Vector, set <tt>freedom-vector="yes"</tt>.</p>
<p>This instruction is not suitable for use inside a function
(though you may do so if the <line> elements contain points
rather than <tt>ref</tt> attributes). Also, I'm not sure whether it
will work if the various points are in different zones. It may,
but I don't guarantee it.</p>
<pre>
<with-minimum-distance value="diag-min-dist">
<with-round-state round="no">
<diagonal-stem distance="cap-thick-diag" save-vectors="yes">
<line ref="left-diag-left-line"/>
<line ref="left-diag-right-line"/>
</diagonal-stem>
<diagonal-stem distance="cap-thin-diag" save-vectors="yes">
<line ref="right-diag-right-line"/>
<line ref="right-diag-left-line"/>
</diagonal-stem>
</with-round-state>
</with-minimum-distance></pre>
<h3>Content</h3>
<p>
Two <line> elements, the second to be made parallel to
the first. Optionally, one or two <align> elements, the
first containing points to be aligned with the first line and
the second with the second line.
</p>
<h3>Attributes</h3>
<dl>
<dt>distance</dt>
<dd>
Required. The name of a control value which determines the
distance to place the second line from the first.
</dd>
<dt>round</dt>
<dd>
Optional. The value may be "yes" or "no", the name of a
standard or custom round state, or any number or expression
to use as an input for SROUND. If the value is anything but
"no", rounding is used.
</dd>
<dt>cut-in</dt>
<dd>
Optional. The value may be "yes" or "no"; the default is
"yes". Determines whether to use the control value cut-in.
</dd>
<dt>min-distance</dt>
<dd>
Optional. The value may be "yes" or "no" or any value or
expression to be used to set the minimum distance for this
operation.
</dd>
<dt>color</dt>
<dd>
Optional. Permitted values are "black", "white" and
"gray". The default is "black." The kind of distance between
the points of the two <line> elements.
</dd>
<dt>freedom-vector</dt>
<dd>
Optional. The value may be "yes" or "no"; the default is
"no". Determines whether to set the freedom vector to the
same angle as the projection vector.
</dd>
<dt>save-vectors</dt>
<dd>
Optional. The value may be "yes" or "no"; the default is
"no". If "yes", both the projection vector and the freedom
vector are guaranteed to be the same after this intruction
as they were before.
</dd>
</dl>
<h2 id="disable-instructions"><disable-instructions></h2>
<p>
Disables the instructions associated with glyphs. The
TrueType specification does not say that instructions in the
<pre-program> are disabled: presumably they are
not. This instruction is available only in the
<pre-program>.
</p>
<h3>Content</h3>
<p>None.</p>
<h3>Attributes</h3>
<p>None.</p>
<h2 id="divide"><divide></h2>
<p>Divides <tt>dividend</tt> by <tt>divisor</tt>. If
<tt>result-to</tt> is not specified, Xgridfit attempts to
write the result to <tt>dividend</tt>.</p>
<h3>Content</h3>
<p>None.</p>
<h3>Attributes</h3>
<dl>
<dt>dividend</dt>
<dd>
Required, except when <divide> is a child of the
<formula> element. Any value or expression. The number
to be divided.
</dd>
<dt>divisor</dt>
<dd>
Required, except when <divide> is a child of the
<formula> element. Any value or expression. The number
by which the dividend is to be divided.
</dd>
<dt>result-to</dt>
<dd>
Optional; not allowed when <divide> is the child of a
<formula>. The name of a variable or control value in
which to store the result. In a <formula> element the
result can be passed automatically to the next arithmetic
element; otherwise, if this attribute is missing, the
compiler tries to store the result in
<tt>dividend</tt>. Failing that, it issues a warning and
leaves the result on the stack.
</dd>
</dl>
<h2 id="else-el"><else></h2>
<p>
Provides the "else" clause for an <a
href="#if-el"><if></a> or <a
href="#compile-if"><compile-if></a> element. The
<else> must be the last child of the parent element.
</p>
<h3>Content</h3>
<p>
Programming to be conditionally compiled.
</p>
<h3>Attributes</h3>
<p>None.</p>
<h2 id="enable-instructions"><enable-instructions></h2>
<p>
Enables the instructions associated with glyphs. This
instruction is available only in the <pre-program>.
</p>
<h3>Content</h3>
<p>None.</p>
<h3>Attributes</h3>
<p>None.</p>
<h2 id="entry"><entry></h2>
<p>
An entry in the <a href="#ps-private">PostScript private
dictionary</a>.
</p>
<h3>Content</h3>
<p>None.</p>
<h3>Attributes</h3>
<dl>
<dt>name</dt>
<dd>
Required. The name of the entry.
</dd>
<dt>value</dt>
<dd>
Required. The value of the entry. Usually this is a
space-delimited list of numbers; for BlueFuzz it must be an
integer.
</dd>
</dl>
<h2 id="flip-on"><flip-off><br/><flip-on></h2>
<p>
"Flips" a range of points so that they all become either
on-line points or off-line points. The <flip-off> and
<flip-on> elements must contain a single <range>
element. The range operated upon always runs from the lowest
point to the highest.
</p>
<h3>Content</h3>
<p>
One <range> element.
</p>
<h3>Attributes</h3>
<p>None.</p>
<h2 id="floor"><floor></h2>
<p>Yields the greatest integer less than or equal to <tt>value</tt>,
which is either an integer representing 64ths of a pixel or
a fixed-point number. The returned value, if looked at as
an integer, is either zero or a multiple of 64.</p>
<h3>Content</h3>
<p>None.</p>
<h3>Attributes</h3>
<dl>
<dt>value</dt>
<dd>
Required, except when <floor> is the child of a
<formula>. Any value or expression. The value to operate on.
</dd>
<dt>result-to</dt>
<dd>
Optional; not allowed when <floor> is the child of a
<formula>. The name of a variable or control value in
which to store the result. If <tt>result-to</tt> is omitted
where allowed, Xgridfit attempts to write the result to
<tt>value</tt>. If <tt>value</tt> cannot be written to, the
compiler issues a warning and the result is left on the
stack.
</dd>
</dl>
<h2 id="formula"><formula></h2>
<p>A formula is a block containing arithmetical instruction
elements. Within the <formula> the behavior of these
elements is modified slightly: when a <tt>result-to</tt> attribute is
missing, they do not attempt to write their result back to
one of the values passed to them, but rather leave it on the
stack, thus making it available to the following instruction
element. Further, while Xgridfit normally issues a warning
when an arithmetic element takes a value from the stack or
leaves a result on the stack, within a formula this is the
expected behavior and so the warning is suppressed. The
instructions within the formula should be chained, the
result of one operation being used as an argument for the
following one; this results in tight code being generated.
Example:</p>
<pre>
<formula result-to="minimum-distance">
<round value="lc-vert-stem"/>
<multiply value2="0.8"/>
</formula></pre>
<p>This rounds the control-value "lc-vert-stem," multiplies it by
0.8, and sets the minimum distance in the graphics state to
the result. The original entry in the control-value table is
unchanged. By contrast, if this <round> element were
not the child of a <formula>, the result would be
written back to the control-value table.</p>
<h3>Content</h3>
<p>
A sequence of elements that perform arithmetic: set-equal,
add, subtract, divide, multiply, absolute, negate, floor,
ceiling, minimum, maximum, round, no-round,
control-value-index.
</p>
<h3>Attributes</h3>
<dl>
<dt>result-to</dt>
<dd>
Optional. The name of a variable or control value in which
to store the result. If there is no <tt>result-to</tt>
attribute, the compiler issues a warning and the result is
left on the stack.
</dd>
</dl>
<h2 id="functions"><function></h2>
<p>
The <function> element is used to define
functions. Functions are called by name using the <a
href="#call-function"><call-function></a>
element. Normally Xgridfit takes care of indexing functions
and making sure the right number is used to call them.
</p>
<p>
A function may also have a <tt>num</tt> attribute: this is
used to define the function in the fpgm table and ensures that
any legacy programming can continue to call older functions by
number. Xgridfit assigns a number automatically to any
function that lacks a <tt>num</tt> attribute.
</p>
<p>
A function that returns a value must have the attribute
<tt>return="yes"</tt>; within such a function an instruction
may assign a value to the special variable "return". The
return value must be a single number; lines, vectors, and
other structures consisting of two or more numbers cannot be
returned.
</p>
<p>
A <function> may contain any number of <param>
elements and any number of <variable> elements, followed
by programming.
</p>
<pre>
<function name="lc-standard-serif">
<!-- Regulates vertical distances within a serif -->
<param name="base"/>
<param name="bottom-left"/>
<param name="bottom-right"/>
<param name="top-left"/>
<param name="top-right"/>
<with-vectors axis="y">
<mdap>
<point num="base"/>
</mdap>
<mirp distance="lc-serif-height" set-rp0="yes">
<point num="top-left"/>
</mirp>
<align>
<point num="top-right"/>
</align>
<mirp distance="lc-serif-height" set-rp0="yes">
<point num="bottom-left"/>
</mirp>
<align>
<point num="bottom-right"/>
</align>
</with-vectors>
</function></pre>
<p>
You may define <a
href="functions.html#function-variant">function variants</a>,
that is, alternative versions of a function to be used at
certain sizes or resolutions. To do so, simply include one or
more <a href="#function-variant"><variant></a> elements
as the last children of the <function> element.
</p>
<h3>Content</h3>
<p>
First optional <param> elements; next optional
<variable> and <alias> elements (in any order);
then elements containing programming to be executed by
default; finally optional <variant> elements defining
versions of the function to be used if the <tt>test</tt>
attribute of the <variant> element evaluates as true
(non-zero) when the <pre-program> is run.
</p>
<h3>Attributes</h3>
<dl>
<dt>name</dt>
<dd>
Required. A name: any sequence of letters, numbers, hyphens,
periods; no spaces permitted. The name of this function.
</dd>
<dt>xml:id</dt>
<dd>
Optional. A valid XML ID, i.e. any sequence of letters,
numbers, hyphens, periods; no spaces permitted; and unique
within the program. This ID may be used if a function is
imported into a file using XInclude.
</dd>
<dt>num</dt>
<dd>
Optional. A non-negative integer (zero or greater). See
above for its use. If your program contains functions with
<tt>num</tt> attributes, it should not contain a
<legacy-functions> element.
</dd>
<dt>return</dt>
<dd>
Optional. Permitted values are "yes" and "no"; "no" is the
default. If "yes", the function may return a value by
assigning a value to the special "return" variable.
</dd>
</dl>
<h2 id="get-coordinate"><get-coordinate></h2>
<p>
Gets the coordinate of a point, measured along the current
projection vector. If the projection vector is set to
<tt>x</tt>, for example, the result will be the horizontal
distance of the point from the grid origin (0,0). The
<tt>result-to</tt> attribute may be the name of a variable, a
control value, or a graphics state variable.
</p>
<pre>
<get-coordinate result-to="v">
<point num="p"/>
</get-coordinate></pre>
<p>
Most of the time it will be more convenient to use one of the
"coord" operators in an <a
href="expressions.html">expression</a>.
</p>
<h3>Content</h3>
<p>
The <point> to get the coordinate of.
</p>
<h3>Attributes</h3>
<dl>
<dt>grid-fitted</dt>
<dd>
Optional. Permitted values are "yes" and "no"; the default
is "yes". Whether to use the point's current (grid-fitted)
position or its original position (before grid-fitting).
</dd>
<dt>result-to</dt>
<dd>
Optional. The name of a variable or control value in which
to store the result. If there is no <tt>result-to</tt>
attribute, the compiler issues a warning and the result is
left on the stack.
</dd>
</dl>
<h2 id="getinfo"><getinfo></h2>
<p>
The <getinfo> element provides access to the TrueType
GETINFO instruction, which queries the TrueType engine about
the state of the current glyph, about the engine version, or
about whether ClearType is enabled. In general it is more
convenient to use Xgridfit's built-in <a
href="graphics.html#engine">graphics variables</a> to obtain
such information, but the <getinfo> element may be
useful to combine selectors in ways that Xgridfit does not
anticipate; and future versions of the TrueType may introduce
selectors that Xgridfit does not know about.
</p>
<p>
<getinfo> takes two attributes: <tt>selector</tt>
indicates which query or queries to submit to GETINFO. Its
value can be any number or expression; and note that the
relevant <a href="graphics.html#engine">graphics variables</a>
can be used here, and the value of these variables in this
context is the selector rather than the result of a GETINFO
query, as is the case elsewhere. Selectors for GETINFO can be
combined by ANDing them; this can be simulated in Xgridfit by
adding selectors together (since TrueType programming does not
have arithmetical AND). This query
</p>
<pre>
<getinfo result-to="v" selector="is-glyph-rotated + is-glyph-stretched"/></pre>
<p>
will return a non-zero (true) value if either condition is
true.
</p>
<p>
The second attribute, <tt>result-to</tt>, works like the same
attribute elsewhere: that is, it is a variable in which to
store the result of the query, and if it is omitted the
compiler issues a warning and the value is left on the top of
the stack.
</p>
<h3>Content</h3>
<p>None.</p>
<h3>Attributes</h3>
<dl>
<dt>selector</dt>
<dd>
One or more of the following, added together:
is-glyph-rotated, is-glyph-stretched, is-glyph-grayscale,
is-cleartype-enabled, is-compatible-width-enabled,
is-symmetrical-smoothing-enabled, is-BGR-order. Or, by
itself, is-glyph-transformed.
</dd>
<dt>result-to</dt>
<dd>
Optional. The name of a variable in which to store the
result. If there is no <tt>result-to</tt> attribute, the
compiler issues a warning and the result is left on the
stack.
</dd>
</dl>
<h2 id="glyph"><glyph></h2>
<p>
The <glyph> element contains instructions relating to an
individual glyph. Example:
</p>
<pre>
<glyph ps-name="sample-glyph">
<constant name="last" value="50"/>
. . .
<variable id="v"/>
<with-vectors axis="y">
<!-- programming here -->
</with-vectors>
<with-vectors axis="x">
<!-- more programming here -->
</with-vectors>
<interpolate-untouched-points/>
</glyph></pre>
<p>
To make a glyph program callable in the manner of a macro (see
<a href="#call-glyph"><call-glyph></a>), include one or
more <param> elements for key values. These should have
<tt>value</tt> attributes, since the glyph program will have
to be compiled and run even when it is not called.
</p>
<h3>Content</h3>
<p>
<param> elements (if any) must come first, followed by
<constant>, <range>, <set>, <line>,
<alias> and <variable> elements in any
order. Finally programming for the glyph.
</p>
<h3>Attributes</h3>
<dl>
<dt>ps-name</dt>
<dd>
Required. The PostScript name of the glyph. It must match
the PostScript name of the glyph in the font.
</dd>
<dt>xml:id</dt>
<dd>
Optional. A valid XML ID, i.e. any sequence of letters,
numbers, hyphens, periods; no spaces permitted; and unique
within the program. This ID may be used if a <glyph>
is imported into a file using XInclude.
</dd>
<dt>init-graphics</dt>
<dd>
Optional. Permitted values are "yes" and "no". This
attribute determines whether variables used by Xgridfit to
track the graphics state are initialized at the beginning of
the glyph program. Such initialization is not needed when
instructions are imported from another font. The default
value is normally "yes," but the default may be set with the
<tt>init-graphics</tt> <default> or with the -G option
for the <tt>xgridfit</tt> executable.
</dd>
</dl>
<h2 id="glyph-select"><glyph-select></h2>
<p>
Specifies a whitespace-delimited list of glyphs to compile,
ignoring all others. It is all right to keep this element in
the file when you don't need it: just empty it out. These are
valid:
</p>
<pre>
<glyph-select>a macron amacron</glyph-select>
<glyph-select></glyph-select></pre>
<p>
This element corresponds to the <tt>glyph-select</tt>
parameter and the <tt>-g</tt> command line option, either of
which will, if present, override the element.
</p>
<h3>Content</h3>
<p>
A whitespace-delimited list of ps-names of glyph elements.
</p>
<h3>Attributes</h3>
<p>None.</p>
<h2 id="if-el"><if></h2>
<p>
Contains instructions that are executed only if the expression
in the <tt>test</tt> attribute is true. If the test is false,
and an <else> element is the last child of this
<if>, the instructions in the <else> element are
executed. <if> elements may be nested.
</p>
<p>
The <tt>test</tt> attribute contains an expression, e.g.
</p>
<pre>
<if test="minimum-distance = 1p"></pre>
<p>
For more on expressions, see the <a
href="expressions.html">Expressions</a> section of this
documentation. In the TrueType language, where all data is
numeric, a non-zero value is considered true and zero false. So
the <tt>test</tt> attribute can be used to tell whether a
value is zero. This
</p>
<pre>
test="round(lc-vert-stem) != 0"</pre>
<p>
is equivalent to this:
</p>
<pre>
test="round(lc-vert-stem)"</pre>
<p>
The <if> element may contain an <else> clause,
which must come last.
</p>
<pre>
<if test="boolean-expression">
<!-- programming -->
<else>
<!-- alternative programming -->
</else>
</if></pre>
<h3>Content</h3>
<p>
Programming, followed optionally by an <else> element.
</p>
<h3>Attributes</h3>
<dl>
<dt>test</dt>
<dd>
Required. Any value or expression. The condition to test
for.
</dd>
</dl>
<h2 id="infile"><infile></h2>
<p>
Contains the name of a file to which TrueType instructions are
to be added. This may be either a FontForge source file (.sfd)
or a TrueType font (.ttf).
</p>
<pre>
<infile>MyFont.sfd</infile>
<outfile>MyFont.ttf</outfile></pre>
<h3>Content</h3>
<p>
The name of a file with extension <tt>.sfd</tt> or
<tt>.ttf</tt>.
</p>
<h3>Attributes</h3>
<p>None.</p>
<h2 id="interpolate"><interpolate></h2>
<p>
To "interpolate" a point is to move it so that its position
relative to two reference points is what it was in the
original outline. If the distance between the two reference
points is not what it was in the original outline, the point
is positioned so that its relationship to the reference points
is proportionally correct.
</p>
<p>
The <interpolate> element must contain at least one
point to interpolate. It may contain any number of
<point>s, <range>s and <set>s. Like most other elements
that move points, it may contain a <reference> element;
but this element must contain two <point>s, not just
one.
</p>
<p>
This instruction may be nested inside a <move> element
containing a reference point, in which case no reference
points are needed in the <interpolate> element: the
points it contains are automatically interpolated between the
<move> element's reference point and its moved point.
These two <interpolate> elements do the same thing:
</p>
<pre>
<interpolate>
<reference>
<point num="top"/>
<point num="bottom"/>
</reference>
<point num="bar-top-left"/>
</interpolate>
<move>
<reference>
<point num="bottom"/>
</reference>
<point num="top"/>
<interpolate>
<point num="bar-top-left"/>
</interpolate>
</move></pre>
<p>
If you want to round points after interpolating them, simply
include the attribute <tt>round="yes"</tt> on the
<interpolate> element. The points will be moved along the
freedom vector to the nearest rounded position. Note that this
has no effect on <range> or <set> elements. If you
want to use a round state other than the current one, use the
appropriate value for <tt>round</tt>:
</p>
<pre>
<interpolate round="to-half-grid">
<reference>
<point num="a"/>
<point num="b"/>
</reference>
<point num="c"/>
</interpolate></pre>
<h3>Content</h3>
<p>
An optional <reference> element (containing two
<point> elements), followed by one or more
<point>, <range> and <set> elements.
</p>
<h3>Attributes</h3>
<dl>
<dt>compile-if</dt>
<dd>
Optional. Any value or expression that can be resolved to a
number at compile time. This <interpolate> element is
compiled only if the <tt>compile-if</tt> attribute evaluates
as true (non-zero). If this attribute is not present, the
<interpolate> is compiled.
</dd>
<dt>round</dt>
<dd>
Optional. The value may be "yes" or "no", the name of a
standard or custom round state, or any number or expression
to use as an input for SROUND. If the value is anything but
"no", any points referred to by <point> elements (but
not <range> or <set> elements) are moved to the
nearest rounded position. Points are not rounded when this
attribute is not present.
</dd>
</dl>
<h2 id="interpolate-untouched-points"><interpolate-untouched-points></h2>
<p>Interpolates all points that have not been moved or
"touched" by instructions so that they are positioned
correctly relative to points that have been moved.
Most of the time you will want to place this
instruction at the end of the program for each
glyph.</p>
<h3>Content</h3>
<p>None.</p>
<h3>Attribute</h3>
<dl>
<dt>axis</dt>
<dd>
Optional. Permitted values are "x" and "y". Determines the
axis along which interpolation is performed. If this
attribute is omitted, interpolation is performed along both
x and y axes.
</dd>
</dl>
<h2 id="legacy-functions"><legacy-functions></h2>
<p>
Stores functions from a font that has been converted for use
with Xgridfit. Normally this should not be created or edited
by hand: see <a href="convert.html">Conversion</a> for further
details.
</p>
<h3>Content</h3>
<p>
Programming imported from an existing font: normally just
<command> and <push> elements.
</p>
<h3>Attributes</h3>
<dl>
<dt>max-function-defs</dt>
<dd>
Required. A positive integer (one or higher). One more than
the highest index of a functon defined in the
<legacy-functions> element. Normally this will be set
correctly by ttx2xgf, but the user should check it before
proceeding.
</dd>
</dl>
<h2 id="line"><line></h2>
<p>
A <line> is defined by its two end-points. These points
need not be adjacent.
</p>
<p>
When a <line> has a <tt>name</tt> attribute, another
<line> may refer to it by name. You may name the
<line> the first time you use it or declare it in a
<line> element among the declarations at the beginning
of a <glyph>. For example, if you declare the line
thus:
</p>
<pre>
<line name="line-2b">
<point num="b"/>
<point num="a"/>
</line></pre>
<p>then you can use an abbreviated form whenever you need it:</p>
<pre>
<set-freedom-vector>
<line ref="line-2b"/>
</set-freedom-vector></pre>
<p>
If both points that define a <line> are in the same
zone, you may use the optional <tt>zone</tt> attribute on the
<line> to indicate this. Most instructions that take a
<line> as an argument allow one point to be in one zone
and the other point in the other: in such cases place the
<tt>zone</tt> attributes on the <point>s. The exception
is the <move-point-to-intersection> instruction, which
requires that each of the two lines it takes as arguments be
entirely in a zone. For this instruction, place the
<tt>zone</tt> attributes on the <line>s, never on the
<point>s.
</p>
<h3>Content</h3>
<p>
Two <point> elements, one at each end of the line. These
are required if no <tt>ref</tt> attribute is present.
</p>
<h3>Attributes</h3>
<dl>
<dt>name</dt>
<dd>
Optional, but necessary if this <line> is referred to
elsewhere. A name: any sequence of letters, numbers,
hyphens, periods; no spaces permitted. Names this
<line>.
</dd>
<dt>ref</dt>
<dd>
Required if no <point> elements are present. A
reference to a named <line>.
</dd>
<dt>zone</dt>
<dd>
Optional. Permitted values are "twilight" and
"glyph". Include the attribute <tt>zone="twilight"</tt> if
both end-points of the line are in the twilight zone.
</dd>
</dl>
<h2 id="macros"><macro></h2>
<p>
A <a href="functions.html#macros">macro</a> is a stretch of
code that is compiled and inserted into the program stream
wherever a <call-macro> element is encountered. Macros
resemble functions in syntax: they begin with <param>
definitions followed by program code, which can access all
global variables and values (e.g. control values, graphics
variables, constants and variables declared as children of
<xgridfit>). Macros can be called from a
<function>, <pre-program> or <glyph>, and
variables and values local to these structures can be accessed
by passing them as parameters.
</p>
<p>
Macro parameters are fundamentally different from function
parameters. A function parameter is passed to the function on
the stack at run time; the macro parameter, on the other hand,
is swapped at compile time for the <tt>value</tt> parameter,
which is then evaluated as any value is evaluated at run
time. When passing variables or control values, there is no
rule governing whether they are passed to the macro by value
or by reference; rather, they are evaluated according to the
rule that governs evaluation of variables for the particular
instruction where they occur.
</p>
<h3>Content</h3>
<p>
Optional <param> elements, followed by optional
<alias> elements, and then by programming.
</p>
<h3>Attributes</h3>
<dl>
<dt>name</dt>
<dd>
Required. A name: any sequence of letters, numbers, hyphens,
periods; no spaces permitted. Names this <macro>.
</dd>
<dt>xml:id</dt>
<dd>
Optional. A valid XML ID, i.e. any sequence of letters,
numbers, hyphens, periods; no spaces permitted; and unique
within the program. This ID may be used if a <macro>
is imported into a file using XInclude.
</dd>
</dl>
<h2 id="maximum"><maximum></h2>
<p>Yields the greater of the two values <tt>value1</tt> and
<tt>value2</tt>.</p>
<pre>
<maximum value1="lc-vert-stem" value2="1p" result-to="lc-vert-stem"/></pre>
<h3>Content</h3>
<p>None.</p>
<h3>Attributes</h3>
<dl>
<dt>value1</dt>
<dd>
Required except when <maximum> is the child of a
<formula> element. Any value or expression.
</dd>
<dt>value2</dt>
<dd>
Required except when <maximum> is the child of a
<formula> element. Any value or expression.
</dd>
<dt>result-to</dt>
<dd>
Optional; not allowed when <maximum> is the child of a
<formula>. The name of a variable in which to store
the result. If <tt>result-to</tt> is omitted where allowed,
the compiler issues a warning and the result is left on the
stack.
</dd>
</dl>
<h2 id="mdap"><mdap></h2>
<p>Corresponds to the TrueType MDAP instruction. Normally
<move> is a better choice for moving points, but this
element is provided to facilitate low-level programming.</p>
<p>
This element rounds a point to the grid if the <tt>round</tt>
attribute is not <tt>no</tt>; otherwise it "touches" the point
(marks it as moved).
</p>
<pre>
<mdap>
<point num="p"/>
</mdap></pre>
<h3>Content</h3>
<p>
A single <point>.
</p>
<h3>Attributes</h3>
<dl>
<dt>round</dt>
<dd>
Optional. The value may be "yes" or "no", the name of a
standard or custom round state, or any number or expression
to use as an input for SROUND. The default value is "yes."
This attribute determines whether and how to round the
point.
</dd>
</dl>
<h2 id="mdrp"><mdrp></h2>
<p>Corresponds to the TrueType MDRP instruction. Normally
<move> is a better choice for moving points, but this
element is provided to facilitate low-level programming.</p>
<p>
This element will also take care of setting RP0 beforehand if
a reference point is supplied. If no reference point is
supplied, the current value of RP0 is used.
</p>
<pre>
<mdrp>
<reference>
<point num="r"/>
</reference>
<point num="p"/>
</mdrp></pre>
<h3>Content</h3>
<p>
An optional <reference> element (containing one point),
followed by a single <point>.
</p>
<h3>Attributes</h3>
<dl>
<dt>round</dt>
<dd>
Optional. The value may be "yes" or "no", the name of a
standard or custom round state, or any number or expression
to use as an input for SROUND. The default value is "yes."
This attribute determines whether and how to round the
distance between the reference point and the moved point.
</dd>
<dt>min-distance</dt>
<dd>
Optional. Permitted values are "yes" and "no". The default
is "yes." Whether or not to maintain a minimum distance
between the reference point and the moved point.
</dd>
<dt>set-rp0</dt>
<dd>
Optional. Permitted values are "yes" and "no". The default
is "no." Whether or not to set the RP0 pointer to the moved
point after the instruction is executed.
</dd>
<dt>color</dt>
<dd>
Optional. Permitted values are "black", "white" and
"gray". The default is "gray." The kind of distance between
the reference point and the moved point. This is used by
some TrueType engines to compensate for engine
characteristics.
</dd>
</dl>
<h2 id="measure-distance"><measure-distance></h2>
<p>
Measures the distance between two points and returns an
F26dot6 number. The measurement is performed along the
projection vector, and the result may be positive or negative
depending on the relationship of the distance to the direction
of the vector. Another way of putting it is that the order of
the two points in this instruction is significant; reverse
them and you reverse the sign of the result.
</p>
<pre>
<measure-distance result-to="v">
<point num="p1"/>
<point num="p2"/>
</measure-distance></pre>
<p>
Usually it will be more convenient to use the <tt>--</tt> or
<tt>---</tt> operator in an <a
href="expressions.html">expression</a>.
</p>
<h3>Content</h3>
<p>
Two <point> elements.
</p>
<h3>Attributes</h3>
<dl>
<dt>grid-fitted</dt>
<dd>
Optional. Permitted values are "yes" and "no"; the default
is "yes". Whether to use the point's current (grid-fitted)
position or its original position (before grid-fitting).
</dd>
<dt>result-to</dt>
<dd>
Optional. The name of a variable or control value in which
to store the result. If there is no <tt>result-to</tt>
attribute, the compiler issues a warning and the result is
left on the stack.
</dd>
</dl>
<h2 id="message"><message></h2>
<p>
The <message> element produces no TrueType code, but
rather causes a message to be output at compile-time via the
<xsl:message> element. This may help with debugging.
</p>
<h3>Content</h3>
<p>
Text of a message to be output.
</p>
<h3>Attributes</h3>
<p>None.</p>
<h2 id="miap"><miap></h2>
<p>Corresponds to the MIAP instruction. Normally
<move> is a better choice for moving points, but this
element is provided to facilitate low-level programming.</p>
<p>Positions a point a specified distance from the grid
origin.</p>
<h3>Content</h3>
<p>
A single point.
</p>
<h3>Attributes</h3>
<dl>
<dt>distance</dt>
<dd>
Required. The name of a control value.
</dd>
<dt>round</dt>
<dd>
Optional. The value may be "yes" or "no", the name of a
standard or custom round state, or any number or expression
to use as an input for SROUND. The default value is "yes."
This attribute determines whether and how to round the
distance between the reference point and the moved point.
</dd>
<dt>cut-in</dt>
<dd>
Optional. The value may be "yes" or "no". The default is
"yes." Whether to use the control value cut-in. If rounding
is used, this will always be <tt>yes</tt>, even if you set
it to <tt>no</tt>.
</dd>
</dl>
<h2 id="minimum"><minimum></h2>
<p>Yields the lesser of the two values <tt>value1</tt> and
<tt>value2</tt>.</p>
<pre>
<minimum value1="lc-vert-stem" value2="1p" result-to="lc-vert-stem"/></pre>
<h3>Content</h3>
<p>None.</p>
<h3>Attributes</h3>
<dl>
<dt>value1</dt>
<dd>
Required except when <minimum> is the child of a
<formula> element. Any value or expression.
</dd>
<dt>value2</dt>
<dd>
Required except when <minimum> is the child of a
<formula> element. Any value or expression.
</dd>
<dt>result-to</dt>
<dd>
Optional; not allowed when <minimum> is the child of a
<formula>. The name of a variable in which to store
the result. If <tt>result-to</tt> is omitted where allowed,
the compiler issues a warning and the result is left on the
stack.
</dd>
</dl>
<h2 id="mirp"><mirp></h2>
<p>Corresponds to the MIRP instruction, but attempts, insofar as it
is practical, to separate rounding and the cvt cut-in. You can
specify <tt>round="no"</tt> and <tt>cut-in="yes"</tt> or both
<tt>no</tt> or both <tt>yes</tt>,
but not <tt>round="yes"</tt> and <tt>cut-in="no"</tt>.
That produces an error-message.</p>
<p>This will take care of setting RP0 beforehand if a reference point
is included.</p>
<pre>
<mirp distance="lc-x-height">
<reference>
<point num="p1"/>
</reference>
<point num="p2"/>
</mirp></pre>
<h3>Content</h3>
<p>
An optional <reference> element (containing one point),
followed by a single <point>.
</p>
<h4>Attributes</h4>
<dl>
<dt>distance</dt>
<dd>
Required. The name of a control value. Distance (from a
<control-value> element) relative to the reference
point (or to RP0 if that was set by a previous instruction).
</dd>
<dt>round</dt>
<dd>
Optional. The value may be "yes" or "no", the name of a
standard or custom round state, or any number or expression
to use as an input for SROUND. The default value is "yes."
This attribute determines whether and how to round the
distance between the reference point and the moved point.
</dd>
<dt>cut-in</dt>
<dd>
Optional. The value may be "yes" or "no". The default is
"yes." Whether to use the control value cut-in. If rounding
is used, this will always be <tt>yes</tt>, even if you set
it to <tt>no</tt>.
</dd>
<dt>min-distance</dt>
<dd>
Optional. Permitted values are "yes" and "no". The default
is "yes." Whether or not to maintain a minimum distance
between the reference point and the moved point.
</dd>
<dt>set-rp0</dt>
<dd>
Optional. Permitted values are "yes" and "no". The default
is "no." Whether or not to set the RP0 pointer to the moved
point after the instruction is executed.
</dd>
<dt>color</dt>
<dd>
Optional. Permitted values are "black", "white" and
"gray". The default is "gray." The kind of distance between
the reference point and the moved point. This is used by
some TrueType engines to compensate for engine
characteristics.
</dd>
</dl>
<h2 id="modifier"><modifier></h2>
<p>
When used as the content of a <command> element,
controls one or two bits of the output instruction.
</p>
<h3>Content</h3>
<p>None.</p>
<h3>Attributes</h3>
<dl>
<dt>type</dt>
<dd>
Required. Must be one of the following: "set-rp0", "round",
"minimum-distance", "color", "grid-fitted", "to-line",
"axis", "ref-ptr". This determines which bits are affected.
</dd>
<dt>value</dt>
<dd>
Required. The possible values vary with the
<tt>type</tt>. For details and defaults, see the <a
href="low-level.html#command">"Low-Level Elements"</a>
section.
</dd>
</dl>
<h2 id="move"><move></h2>
<p>Moves a point and, optionally, aligns other points with it
or moves other points in relation to it. For details, see the section
on <a href="moves.html">moving points</a>.</p>
<h3>Content</h3>
<p>
An optional <reference> element containing one
<point>; then a required <point>. This may be
followed by any number of the following elements, in this
order:
</p>
<ul>
<li><delta></li>
<li><align>,
<interpolate>,
<shift> (in any order),</li>
<li><move></li>
<li><delta></li>
</ul>
<p>
The first group of <delta> element is executed before
the embedded <align>, <interpolate>, <shift>
and <move> elements; the second group is executed
afterwards. A <move> may contain <interpolate>
only if <reference> is present.
</p>
<h3>Attributes</h3>
<dl>
<dt>distance</dt>
<dd>
Optional. The name of a <control-value> element. If a
<tt>distance</tt> is specified, the target point is
positioned that distance either from the reference point or
from the grid origin. If a <tt>distance</tt> is not
specified, the distance from the original outline is
used. In either case, the <tt>distance</tt> is measured
along the projection vector.
</dd>
<dt>pixel-distance</dt>
<dd>
Optional. A distance in pixels. If a <tt>pixel-distance</tt>
is specified, the target point is positioned that distance
either from the reference point or from the grid origin. The
<tt>distance</tt> and <tt>pixel-distance</tt> attributes are
not compatible, and the schema does not permit both to be
present.
</dd>
<dt>round</dt>
<dd>
Optional. The value may be "yes" or "no", the name of a
standard or custom round state, or any number or expression
to use as an input for SROUND. The default is "yes." Whether
and how to round the <tt>distance</tt> or
<tt>pixel-distance</tt>. "Yes" means round the distance
according to the current round state (to-grid, if you
haven't changed it). If you specify "no", no rounding is
done. To use one of the standard round states, use
<tt>to-grid, to-half-grid, to-double-grid, down-to-grid</tt>
or <tt>up-to-grid</tt>. To use a custom round state defined
in the top level of the program (as a child of
<xgridfit>), use its name. Finally, any number
(constant, variable) is passed to SROUND for the TrueType
engine to interpret. Setting the round state with this
attribute has no effect except in this instruction: the
round state returns to its former value after the
instruction is executed. If several <move>
instructions use the same round state, it is more efficient
to enclose them in a <with-round-state> element than
to include a <tt>round</tt> attribute with each one. That is
also true if the <tt>round</tt> value is to be <tt>no</tt>:
in that case use <tt><with-round-state
round="no"></tt> and omit the <tt>round</tt> attribute
for the <move> instructions.
</dd>
<dt>cut-in</dt>
<dd>
Whether to use the Control Value cut-in; or a cut-in value
to use. Legal values are "yes", "no" or any value or
expression; the default value is "yes". If the value of this
attribute is <tt>no</tt>, the value of the <tt>round</tt>
attribute must also be "no". (This is a peculiarity
of the TrueType instruction set and has nothing to do with
Xgridfit.) This attribute has an effect only when the
<tt>distance</tt> attribute is present.
</dd>
<dt>min-distance</dt>
<dd>
Optional. The value may be "yes" or "no" or any value or
expression to be used to set the minimum distance for this
operation. This attribute has an effect only when there is
a reference point.
</dd>
<dt>color</dt>
<dd>
Optional. Permitted values are "black", "white" and
"gray". The default is "gray." The kind of distance between
the reference point and the moved point. This is used by
some TrueType engines to compensate for engine
characteristics. This applies only when there is a reference
point.
</dd>
</dl>
<h2 id="move-point-to-intersection"><move-point-to-intersection></h2>
<p>Moves a point to the intersection of two lines.
Each of the lines must be wholly in
a single zone, so if specifying the zone use the <tt>zone</tt>
attribute of the <line> elements rather than the <tt>zone</tt>
attributes of the <point> elements that make up the
lines.</p>
<pre>
<move-point-to-intersection>
<point num="p"/>
<line>
<point num="l1p1"/>
<point num="l1p2"/>
</line>
<line>
<point num="l2p1"/>
<point num="l2p2"/>
</line>
</move-point-to-intersection></pre>
<h3>Content</h3>
<p>
A single <point> and two <line> elements.
</p>
<h3>Attributes</h3>
<p>None.</p>
<h2 id="multiply"><multiply></h2>
<p>Multiplies <tt>value1</tt> by <tt>value2</tt>. If there is no
<tt>result-to</tt> attribute, Xgridfit attempts to write the
result to <tt>value1</tt>.</p>
<pre>
<multiply value1="lc-vert-stem" value2="3.3" result-to="v"/></pre>
<h3>Content</h3>
<p>None.</p>
<h3>Attributes</h3>
<dl>
<dt>value1</dt>
<dd>
Required except when <multiply> is the child of a
<formula> element. Any value or expression.
</dd>
<dt>value2</dt>
<dd>
Required except when <multiply> is the child of a
<formula> element. Any value or expression.
</dd>
<dt>result-to</dt>
<dd>
Optional; not allowed when <multiply> is the child of
a <formula>. The name of a variable in which to store
the result. If <tt>result-to</tt> is omitted where allowed,
the compiler issues a warning and the result is left on the
stack.
</dd>
</dl>
<h2 id="negate"><negate></h2>
<p>
Converts positive to negative numbers; negative numbers stay
negative. If the <tt>result-to</tt> attribute is not present,
Xgridfit attempts to write the result back to
<tt>value</tt>. Failing that, it issues a warning and leaves
the result on the stack.
</p>
<pre>
<negate value="v"/></pre>
<h3>Content</h3>
<p>None.</p>
<h3>Attributes</h3>
<dl>
<dt>value</dt>
<dd>
Required, except when <negate> is the child of a
<formula>. Any value or expression. The value to operate on.
</dd>
<dt>result-to</dt>
<dd>
Optional; not allowed when <negate> is the child of a
<formula>. The name of a variable or control value in
which to store the result. If <tt>result-to</tt> is omitted
where allowed, and <tt>value</tt> is a variable or control
value, the result is written to <tt>value</tt>. If
<tt>value</tt> cannot be written to, the compiler issues a
warning and the result is left on the stack.
</dd>
</dl>
<h2 id="no-compile"><no-compile></h2>
<p>
This element, which must always be a child of
<xgridfit>, contains <glyph> elements (usually
imported via XInclude) which are visible for reference
purposes but not compiled. If a file <tt>MyFont-Basic.xgf</tt>
contains a glyph program with an opening tag that looks like
this:
</p>
<pre>
<glyph ps-name="a" xml:id="a"></pre>
<p>
then that glyph program can be made visible within another
file thus:
</p>
<pre>
<no-compile>
<xi:include href="MyFont-Basic.xgf#a"/>
</no-compile></pre>
<p>
Now the following <point> will compile correctly:
</p>
<pre>
<point num="a/top + another-num"</pre>
<p>
The glyph included in this way can also be compiled via
<call-glyph>:
</p>
<pre>
<call-glyph ps-name="a">
<with-param name="left-sidebearing" value="111"/>
</call-glyph></pre>
<p>
The <no-compile> element can be overridden with the
<glyph-select> element (<tt>glyph-select</tt> parameter
or <tt>-g</tt> option). This behavior may ease the testing of
programs for composite glyphs.
</p>
<h3>Content</h3>
<p>
One or more <glyph> elements; more typically,
<xi:include> elements importing <glyph> elements
from other files.
</p>
<h3>Attributes</h3>
<p>None.</p>
<h2 id="no-round"><no-round></h2>
<p>
Like round, but without the rounding. That is, it may apply a
correction for the "color" of the distance, but it will not
round the distance. If the <tt>result-to</tt> attribute is not
present, Xgridfit attempts to write the result back to
<tt>value</tt>. Failing that, it issues a warning and leaves
the result on the stack.
</p>
<pre>
<no-round value="v1" color="black" result-to="v2"/></pre>
<h3>Content</h3>
<p>None.</p>
<h3>Attributes</h3>
<dl>
<dt>value</dt>
<dd>
Required, except when <no-round> is the child of a
<formula>. Any value or expression. A distance on the current
grid; the value to operate on.
</dd>
<dt>color</dt>
<dd>
Optional. Permitted values are "black", "white" and
"gray". The default is "gray." The kind of distance that the
<tt>value</tt> represents. This is used by some TrueType
engines to compensate for engine characteristics.
</dd>
<dt>result-to</dt>
<dd>
Optional; not allowed when <no-round> is the child of
a <formula>. The name of a variable or control value
in which to store the result. If <tt>result-to</tt> is
omitted where allowed, and <tt>value</tt> is a variable or
control value, the result is written to <tt>value</tt>. If
<tt>value</tt> cannot be written to, the compiler issues a
warning and the result is left on the stack.
</dd>
</dl>
<h2 id="no-warning"><no-warning></h2>
<p>
Inside a <no-warning></no-warning> block, warning
messages are suppressed. Use this if you find a particular
warning message annoying and you want to assure the compiler
that you know what you're doing.
</p>
<h3>Content</h3>
<p>
Programming of any kind.
</p>
<h3>Attributes</h3>
<p>None.</p>
<h2 id="outfile"><outfile></h2>
<p>
Contains the name of a file to write. If the filename ends
<tt>.sfd</tt> it is assumed that a FontForge source file is
desired, and the generated FontForge script ends with a "Save"
command. If the filename ends <tt>.ttf</tt> it is assumed that
a TrueType font is desired, and the generated FontForge script
ends with a "Generate" command. It is an error if the filename
has any other suffix.
</p>
<p>
The <tt>fmflags</tt> attribute indicates flags to pass to
FontForge when generating a TrueType font. It has no effect
when the <outfile> is a FontForge source file. For a
list of these flags, see the documentation for the <a
href="http://fontforge.sourceforge.net/scripting-alpha.html#G">Generate</a>
command. Probably the most likely to be used is "2048"
(generate old-style kern table).
</p>
<pre>
<infile>MyFont.sfd</infile>
<outfile fmflags="2048">MyFont.ttf</outfile></pre>
<h3>Content</h3>
<p>
The name of a file, with extension of either <tt>.sfd</tt> or
<tt>.ttf</tt>.
</p>
<h3>Attributes</h3>
<dl>
<dt>fmflags</dt>
<dd>
Optional. An integer. Flags to be passed to the FontForge
"Generate" command. This has no effect when Python output is
selected; instead, use <tt>pyflags</tt>.
</dd>
<dt>pyflags</dt>
<dd>
A list of flags for FontForge to use when it generates a
font. This is a space-separated list of tokens,
e.g. <tt>pyflags="old-kern ofm"</tt>. Possible tokens are:
afm, pfm, tfm, ofm, composites-in-afm, glyph-map-file,
short-post, apple, opentype, old-kern, dummy-dsig,
TeX-table, round, no-hints, omit-instructions,
PfEd-comments, PfEd-colors, PfEd-lookups, PfEd-guidelines,
PfEd-background, symbol. For the meanings of these, see the
section of the FontForge manual on <a
href="http://fontforge.sourceforge.net/python.html#f-generate">generating
fonts in Python scripts</a>.
</dd>
</dl>
<h2 id="outfile-base"><outfile-base></h2>
<p>
This element, which must be a child of <xgridfit>,
corresponds to the <tt>outfile-base</tt> parameter and the
<tt>-S</tt> option for the <tt>xgridfit</tt> shell script. If
present, it causes a separate file to be output for every
glyph that Xgridfit compiles. The name of the file is the
string supplied in this element, plus the <tt>ps-name</tt> of
the glyph, plus the extension .pe, .py or .debug. For example,
this element
</p>
<pre>
<outfile-base>Test</outfile-base></pre>
<p>
causes Xgridfit to output files with names like
<tt>Test_A.pe</tt> and <tt>Test_B.py</tt> (or
<tt>Test_A.py</tt> and <tt>Test_B.pe</tt> when Python output
is requested). Elements such as control values, functions and
the pre-program are output as usual in the default output
script or in a file specified with the -O option. Note that
this element also causes the output of <outfile> to be
saved in a separate script whose default name depends on
<outfile-base>. See <a
href="#outfile-script-name"><outfile-script-name></a> to
specify a different name for this separate file.
</p>
<p>
This feature depends on the presence of an extension element
that not every XSLT processor supports. Xsltproc, which
Xgridfit uses by default, does support it.
</p>
<h3>Content</h3>
<p>
A fragment of a file name, from which other file names are
built.
</p>
<h3>Attributes</h3>
<p>None.</p>
<h2 id="outfile-script-name"><outfile-script-name></h2>
<p>
When the <outfile-base> element is present or the
<tt>-S</tt> option is used, and the <outfile> element is
present or the <tt>-o</tt> option is used, Xgridfit outputs
the FontForge command that saves a font file or generates a
font in a separate script file. By default the filename for
this script is based on the outfile-base: for example, if the
-S parameter is <tt>MyFont</tt>, then the filename will be
<tt>MyFont_outfile.pe</tt> or <tt>MyFont_outfile.py</tt>. Use
the <outfile-script-name> element (or the <tt>-z</tt>
option) to specify a filename other than the default. This
element must be a child of <xgridfit>.
</p>
<p>
This element has no effect when the outfile-base is not
specified, and the glyph programs in a script are not being
saved separately.
</p>
<h3>Content</h3>
<p>
Name of a file containing the FontForge "Generate" or "Save"
command.
</p>
<h3>Attributes</h3>
<p>None.</p>
<h2 id="params"><param></h2>
<p>
A <param> element is a declaration that a value, a
structure or some code may be passed to the <function>,
<macro> or <glyph> that contains it by the "call"
element that calls it. The <param> elements should be
the first children of <function>, <macro> and
<glyph> elements.
</p>
<p>
In the case of a <function>, only a value (a single
number) may be passed. A <macro> or <glyph> is
much more flexible: <line>, <range>, <set>
and fragments of code may be passed. Within the <macro>
or <glyph>, the structures can be referenced via
<tt>ref</tt> attributes; code passed as a parameter can be
called via a <call-param> element.
</p>
<p>
A <param> may contain a default <tt>value</tt>--that is,
a value to be used in the event that the call element does not
pass a value. The <param> may also contain code to be
used when the call element does not pass code; but it may not
contain a <line>, <range> or <set>.
</p>
<h3>Content</h3>
<p>
Normally this element is empty; but a <param> intended
to pass code to a <macro> or <glyph> may contain
code to be used when the <call-macro> or
<call-glyph> element lacks a matching <with-param>
element.
</p>
<h3>Attributes</h3>
<dl>
<dt>name</dt>
<dd>
Required. A name: any sequence of letters, numbers, hyphens,
periods; no spaces permitted. The name of the <param>
is used both by the call element and by the code that
requires the value or item passed.
</dd>
<dt>value</dt>
<dd>
Optional. A default value.
</dd>
</dl>
<h2 id="param-set"><param-set></h2>
<p>
Contains a set of parameters (each encoded as a
<with-param> element) to be passed to a function or
macro. There may be more than one of these in a
<call-function> or <call-macro> element; and in
that case the function is called repeatedly (via LOOPCALL)
until the list of <param-set> elements is exhausted; or
the macro code is compiled and inserted repeatedly.
</p>
<h3>Content</h3>
<p>
One or more <with-param> elements.
</p>
<h3>Attribute</h3>
<dl>
<dt>opt</dt>
<dd>
Optional. If set to "yes," forces optimization in pushing function
parameters onto the stack. That is, instructs Xgridfit to
push all parameters with a single PUSHB command. Use this if
you are sure that all parameters can be determined by the
compiler (i.e. they are not determined at run-time) and that
they are all between 0 and 255, but Xgridfit is not
optimizing. If you get this wrong, that is, if you force
optimization when it really ought not to be used, incorrect
code will be generated and your glyph program will
fail. Still, it may be worth a try since the failure will
probably be obvious. Conversely, set this to "no" if
Xgridfit is incorrectly optimizing the parameters in a
function call. This probably won't happen, since Xgridfit
optimizes rather conservatively, but it's here just in case.
</dd>
</dl>
<h2 id="point"><point></h2>
<p>
The <point> element defines a point. It is used in all
instructions that manipulate or refer to points.
</p>
<h3>Content</h3>
<p>None.</p>
<h3>Attributes</h3>
<dl>
<dt>num</dt>
<dd>
Required. Any value or expression. The number of a point. To
refer to a point in a glyph other than the one whose glyph
program is currently running (as you may have occasion to do
when instructing composite glyphs), use the syntax "g/p",
where g is the ps-name of the other glyph, and p is the
point being referred to (it must be the name of a
<constant> declared in the other glyph).
</dd>
<dt>zone</dt>
<dd>
Optional. Permitted values are "twilight" and "glyph". The
zone that contains this point. Instructions will take note
of this attribute, when present, and adjust the zone
pointers appropriately. The glyph zone is always the default
zone. When a point is in the glyph zone it is generally
redundant to include an attribute <tt>zone="glyph"</tt>, and
doing so may also cause unnecessary (though harmless) code
to be generated. N.B. For instructions that deal with lists
of points, include the zone attribute only in the first.
</dd>
</dl>
<h2 id="pre-program"><pre-program></h2>
<p>
The prep table (or CVT program) is made from the
<pre-program> element. It contains instructions that are
executed before a font is rasterized, or whenever it is about
to be rasterized in a new size. A typical thing to do in the
<pre-program> is to adjust control values, e.g. rounding
or applying deltas to them. Another is to set defaults: an
instruction that assigns a value to a graphic variable sets a
default when it is executed in the <pre-program>. For
example, if executed in the <pre-program> this
instruction:
</p>
<pre>
<set-minimum-distance value="0.9"></pre>
<p>
ensures that the minimum-distance graphics variable is always
0.9 pixels at the beginning of any glyph program.
</p>
<p>
The <pre-program> element must be present in a complete
Xgridfit program, even if it is empty.
</p>
<h3>Content</h3>
<p>
One or more optional <variable> and <alias>
elements, followed by optional programming.
</p>
<h3>Attribute</h3>
<dl>
<dt>xml:id</dt>
<dd>
Optional. A valid XML ID, i.e. any sequence of letters,
numbers, hyphens, periods; no spaces permitted; and unique
within the program. This ID may be used if the
<pre-program> is imported into a file using XInclude.
</dd>
</dl>
<h2 id="ps-private"><ps-private></h2>
<p>
Provides access to the font's private PostScript
dictionary. This dictionary is not included in a TrueType
font, but it does provide crucial information to the FontForge
auto-hinter; and the FontForge auto-instructor, in turn,
depends on the presence of PostScript-style hints. For
details, see <a href="merge-mode.html">Merge-mode</a>.
</p>
<h3>Content</h3>
<p>
One or more <entry> elements, each supplying the name
and value of an entry in the PostScript private
dictionary. For example:
</p>
<pre>
<ps-private>
<entry name="BlueValues" value="-33 -2 856 873 1358 1385"/>
<entry name="OtherBlues" value="-578 -553"/>
<entry name="BlueFuzz" value="0"/>
</ps-private>
</pre>
<h2 id="push"><push></h2>
<p>
The <push> element does the work of the various PUSHB
and PUSHW instructions, and it can generate the code to move
any value (e.g. a variable or control-value) onto the
stack. It may be used in combination with <command> to
insert low-level TrueType commands into your Xgridfit
programming in a portable way. Its content is a
whitespace-delmited list of numbers, identifiers and
expressions. These are valid Xgridfit <push>
instructions:
</p>
<pre>
<push>2 5 89 67</push>
<push>
left
right
lc-vertical-stem
-1
</push>
<push> 0.58p 2.0 to-grid </push>
<push>1 (top + 3) 512</push></pre>
<p>
It is essential that all expressions containing whitespace be
enclosed in parentheses.
</p>
<h3>Content</h3>
<p>
A space-delimited list of values and expressions.
</p>
<h3>Attributes</h3>
<p>None.</p>
<h2 id="range"><range></h2>
<p>
A <range> is a collection of contiguous points defined
by its end-points. It can be used in any instruction that
operates on more than one point: <shift>, <align>,
<interpolate>, <shift-absolute>,
<toggle-points>. The order of points in the
<range> is not significant. Example:
</p>
<pre>
<align>
<reference>
<point num="bottom"/>
</reference>
<range>
<point num="bottom - 2"/>
<point num="bottom + 2"/>
</range>
</align></pre>
<p>
If "bottom" is point 17, the <range> begins with 15 and
ends with 19. But any reference point in the parent element of
the <range> is excluded from the <range>, so this
<range> actually represents points 15, 16, 18 and
19. The same is true of implicit reference points supplied by
a <move> element that is the parent of the parent of the
<range>:
</p>
<pre>
<move>
<point num="bottom"/>
<align>
<range>
<point num="bottom - 2"/>
<point num="bottom + 2"/>
</range>
</align>
</move></pre>
<p>
Here the points in the <range> are aligned with "bottom"
after it has been moved by the <move> instruction; but
"bottom" itself is not part of the <range>. The code
above is functionally identical to this:
</p>
<pre>
<move>
<point num="bottom"/>
<align>
<point num="bottom - 2"/>
<point num="bottom - 1"/>
<point num="bottom + 1"/>
<point num="bottom + 2"/>
</align>
</move></pre>
<p>
The latter generates more efficient code than the example with
the <range>, but the <range> is more flexible,
since its endpoints, its size, and the points to be excluded
need not be known until run-time. This makes the <range>
ideal for use in functions.
</p>
<p>
All the points in a <range> must be in the same zone,
determined by the optional <tt>zone</tt> attribute on the
<range> element. Any <tt>zone</tt> attributes on the
<point>s within the <range> are ignored.
</p>
<h3>Content</h3>
<p>
Two <point> elements. These are required if no
<tt>ref</tt> attribute is present.
</p>
<h3>Attributes</h3>
<dl>
<dt>name</dt>
<dd>
Optional, but necessary if this <range> is referred to
elsewhere. A name: any sequence of letters, numbers,
hyphens, periods; no spaces permitted. Names this
<range>.
</dd>
<dt>ref</dt>
<dd>
Required if no <point> elements are present. A
reference to a named <range>.
</dd>
<dt>zone</dt>
<dd>
Optional. Permitted values are "twilight" and
"glyph".
</dd>
</dl>
<h2 id="restore-default"><restore-default></h2>
<p>
To reset any of the graphics variables tracked by Xgridfit to
its default value (that is, the value set by your Xgridfit
program via a <default> element or by setting it in the
<pre-program>--failing that, the TrueType default), use
the <restore-default> element. Use the value
<tt>all</tt> to reset <em>all</em> graphics variables,
including the freedom and projection vectors and the auto-flip
state, which Xgridfit does not track. The <tt>all</tt> option
sets these last to their TrueType defaults: the x axis for the
vectors and "on" for auto-flip.
</p>
<pre>
<restore-default name="minimum-distance"/></pre>
<h3>Content</h3>
<p>None.</p>
<h3>Attribute</h3>
<dl>
<dt>name</dt>
<dd>
The name of the graphics variable to restore to its
default value. Possible values are "minimum-distance",
"control-value-cut-in", "single-width",
"single-width-cut-in", "delta-base", "delta-shift",
"round-state", "all".
</dd>
</dl>
<h2 id="reference"><reference></h2>
<p>
In any instruction that can position a point or other
structure with reference to one or more points, the
<reference> element holds the reference point(s). This
element generally contains precisely one point, but when it is
the child of an <interpolate> element it must contain
two points. In the following example, point p2 is moved
relative to point p1:
</p>
<pre>
<move>
<reference>
<point num="p1"/>
</reference>
<point num="p2"/>
</move></pre>
<h3>Content</h3>
<p>
A single <point>. When the <reference> element is
the child of <interpolate>, two points.
</p>
<h3>Attributes</h3>
<p>None.</p>
<h2 id="round"><round></h2>
<p>
Rounds a number representing a distance according to the
current round state, applies whatever correction is
appropriate for the "color" of the distance, and returns the
result.
</p>
<pre><round value="lc-vert-stem" color="black" result-to="new-cvt"/></pre>
<h3>Content</h3>
<p>None</p>
<h3>Attributes</h3>
<dl>
<dt>value</dt>
<dd>
Required, except when the child of <formula>. Any
value or expression, understood as a distance on the current
grid. This is the number to round.
</dd>
<dt>color</dt>
<dd>
Optional. Permitted values are "black", "white" and
"gray". The default is "gray." The kind of distance that the
<tt>value</tt> represents. This is used by some TrueType
engines to compensate for engine characteristics.
</dd>
<dt>result-to</dt>
<dd>
Optional; not allowed when <round> is the child of a
<formula>. The name of a variable or control value in
which to store the result. If <tt>result-to</tt> is omitted
where allowed, and <tt>value</tt> is a variable or control
value, the result is written to <tt>value</tt>. If
<tt>value</tt> cannot be written to, the compiler issues a
warning and the result is left on the stack.
</dd>
</dl>
<h2 id="round-state"><round-state></h2>
<p>
Declares a custom round state whose name can be passed to
<set-round-state>, <with-round-state>, or any
element that takes a <tt>round</tt> attribute. For an
explanation of the <tt>period</tt>, <tt>phase</tt> and
<tt>threshold</tt> attributes, see "<a
href="round.html">Rounding</a>." Note that only a limited number
of values is permitted for each of these attributes. This
element is permitted only at the top level of a program, as a
child of <xgridfit>.
</p>
<pre>
<round-state name="my-round" period="two-pixel"
phase="three-quarters"
threshold="three-quarters"/></pre>
<h3>Content</h3>
<p>None.</p>
<h3>Attributes</h3>
<dl>
<dt>name</dt>
<dd>
Required. A name: any sequence of letters, numbers, hyphens,
periods; no spaces permitted. This is the name under which
the program may refer to this round state.
</dd>
<dt>period</dt>
<dd>
Required. One of the following: "half-pixel", "one-pixel",
"two-pixel".
</dd>
<dt>phase</dt>
<dd>
Required. One of the following: "zero", "one-quarter",
"one-half", "three-quarters".
</dd>
<dt>threshold</dt>
<dd>
Required. One of the following: "period-minus-one",
"minus-three-eighths", "minus-one-quarter",
"minus-one-eighth", "zero", "one-eighth", "one-quarter",
"three-eighths", "one-half", "five-eighths",
"three-quarters", "seven-eighths", "one", "nine-eighths",
"five-quarters", "eleven-eighths".
</dd>
</dl>
<h2 id="set"><set></h2>
<p>
A <set> is an arbitrary collection of points, defined by
the <point> elements contained in the <set>
element. The <set> can be used by any element that
accepts a collection of points: <align>,
<interpolate>, <shift>, <shift-absolute>,
<toggle-points>.
</p>
<p>
A <set> can be used only in a <glyph> program, or
it can be referenced in a <macro> called by a
<glyph> program. The name of a <set> can be passed
to a macro as a parameter, and a <set> can be the
content of a <with-param> element.
</p>
<p>
Xgridfit must be able to resolve the <tt>num</tt> attributes
of all <point>s in a <set> at compile time. It is
an error to attempt to reference a variable in a <set>.
</p>
<p>
When a <set> is used in an element that has reference
points, either explicitly via the <reference> element
or implicitly via an enclosing <move> element, any
reference points repeated in the set are excluded. This works
only when the <reference> points can be resolved at
compile time.
</p>
<p>
A <set> may be preferable to a <range> when all
point numbers are known at compile time and the range is
short, including perhaps three or four points. The code
generated by Xgridfit on encountering a <set> is less
flexible, but vastly more efficient than that generated on
encountering a <range>.
</p>
<p>
A <set> may be defined thus among the declarations at
the beginning of a <glyph>:
</p>
<pre>
<set name="bar-bottom-left-corner">
<point num="bar-bottom-left"/>
<point num="bar-bottom-left + 1"/>
<point num="bar-bottom-left + 2"/>
</set>
<set name="bar-bottom-right-corner">
<point num="bar-bottom-right"/>
<point num="bar-bottom-right - 1"/>
<point num="bar-bottom-right - 2"/>
</set></pre>
<p>
It can then be referenced whenever needed:
</p>
<pre>
<move distance="cap-horz-stem">
<reference>
<point num="bar-top-left"/>
</reference>
<point num="bar-bottom-left"/>
<shift>
<set ref="bar-bottom-left-corner"/>
<set ref="bar-bottom-right-corner"/>
</shift>
</move></pre>
<h3>Content</h3>
<p>
One or more <point> elements. These are required if no
<tt>ref</tt> element is present.
</p>
<h3>Attributes</h3>
<dl>
<dt>name</dt>
<dd>
Optional, but necessary if this <set> is referred to
elsewhere. A name: any sequence of letters, numbers,
hyphens, periods; no spaces permitted. Names this
<set>.
</dd>
<dt>ref</dt>
<dd>
Required if no <point> elements are present. A
reference to a named <set>.
</dd>
<dt>zone</dt>
<dd>
Optional. Permitted values are "twilight" and
"glyph".
</dd>
</dl>
<h2 id="set-auto-flip"><set-auto-flip></h2>
<p>
When "on" (the default setting), the TrueType engine
automatically adjusts the signs of control values when
executing MIRP and MIAP instructions. This works very well, so
there is rarely a reason to set this to "off."
</p>
<h3>Content</h3>
<p>None.</p>
<h3>Attribute</h3>
<dl>
<dt>value</dt>
<dd>
Required. Permitted values are "on" and "off".
</dd>
</dl>
<h2 id="set-control-value"><set-control-value><br/>
<with-control-value></h2>
<p>
You can assign a value to a control value anywhere: in the
<pre-program>, a <function>, or a <glyph>
program. The value you assign can be either in font units (the
units of the grid on which you designed the font) or in pixel
units (the grid on which the glyph is now being
rasterized). To specify which, include the attribute
<tt>unit="font"</tt> or <tt>unit="pixel"</tt> ("font" is the
default). You must specify the name of the control value with
the <tt>name</tt> attribute and the value (an integer in font
units or an "F26Dot6" number in pixel units) with the
<tt>value</tt> attribute.
</p>
<p>
You can use <set-control-value> to make a control value
<a href="cvt.html#local">simulate a local variable</a>.
</p>
<p>
Use <with-control-value>, which takes attributes exactly
like those of <set-control-value>, to assign a control
value to be used only within the <with-control-value>
element. After this element, the value will be the same as it
was before.
</p>
<pre>
<set-control-value name="myval" unit="font" value="850"/>
<set-control-value name="otherval" unit="pixel"
value="control-value(otherval) * 2"/>
<with-projection-vector axis="y">
<set-control-value name="myval" unit="pixel"
value="point(a) --- point(b)"/>
</with-projection-vector></pre>
<h3>Content</h3>
<p>
None for <set-control-value>; <with-control-value>
contains programming of any kind.
</p>
<h3>Attributes</h3>
<dl>
<dt>name</dt>
<dd>
Required. The name of the control value to set.
</dd>
<dt>value</dt>
<dd>
Required. Any value or expression. The value to write to the
control value.
</dd>
<dt>unit</dt>
<dd>
Optional. Permitted values are "font" and "pixel"; the
default is "font". Whether the value is in font units or
pixel units.
</dd>
</dl>
<h2 id="set-control-value-cut-in"><set-control-value-cut-in><br/>
<with-control-value-cut-in></h2>
<p>
The <tt>value</tt> is a <a
href="types.html#grid-distance">distance on the grid</a>. If
the difference between a distance from a
<control-value> element and the original distance is
greater than this, the original distance is used. The effect
is generally to use the <control-value> distance at low
resolutions and the original distance at high
resolutions. This can be used to promote evenness at small
sizes, where a 1-pixel difference between the width of (say) p
and b can look bad. The default value is 17/16: that is,
1.0625p or 68.
</p>
<pre>
<set-control-value-cut-in value="1.1"/></pre>
<h3>Content</h3>
<p>
<set-control-value-cut-in> has no content;
<with-control-value-cut-in> contains programming.
</p>
<h3>Attribute</h3>
<dl>
<dt>value</dt>
<dd>
Required. Any value or expression. This is the new control
value cut-in.
</dd>
</dl>
<h2 id="set-coordinate"><set-coordinate></h2>
<p>Moves a point to a coordinate determined by the
freedom and projection vectors. On the rare occasions when
you need a command like this one, it is probably better to
use <move> with the <tt>pixel-distance</tt> attribute.</p>
<h3>Content</h3>
<p>
A <point> to move.
</p>
<h3>Attribute</h3>
<dl>
<dt>coordinate</dt>
<dd>
Required. Any value or expression. This is the new
coordinate of the point.
</dd>
</dl>
<h2 id="set-delta-base"><set-delta-base><br/><with-delta-base></h2>
<p>
Sets the number that is added to the "size" attribute of a
<delta-set> element to get the resolution at which an
adjustment should take place. The default value is 9, and that
rarely needs to be changed.
</p>
<pre>
<with-delta-base value="56">
<delta>
<delta-set size="12" distance="-8">
<point num="p"/>
</delta-set>
</delta>
</with-delta-base></pre>
<h3>Content</h3>
<p>
<set-delta-base> has no content; <with-delta-base>
contains programming.
</p>
<h3>Attribute</h3>
<dl>
<dt>value</dt>
<dd>
Required. Any value or expression. This is the new delta
base.
</dd>
</dl>
<h2 id="set-delta-shift"><set-delta-shift><br/><with-delta-shift></h2>
<p>
The unit by which a delta instruction shifts a point. If the
unit is "2," the smallest shift is half a pixel; if "4," it is
a quarter of a pixel; if "8" (the default) it is one eighth,
and so on.
</p>
<pre>
<set-delta-shift value="32"/></pre>
<h3>Content</h3>
<p>
<set-delta-shift> has no content;
<with-delta-shift> contains programming.
</p>
<h3>Attribute</h3>
<dl>
<dt>units-per-pixel</dt>
<dd>
Required. These values are permitted: "2", "4", "8", "16",
"32", "64".
</dd>
</dl>
<h2 id="set-dropout-control"><set-dropout-control></h2>
<p>
Sets up dropout control. The <tt>threshold</tt> is a number
between 0 and 254 in pixels per em. The <tt>flags</tt>
attribute is a number that tells how to set up dropout control
relative to the threshold. Here are the flags as explained in
the <a
href="http://developer.apple.com/textfonts/TTRefMan/RM05/Chap5.html#SCANCTRL">Apple
TrueType Reference</a>:
</p>
<ul>
<li>
<i>1. Set dropout control to TRUE if other conditions do not block
and ppem is less than or equal to the threshold value.</i>
</li>
<li>
<i>2. Set dropout control to TRUE if other conditions do not block
and the glyph is rotated.</i>
</li>
<li>
<i>4. Set dropout control to TRUE if other conditions do not block
and the glyph is stretched.</i>
</li>
<li>
<i>8. Set dropout control to FALSE unless ppem is less than or
equal to the threshold value.</i>
</li>
<li>
<i>16. Set dropout control to FALSE unless the glyph is rotated.</i>
</li>
<li>
<i>32. Set dropout control to FALSE unless the glyph is stretched.</i>
</li>
</ul>
<p>
Note that, for the sake of simplicity, the numbers used here
are different from those implied in the Apple TrueType
Reference. Xgridfit adjusts them before passing them to the
TrueType engine.
</p>
<p>
To turn off dropout control, set both <tt>threshold</tt> and
<tt>flags</tt> to zero.
</p>
<h3>Content</h3>
<p>None.</p>
<h3>Attributes</h3>
<dl>
<dt>threshold</dt>
<dd>
Required.
</dd>
<dt>flags</dt>
<dd>
Required.
</dd>
</dl>
<h2 id="set-dropout-type"><set-dropout-type></h2>
<p>
Sets dropout type. The <a
href="http://www.microsoft.com/typography/otspec/ttinst.htm">Microsoft
TrueType Reference</a> describes the action of the possible
values as follows:
</p>
<ul>
<li>
<i>if n=0 rules 1 and 2, and 3 are invoked (dropout control
scan conversion including stubs)</i>
</li>
<li>
<i>if n=1 rules 1, 2 and 4 are invoked (dropout control scan
conversion excluding stubs)</i>
</li>
<li>
<i>if n=2 rules 1 and 2 only are invoked (fast scan conversion;
dropout control turned off)</i>
</li>
<li>
<i>if n=3 same as n = 2</i>
</li>
<li>
<i>if n = 4 rules 1, 2, and 5 are invoked (smart dropout
control scan conversion including stubs)</i>
</li>
<li>
<i>if n = 5 rules 1, 2, and 6 are invoked (smart dropout
control scan conversion excluding stubs)</i>
</li>
<li>
<i>if n = 6 same as n = 2</i>
</li>
<li>
<i>if n = 7 same as n = 2</i>
</li>
</ul>
<p>
<i>The scan conversion rules are shown here:</i>
</p>
<dl>
<dt>Rule 1</dt>
<dd>
If a pixel’s center falls within the glyph outline, that
pixel is turned on.
</dd>
<dt>Rule 2</dt>
<dd>
If a contour falls exactly on a pixel’s center, that pixel is turned on.
</dd>
<dt>Rule 3</dt>
<dd>
If a scan line between two adjacent pixel centers (either
vertical or horizontal) is intersected by both an
on-Transition contour and an off-Transition contour and
neither of the pixels was already turned on by rules 1 and
2, turn on the left-most pixel (horizontal scan line) or the
bottom-most pixel (vertical scan line). This is “Simple”
dropout control.
</dd>
<dt>Rule 4</dt>
<dd>
Apply Rule 3 only if the two contours continue to intersect
other scan lines in both directions. That is, do not turn on
pixels for ‘stubs.’ The scanline segments that form a square
with the intersected scan line segment are examined to
verify that they are intersected by two contours. It is
possible that these could be different contours than the
ones intersecting the dropout scan line segment. This is
very unlikely but may have to be controlled with
grid-fitting in some exotic glyphs.
</dd>
<dt>Rule 5</dt>
<dd>
If a scan line between two adjacent pixel centers (either
vertical or horizontal) is intersected by both an
on-Transition contour and an off-Transition contour and
neither of the pixels was already turned on by rules 1 and
2, turn on the pixel which is closer to the midpoint between
the on-Transition contour and off-Transition contour. This
is “Smart” dropout control.
</dd>
<dt>Rule 6</dt>
<dd>
Apply Rule 5 only if the two contours continue to intersect
other scan lines in both directions. That is, do not turn on
pixels for ‘stubs.’
</dd>
</dl>
<h3>Content</h3>
<p>None.</p>
<h3>Attribute</h3>
<dl>
<dt>value</dt>
<dd>
Required. Possible values are from "0" to "7," with meanings
as described above.
</dd>
</dl>
<h2 id="set-dual-projection-vector"><set-dual-projection-vector></h2>
<p>
Like <set-projection-vector>, but the dual projection
vector can be set only from a line, and it uses the original
positions in the outline of the points that constitute the
line rather than their current positions (assuming they have
moved).
</p>
<p>
The dual projection vector is not used by every instruction:
just by <interpolate>, <get-coordinate>,
<measure-distance>, <mirp>, <mdrp>, and
<move> (only when a "relative-to" point is
present). This vector lasts only until a new projection vector
is set; then it gets canceled.
</p>
<p>
One or both points in the line may be in the twilight zone.
See the explanation for <set-vectors>.
</p>
<pre>
<with-projection-vector>
<set-dual-projection-vector to-line="orthogonal">
<line ref="line-a"/>
</set-dual-projection-vector>
<!-- programming here; then the end of the with-projection-vector
block returns the dual projection vector to its former value. -->
</with-projection-vector></pre>
<h3>Content</h3>
<p>
One <line>.
</p>
<h3>Attributes</h3>
<dl>
<dt>to-line</dt>
<dd>
Optional. Possible values are "orthogonal" and "parallel";
the default is "parallel". Determines whether the dual
projection vector will be orthogonal or parallel to the
<line> from which it is set.
</dd>
</dl>
<h2 id="set-equal"><set-equal></h2>
<p>Set <tt>target</tt> (variable, control value, or any of the
graphics state variables that Xgridfit can write to) equal
to <tt>source</tt>, which can be an expression or any number
type that Xgridfit can handle.</p>
<pre>
<!-- This is the equivalent of a := b; in C. -->
<set-equal target="a" source="b"/></pre>
<h3>Content</h3>
<p>None.</p>
<h3>Attributes</h3>
<dl>
<dt>source</dt>
<dd>
Required. Any value or expression.
</dd>
<dt>target</dt>
<dd>
Required. The name of a variable, control value or graphics
variable to write to.
</dd>
</dl>
<h2 id="set-freedom-vector"><set-freedom-vector><br/>
<with-freedom-vector></h2>
<p>
Just like <a href="#set-vectors"><set-vectors></a>, but
sets only the freedom vector.
</p>
<h2 id="set-minimum-distance"><set-minimum-distance><br/>
<with-minimum-distance></h2>
<p>
The minimum-distance property is used by several instructions
when the "min-distance" attribute is "yes." The default
minimum distance is one pixel (1.0, 1p, 64), but can be set to
another value here.
</p>
<pre>
<with-minimum-distance value="0.85">
<!-- The distance between p1 and p2 must be at least 0.85 pixel. -->
<move round="no">
<reference>
<point num="p1"/>
</reference>
<point num="p2"/>
</move>
</with-minimum-distance></pre>
<h3>Content</h3>
<p>
<set-minimum-distance> has no content;
<with-minimum-distance> contains programming.
</p>
<h3>Attributes</h3>
<dl>
<dt>value</dt>
<dd>
Required. Any value or expression. This is the new minimum
distance.
</dd>
</dl>
<h2 id="set-projection-vector"><set-projection-vector><br/>
<with-projection-vector></h2>
<p>
Just like <a href="#set-vectors"><set-vectors></a>, but
sets only the projection vector.
</p>
<h2 id="set-round-state"><set-round-state><br/>
<with-round-state></h2>
<p>
Sets the round state. If the <tt>round</tt> attribute matches
the name of a <round-state>, that round state is
used. If not, one of TrueType's prefabricated round states may
be used:
</p>
<ul>
<li>to-grid</li>
<li>to-half-grid</li>
<li>to-double-grid</li>
<li>up-to-grid</li>
<li>down-to-grid</li>
</ul>
<p>
If the <tt>round</tt> attribute is not one of these, and not
the name of one of the custom round-states, Xgridfit tries to
resolve it as a number, constant, variable or function
parameter and use that as an argument to SROUND. You had
better know what you're doing if you intend to use a raw
number in this way; it is safer, more intelligible and just as
effective to supply a custom <a
href="#round-state"><round-state></a> element.
</p>
<p>
The distinction between the element beginning with "set" and
the one beginning with "with" is the same as it is for the <a
href="vectors.html#vect-inst">vector-setting elements</a>:
briefly, the round state set by the "set" element affects the
instructions that follow it; the round state set by the "with"
instruction affects only the instructions that it contains.
</p>
<p>
Xgridfit generates instructions that keep track of the round
state (since the TrueType engine provides no way to read it),
but it may lose track if Xgridfit instructions are not used
exclusively.
</p>
<pre>
<with-round-state round="to-half-grid">
<move>
<point num="v-point"/>
</move>
</with-round-state></pre>
<h3>Content</h3>
<p>
<set-round-state> has no content;
<with-round-state> contains programming.
</p>
<h3>Attributes</h3>
<dl>
<dt>round</dt>
<dd>
Required. The name or a standard or custom round state; any
value or expression. This is the new round state.
</dd>
</dl>
<h2 id="set-single-width"><set-single-width><br/>
<with-single-width></h2>
<p>
The size of the single width, in FUnits, i.e. the units of the
grid the font was designed on (usually 2048 or 1000 units per
em). Presumably this width is converted to the current grid,
and it is that converted value that the single-width cut-in is
compared to.
</p>
<h3>Content</h3>
<p>
<set-single-width> has no content;
<with-single-width> contains programming.
</p>
<h3>Attributes</h3>
<dl>
<dt>value</dt>
<dd>
Required. Any value or expression, interpreted as font
units. This is the new single width.
</dd>
</dl>
<h2 id="set-single-width-cut-in"><set-single-width-cut-in><br/>
<with-single-width-cut-in></h2>
<p>
When the <mirp> or <mdrp> instruction is used, or
when <move> is used relative to a point, a single width
(determined by <set-single-width> or
<with-single-width>) may be used rather than a control
value or the original distance if this condition is met: the
absolute (either positive or negative) difference between the
original outline and the single width is less than the
single-width cut-in. The relevant distances are in pixels.
</p>
<p>
The single width feature appears to be used rarely.
</p>
<h3>Content</h3>
<p>
<set-single-width-cut-in> has no content;
<with-single-width-cut-in> contains programming.
</p>
<h3>Attributes</h3>
<dl>
<dt>value</dt>
<dd>
Required. Any value or expression. This is the new
single-width cut-in.
</dd>
</dl>
<h2 id="set-vectors"><set-vectors><br/><with-vectors></h2>
<p>
Sets both the projection vector and the freedom vector to the
same value. They can be set to "x" or "y" via the
<tt>axis</tt> attribute; to a line by including a line element
as the content of the <set-vectors> element or the first
child of the <with-vectors> element; or by passing "raw"
values via the <tt>x-component</tt> and <tt>y-component</tt>
attributes.
</p>
<p>
Xgridfit looks first for an <tt>axis</tt> attribute, next for
a <line>, and finally for <tt>x-component</tt> and
<tt>y-component</tt> attributes (neither is used unless both
are present). If it finds none of these and the present
element is <with-vectors>, Xgridfit simply stores the
present vectors on the stack and restores them at the end of
the block. If the present element is <set-vectors>,
Xgridfit prints a warning and attempts to find "raw" vector
values on the stack.
</p>
<p>
The "raw" values passed in via <tt>x-component</tt> and
<tt>y-component</tt> are constrained in ways that make them
difficult to calculate, at least in a TrueType program, but
the <tt>x-component/y-component</tt> method is useful to
restore values that have been saved via
<store-projection-vector> or
<store-freedom-vector>. For example, to copy one vector
to another, you can do this:
</p>
<pre>
<variable name="x-comp"/>
<variable name="y-comp"/>
<store-freedom-vector x-component="x-comp" y-component="y-comp"/>
<set-projection-vector x-component="x-comp" y-component="y-comp"/></pre>
<p>
But because of the way these instructions can leave values on
the stack and take them from the stack again, this is easier
and more efficient:
</p>
<pre>
<no-warning>
<store-freedom-vector/>
<set-projection-vector/>
</no-warning></pre>
<p>
When setting vectors to a line, one or both points in the line
can be in the twilight zone. You can include a <tt>zone</tt>
attribute in the <line> element or one in either or both
<point> elements. Include a <tt>zone</tt> attribute in
the <line> element if both points are in the twilight
zone. This is the same as including an attribute
<tt>zone="twilight"</tt> in both points. If only one point is
in the twilight zone, include the <tt>zone</tt> attribute for
that point.
</p>
<p>
Here are several examples:
</p>
<pre>
<with-vectors axis="x">
<!-- programming that moves points horizontally. -->
</with-vectors>
<with-vectors to-line="orthogonal">
<line ref="diagonal-line"/>
<!-- programming that moves points along a line orthogonal to
diagonal-line. -->
</with-vectors>
<set-vectors to-line="parallel">
<line ref="diagonal-line"/>
</set-vectors>
<!-- Subsequent programming will move points along a line parallel
to diagonal-line. --></pre>
<h3>Content</h3>
<p>
<set-vectors> has no content if an <tt>axis</tt>
attribute or the <tt>x-coordinate</tt> and
<tt>y-coordinate</tt> attributes are present; otherwise it may
contain a <line> element. <with-vectors> works
the same way, but also contains programming.
</p>
<h3>Attributes</h3>
<dl>
<dt>axis</dt>
<dd>
Optional, and incompatible with other attributes. Possible
values are "x" and "y".
</dd>
<dt>to-line</dt>
<dd>
Optional, and permitted only when a <line> is
present. Possible values are "orthogonal" and "parallel";
the default is "parallel". Determines whether the vectors
will be orthogonal or parallel to the <line> from
which they are set.
</dd>
<dt>x-component, y-component</dt>
<dd>
Optional, but if one of these attributes is present, the
other must be as well. Not permitted with other attributes
or when a <line> is present.
</dd>
</dl>
<h2 id="shift"><shift></h2>
<p>Shifts one or more points, ranges, sets, contours and zones
by the distance between the current position of the reference
point and its original position. Note that this does not
guarantee that the shifted elements will maintain their original
distance from the reference point (use <move> or
<mdrp> for that).</p>
<p>The <shift> element may contain points, ranges, sets,
contours and zones in any combination and order. The following
is perfectly correct:</p>
<pre>
<shift>
<reference>
<point num="ref-pt"/>
</reference>
<point num="move-pt-1"/>
<range ref="move-rg-1"/>
<contour num="0"/>
<point num="move-pt-2"/>
<range ref="move-rg-2"/>
</shift></pre>
<p>
But note that all the points are shifted first, then all the
ranges or sets, then all the contours, and finally any zones. The
order of child elements in the <shift> element is not
significant.
</p>
<p>
If you want to move points to the nearest rounded position
after the shift, include a <tt>round</tt> attribute. This
works exactly like the <tt>round</tt> attribute on the <a
href="#interpolate"><interpolate></a> element.
</p>
<h3>Content</h3>
<p>
Any number of <point>, <range>, <set>,
<contour> and <zone> elements, in any order.
</p>
<h3>Attributes</h3>
<dl>
<dt>compile-if</dt>
<dd>
Optional. If present, the <shift> element is compiled
only if this attribute evaluates as true (non-zero) at
compile time.
</dd>
<dt>round</dt>
<dd>
Optional. Possible values are "yes", "no", one of the
standard or custom round states, or any value or expression
yielding a number to pass to SROUND. The default value is
"no", since by default no rounding is done on the
<point>s contained in a <shift> element.
</dd>
<dt>reference-ptr</dt>
<dd>
Optional. Possible values are "1" and "2". This determines
which reference pointer (RP1 or RP2) to use. Normally
Xgridfit decides which pointer is appropriate in the
context; otherwise RP1 is used.
</dd>
</dl>
<h2 id="shift-absolute"><shift-absolute></h2>
<p>
Moves one or more points along the freedom vector by a fixed
amount (expressed in pixels); it does not use the projection
vector. The <shift-absolute> element must contain at
least one point to shift: that is, a <range>,
<set> or <point> element. It may contain any
number of <point>s, <range>s and <set>s.
</p>
<h3>Content</h3>
<p>
Any combination of <range>, <set> and <point>
elements in any order.
</p>
<h3>Attributes</h3>
<dl>
<dt>pixel-distance</dt>
<dd>
Required. Any value or expression, understood as a distance
on the grid.
</dd>
</dl>
<h2 id="srp"><srp></h2>
<p>
Does the work of SRP0, SRP1, SRP2. But it should rarely be
necessary to set the reference pointers explicitly.
</p>
<h3>Content</h3>
<p>
One <point> element; the reference pointer is set to
point to this.
</p>
<h3>Attribute</h3>
<dl>
<dt>whichpointer</dt>
<dd>
Required. The reference pointer to set. Possible values are
"0", "1" and "2".
</dd>
</dl>
<h2 id="store-projection-vector"><store-projection-vector><br/>
<store-freedom-vector></h2>
<p>
These instructions store a vector as two numbers, an
x-component and a y-component. The <tt>x-component</tt> and
<tt>y-component</tt> attributes, if given, must be identifiers
for variables:
</p>
<pre>
<store-projection-vector x-component="vx" y-component="vy"/></pre>
<p>
If these attributes are not given, a warning is printed and
the values are left on the stack, where they will be picked up
correctly by a following <tt>set</tt> instruction. For
example, this code sets the projection vector to be the same
as the freedom vector:
</p>
<pre>
<store-freedom-vector/>
<set-projection-vector/></pre>
<p>
Note that a <tt>with</tt> block will not pick up the
components of a vector from the stack.
</p>
<h3>Content</h3>
<p>None.</p>
<h3>Attributes</h3>
<dl>
<dt>x-component, y-component</dt>
<dd>
Optional, but if one attribute is present the other must be
as well. The names of variables in which to store the
components of the vector. If these attributes are not
present, the compiler displays a warning and the values are
left on the stack.
</dd>
</dl>
<h2 id="subtract"><subtract></h2>
<p>Subtracts <tt>minuend - subtrahend</tt>. If <tt>result-to</tt> is not
specified, Xgridfit attempts to write the result to
<tt>minuend</tt>.</p>
<h3>Content</h3>
<p>None.</p>
<h3>Attributes</h3>
<dl>
<dt>minuend</dt>
<dd>
Required, except when <subtract> is the child of a
<formula>. Any value or expression. The value to
subtract from.
</dd>
<dt>subtrahend</dt>
<dd>
Required, except when <subtract> is the child of a
<formula>. Any value or expression. The value to
subtract from the minuend.
</dd>
<dt>result-to</dt>
<dd>
Optional; not allowed when
<subtract> is the child of a <formula>. The
name of a variable of control value in which to store
the result of this operation. If <tt>result-to</tt> is
omitted where allowed, and <tt>minuend</tt> is a variable or
control value, the result is written to <tt>minuend</tt>. If
<tt>minuend</tt> cannot be written to, the compiler issues a
warning and the result is left on the stack.
</dd>
</dl>
<h2 id="szp"><szp></h2>
<p>
Does the work of SZP0, SZP1, SZP2. But these should rarely be
needed (use the zone attributes of the point element instead).
</p>
<h3>Content</h3>
<p>None.</p>
<h3>Attributes</h3>
<dl>
<dt>zone</dt>
<dd>
Required. Possible values are "twilight" and "glyph". The
zone to set the zone pointer to.
</dd>
<dt>whichpointer</dt>
<dd>
Required. Possible values are "0", "1" and "2". Identifies
the pointer to set.
</dd>
</dl>
<h2 id="toggle-points"><toggle-points></h2>
<p>
Any of the points that are on-line become off-line, and any
that are off-line become on-line. The <toggle-points>
element must contain at least one point to toggle: that is, a
<range>, <set> or <point> element. It may
contain any number of <point>s, <set>s and
<range>s.
</p>
<h3>Content</h3>
<p>
One or more <point>, <set> and <range>
elements.
</p>
<h3>Attributes</h3>
<p>None.</p>
<h2 id="to-stack"><to-stack></h2>
<p>
The <to-stack> element moves a single value onto the
stack. This can be any kind of value or expression, e.g. a
number literal, variable, control value or graphics variable.
Use <push> instead when more than one value needs to be
placed on the stack.
</p>
<h3>Content</h3>
<p>
A single value or expression.
</p>
<h3>Attributes</h3>
<p>None.</p>
<h2 id="untouch"><untouch></h2>
<p>A point that has been moved is "touched." This
untouches it so that it will be affected by
the <interpolate-untouched-points> instruction.</p>
<h3>Content</h3>
<p>
One <point> element.
</p>
<h3>Attributes</h3>
<p>None.</p>
<h2 id="variables"><variable></h2>
<p>
Variables are spaces in the TrueType Storage Area. They are
declared in <variable> elements; Xgridfit takes care of
indexing the Storage Area.
</p>
<pre>
<variable name="var-name"/></pre>
<p>
Most variables are local to a glyph program, function or
pre-program. Variable declarations may come among the
declarations at the beginning of a <glyph> program;
after <param> elements in a <function>, and at the
beginning of the <pre-program>. A global variable may be
declared anywhere in the top level of the program, as a child
of <xgridfit> (it is good form to group variable
declarations together); a value may be assigned to a global
variable in the <pre-program> and read by code in any
<glyph> or <function> or elsewhere in the
<pre-program>.
</p>
<p>
Variables must be written to before they can be read from.
(Some versions of Freetype initialize them to zero, but the
Microsoft rasterizer yields an error if a variable is read
before it is written.) Local variables may be initialized with
a <tt>value</tt> attribute in the declaration.
</p>
<p>
A variable is named via its <tt>name</tt> attribute. This must
be unique in the file in the case of a global variable, but in
the case of local variables unique only in the <glyph>
program or <function>. Several names are reserved and
should be avoided when naming variables and constants, since
they belong to pre-defined variables and constants:
</p>
<ul>
<li>Current size (all read-only):
<ul>
<li>pixels-per-em</li>
<li>point-size</li>
</ul>
</li>
<li>Values of the round-state variable (constants):
<ul>
<li>to-grid</li>
<li>to-half-grid</li>
<li>to-double-grid</li>
<li>down-to-grid</li>
<li>up-to-grid</li>
<li>no</li>
<li>custom</li>
</ul>
</li>
<li>Graphics variables:
<p>
Writing to these changes the graphics state. The "default"
variables can be written to only in the
<pre-program>. Trying to write to them elsewhere
produces a compile error. Actually, it is never necessary to
write to a "default" variable since writing to one of the
other variables in the <pre-program> automatically
writes to the "default" variable as well. So treat the
"default" variables as read-only variables.
</p>
<ul>
<li>round-state (can be written to only via
<set-round-state> and
<with-round-state>)</li>
<li>custom-round-state
(can be written to only via <set-round-state> and
<with-round-state>)</li>
<li>minimum-distance</li>
<li>minimum-distance-default</li>
<li>control-value-cut-in</li>
<li>control-value-cut-in-default</li>
<li>single-width</li>
<li>single-width-default</li>
<li>single-width-cut-in</li>
<li>single-width-cut-in-default</li>
<li>delta-base delta-base-default</li>
<li>delta-shift delta-shift-default</li>
</ul>
</li>
</ul>
<h3>Content</h3>
<p>None.</p>
<h3>Attributes</h3>
<dl>
<dt>name</dt>
<dd>
Required. A name: any sequence of letters, numbers, hyphens,
periods; no spaces permitted. The name of this variable.
</dd>
<dt>value</dt>
<dd>
Optional. Any value or expression. A value with which to
initialize the variable.
</dd>
</dl>
<h2 id="function-variant"><variant></h2>
<p>
A <variant> is an alternative version of a function to
be used at certain sizes or resolutions. Include one or more
<variant> elements as the last children of any
<function> element. For further explanation, see the
section on <a
href="functions.html#function-variant">functions</a>.
</p>
<h3>Content</h3>
<p>
Programming. <param> and <variable> elements are
not permitted; the <variant> must use those of the
parent <function>.
</p>
<h3>Attribute</h3>
<dl>
<dt>test</dt>
<dd>
Required. Any value or expression. The variant is used if
this attribute evaluates as true (non-zero) when the
<pre-program> is run.
</dd>
</dl>
<h2><with-control-value></h2>
<p>
See <a href="#set-control-value"><set-control-value></a>
</p>
<h2><with-control-value-cut-in></h2>
<p>
See <a href="#set-control-value-cut-in"><set-control-value-cut-in></a>
</p>
<h2><with-delta-base></h2>
<p>
See <a href="#set-delta-base"><set-delta-base></a>
</p>
<h2><with-delta-shift></h2>
<p>
See <a href="#set-delta-shift"><set-delta-shift></a>
</p>
<h2><with-freedom-vector></h2>
<p>
See <a href="#set-freedom-vector"><set-freedom-vector></a>
</p>
<h2><with-minimum-distance></h2>
<p>
See <a href="#set-minimum-distance"><set-minimum-distance></a>
</p>
<h2 id="with-param"><with-param></h2>
<p>
Defines a value to be passed to a function, macro or glyph program. The
<tt>value</tt> may be any of the value-types that Xgridfit
handles. Note that all values are resolved to numbers before a
call to a function takes place: Xgridfit does not pass
parameters to functions by reference. A result of this is
that if a variable or control value is passed to a function,
these things cannot be written to.
</p>
<p>
In general there will be a <with-param> element for
every <param> element that appears in the function or
macro being called. However, a <with-param> element may
be omitted if the matching <param> contains a default
<tt>value</tt>.
</p>
<p>
The order of <with-param> elements in a
<param-set>, <call-function>, <call-macro>
or <call-glyph> element is not significant.
</p>
<p>
If the <with-param> element is part of a call to a
macro, the value passed can be a <set>, <range> or
<line>. The <tt>name</tt> of such a structure can be
passed via the <tt>value</tt> attribute, or the structure
itself can be passed as the child of <with-param>. When
<with-param> contains a <set>, <range> or
<line>, the <tt>value</tt> attribute is optional.
</p>
<p>
Programming can also be passed via a <with-param>
element, and in this case too the <tt>value</tt> attribute is
optional.
</p>
<h3>Content</h3>
<p>
Usually none, but if the call is to a <macro> or
<glyph>, the element can contain a <range>,
<set> or <line>, or a fragment of programming.
</p>
<h3>Attributes</h3>
<dl>
<dt>name</dt>
<dd>
Required. A name: any sequence of letters, numbers, hyphens,
periods; no spaces permitted. This must match the name of
<param> in the <function>, <macro> or
<glyph> being called.
</dd>
<dt>value</dt>
<dd>
Required except when content is present. Any value or
expression. The value to pass as a parameter.
</dd>
</dl>
<h2><with-projection-vector></h2>
<p>
See <a href="#set-projection-vector"><set-projection-vector></a>
</p>
<h2><with-round-state></h2>
<p>
See <a href="#set-round-state"><set-round-state></a>
</p>
<h2><with-single-width></h2>
<p>
See <a href="#set-single-width"><set-single-width></a>
</p>
<h2><with-single-width-cut-in></h2>
<p>
See <a href="#set-single-width-cut-in"><set-single-width-cut-in></a>
</p>
<h2><with-vectors></h2>
<p>
See <a href="#set-vectors"><set-vectors></a>
</p>
<h2 id="xgridfit-el"><xgridfit></h2>
<p>
The root element of an Xgridfit program file.
</p>
<h3>Namespace declaration</h3>
<p>
This element must contain the namespace declaration
xmlns="http://xgridfit.sourceforge.net/Xgridfit2".
</p>
<h3>Content</h3>
<p>
One at most of these: <glyph-select>, <infile>,
<outfile>, <outfile-base>,
<outfile-script-name>, <no-compile>,
<legacy-functions>, <pre-program>. Any number of
these: <constant>, <alias>, <variable>,
<round-state>, <default>, <control-value>,
<function>, <macro>, <glyph>,
<xi.include>.
</p>
<h3>Attribute</h3>
<dl>
<dt>xml:id</dt>
<dd>
Optional. A valid XML ID, i.e. any sequence of letters,
numbers, hyphens, periods; no spaces permitted; and unique
within the program. This ID may be used if the
<xgridfit> element is imported into a file using
XInclude.
</dd>
</dl>
<h2 id="zone"><zone></h2>
<p>
A zone to be shifted by a <shift> instruction.
</p>
<h3>Content</h3>
<p>None.</p>
<h3>Attribute</h3>
<dl>
<dt>zone</dt>
<dd>
Required. Must be "twilight" or "glyph".
</dd>
</dl>
</div>
</body>
</html>
|