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 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241
|
with --ARM_Output,
--ARM_Contents,
--Ada.Text_IO,
Ada.Exceptions,
Ada.Streams.Stream_IO,
Ada.Strings.Maps,
Ada.Strings.Fixed,
Ada.Characters.Handling,
Ada.Calendar,
Ada.Unchecked_Conversion;
package body ARM_RTF is
--
-- Ada reference manual formatter (ARM_Form).
--
-- This package defines the RTF output object.
-- Output objects are responsible for implementing the details of
-- a particular format.
--
-- ---------------------------------------
-- Copyright 2000, 2002, 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012,
-- 2013, 2016
-- AXE Consultants. All rights reserved.
-- P.O. Box 1512, Madison WI 53701
-- E-Mail: randy@rrsoftware.com
--
-- ARM_Form is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License version 3
-- as published by the Free Software Foundation.
--
-- AXE CONSULTANTS MAKES THIS TOOL AND SOURCE CODE AVAILABLE ON AN "AS IS"
-- BASIS AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE ACCURACY,
-- CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR FUNCTIONING OF THIS TOOL.
-- IN NO EVENT WILL AXE CONSULTANTS BE LIABLE FOR ANY GENERAL,
-- CONSEQUENTIAL, INDIRECT, INCIDENTAL, EXEMPLARY, OR SPECIAL DAMAGES,
-- EVEN IF AXE CONSULTANTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-- DAMAGES.
--
-- A copy of the GNU General Public License is available in the file
-- gpl-3-0.txt in the standard distribution of the ARM_Form tool.
-- Otherwise, see <http://www.gnu.org/licenses/>.
--
-- If the GPLv3 license is not satisfactory for your needs, a commercial
-- use license is available for this tool. Contact Randy at AXE Consultants
-- for more information.
--
-- ---------------------------------------
--
-- Edit History:
--
-- 5/18/00 - RLB - Created package.
-- 5/22/00 - RLB - Added Includes_Changes to Create.
-- 5/23/00 - RLB - Added Set_Column and New_Column.
-- - Added Tab_Info and Tab_Stops.
-- 5/24/00 - RLB - Added Location to Text_Format.
-- - RLB - Added No_Breaks and Keep_with_Next to Start_Paragraph.
-- 5/25/00 - RLB - Added Big_Files to Create. Added Justification.
-- - RLB - Added Separator_Lines and TOC routines.
-- 5/26/00 - RLB - Added table operations.
-- 5/27/00 - RLB - Implemented table operations.
-- 5/28/00 - RLB - Added index style.
-- 6/ 2/00 - RLB - Added Soft_Line_Break.
-- - RLB - Changed back to mostly "after" spacing, so paragraph
-- numbers format correctly on tops of pages.
-- 8/ 2/00 - RLB - Added Soft_Hyphen_Break and left and right quote
-- characters.
-- - RLB - Added additional styles.
-- - RLB - Fixed bulleted styles to have a right indent as well.
-- 8/ 4/00 - RLB - Added additional styles.
-- - RLB - Fixed table text size.
-- 8/ 7/00 - RLB - Added Leading flag to Start_Paragraph, removed "Leading"
-- styles.
-- 8/ 8/00 - RLB - Added "Hang_Width" in order to get more accurate
-- hang prefix determination.
-- 8/10/00 - RLB - Style corrections.
-- 8/11/00 - RLB - Fixed footers for clauses with very long titles.
-- - RLB - Added Hanging_in_Bulleted styles.
-- 8/16/00 - RLB - Adjusted so captial 'I' is not a large character.
-- - RLB - Added Code_Indented_Nested_Bulleted and Notes_Nested_Bulleted.
-- 8/17/00 - RLB - Replaced "Leading" by "Space_After".
-- - RLB - Added Nested_Enumerated.
-- 8/21/00 - RLB - Moved paragraph numbers in a bit for AARM.
-- 8/22/00 - RLB - Added Revised_Clause_Header.
-- 8/23/00 - RLB - Revised widths of AARM text to be more like RM.
-- 8/31/00 - RLB - Moved paragraphs in again.
-- 9/26/00 - RLB - Added Syntax_Summary style.
-- 9/27/00 - RLB - Cut the lower margin for the AARM pages.
-- 7/18/02 - RLB - Removed Document parameter, replaced by three
-- strings.
-- - RLB - Added AI_Reference.
-- - RLB - Added Change_Version_Type and uses.
-- 9/10/04 - RLB - Added "Both" to possible changes to handle
-- replacement of changed text.
-- 9/14/04 - RLB - Moved Change_Version_Type to contents.
-- 9/15/04 - RLB - Completely rewrote Text_Format to avoid problems
-- with ordering of calls.
-- 11/03/04 - RLB - Added Nested_X2_Bulleted.
-- 11/15/04 - RLB - Added Indented_Nested_Bulleted.
-- 11/16/04 - RLB - Experimented with changes to avoid the hot pink
-- revision markers.
-- 12/15/04 - RLB - Added Pascal's workaround to formatting bugs in
-- Word 2000/XP/2003.
-- 12/16/04 - RLB - Removed it after it proved not to help.
-- 1/24/05 - RLB - Added Inner_Indent.
-- 2/ 1/05 - RLB - Added Turkish chars to allow an AARM note.
-- 5/27/05 - RLB - Added arbitrary Unicode characters.
-- 1/11/06 - RLB - Eliminated dispatching Create in favor of tailored
-- versions.
-- 1/18/06 - RLB - Added additional styles.
-- 2/ 8/06 - RLB - Added additional parameters to the table command.
-- 2/10/06 - RLB - Added even more additional parameters to the
-- table command.
-- - RLB - Added picture command.
-- 9/21/06 - RLB - Added Body_Font; revised styles to handle that.
-- 9/22/06 - RLB - Added Subsubclause.
-- 9/25/06 - RLB - Handled optional renaming of TOC.
-- - RLB - Added Last_Column_Width to Start_Table.
-- 10/10/06 - RLB - Widened bulleted and enumerated hanging a bit to make
-- room for wider numbers for ISO 2004 format.
-- 10/13/06 - RLB - Added Local_Link_Start and Local_Link_End to allow
-- formatting in the linked text.
-- 12/22/06 - RLB - Fixed glitch in number of column units.
-- 2/ 9/07 - RLB - Changed comments on AI_Reference.
-- 2/14/07 - RLB - Revised to separate style and indent information
-- for paragraphs.
-- 2/16/07 - RLB - Added example styles for additional nesting levels.
-- 2/19/07 - RLB - Added Standard Title style.
-- 12/18/07 - RLB - Fixed silly table bug.
-- - RLB - Added Plain_Annex.
-- 12/19/07 - RLB - Added limited colors to Text_Format.
-- 12/21/07 - RLB - Removed extra "not" from "large" character counter
-- in Ordinary_Character.
-- 5/ 4/09 - RLB - Added the footer information.
-- 5/ 6/09 - RLB - Added ISO format footer and version names.
-- 10/28/09 - RLB - Added missing with.
-- 3/31/10 - RLB - Adjusted picture scaling to be closer to reality.
-- 10/18/11 - RLB - Changed to GPLv3 license.
-- 10/20/11 - RLB - Updated to handle extra-wide paragraph numbers
-- automatically (there are too many to hand-fix now).
-- 10/25/11 - RLB - Added old insertion version to Revised_Clause_Header.
-- 4/ 3/12 - RLB - Eliminated redundancy.
-- 8/31/12 - RLB - Added Output_Path.
-- 10/18/12 - RLB - Added additional hanging styles.
-- 11/05/12 - RLB - Added various additional styles.
-- 11/26/12 - RLB - Added subdivision names to Clause_Header and
-- Revised_Clause_Header.
-- 12/13/12 - RLB - Added style needed by AARM (only in deleted text).
-- 8/16/13 - RLB - Added missing style needed by recent RM change.
-- 6/28/16 - RLB - Added missing style needed by recent ACATS
-- documentation change.
-- 8/19/16 - RLB - Nasty bug in End_Hang_Item: it loses any open styles
-- if a line break has to be inserted.
-- Note: We assume a lot about the Section_Names passed into
-- Section in order to get the proper headers/footers/page numbers.
-- Someday, that ought to be changed somehow.
LINE_LENGTH : constant := 78;
-- Maximum intended line length.
LEADING_PERCENT : constant := 70;
-- Leading is 70% of normal height.
TRAILING_PERCENT : constant := 150;
-- Leading is 150% of normal height.
type Format_Info_Type is record
Defined : Boolean := False;
Size : Natural; -- In 1/2 pts.
Indent : Natural; -- In Twips (.1 pt = 1/120th pica = 1/1440th inch).
Hang_Width : Natural; -- In Twips (.1 pt = 1/120th pica = 1/1440th inch).
Before : Natural; -- Vertical space before in Twips. (\sb)
After : Natural; -- Vertical space after in Twips. (\sa)
Is_Justified : Boolean; -- True if the format is justified. (\qj vs. \qc or \ql)
Number : Natural; -- Style number.
Format_String : String(1 .. 200);
Format_Len : Natural := 0;
end record;
Paragraph_Info : array (ARM_Output.Paragraph_Style_Type,
ARM_Output.Paragraph_Indent_Type) of Format_Info_Type;
-- Set by Start_RTF_File.
Heading_1_Info : Format_Info_Type;
Heading_2_Info : Format_Info_Type;
Heading_3_Info : Format_Info_Type;
Heading_4_Info : Format_Info_Type;
Category_Header_Info : Format_Info_Type;
Normal_Paragraph_Number_Info : Format_Info_Type;
Wide_Paragraph_Number_Info : Format_Info_Type;
Header_Info : Format_Info_Type;
Footer_Info : Format_Info_Type;
TOC_1_Info : Format_Info_Type;
TOC_2_Info : Format_Info_Type;
TOC_3_Info : Format_Info_Type;
TOC_4_Info : Format_Info_Type;
Table_C_Text_Info : Format_Info_Type;
Table_L_Text_Info : Format_Info_Type;
Table_C_Sml_Text_Info : Format_Info_Type;
Table_L_Sml_Text_Info : Format_Info_Type;
procedure Set_Style (Into : in out Format_Info_Type;
Font : in ARM_Output.Font_Family_Type; -- Default means use Body_Font.
Body_Font : in ARM_Output.Font_Family_Type;
Font_Size : in Natural;
Style_Indent : in Natural;
Style_Hang_Width : in Natural := 0;
Style_Before : in Natural;
Style_After : in Natural;
Style_Justified : in Boolean;
Style_String_Prefix : in String;
Style_String_Suffix : in String) is
-- Internal routine.
-- Set the indicated style information.
-- The two part of the Style String includes all of the information
-- except Font (\fn), Font_Size (\fsnn), Indent (\linn), Hang (\fi-nn),
-- Before (\sbnn), and After (\sann) -- these are added appropriately
-- between the halves of the string.
Font_String : String(1..3) := "\f0";
function Make (Code : in String; Value : in Natural) return String is
Val : constant String := Natural'Image(Value);
begin
if Value /= 0 then
return '\' & Code & Val(2..Val'Last);
else
return ""; -- Make nothing.
end if;
end Make;
begin
Into.Defined := True;
Into.Size := Font_Size;
case Font is
when ARM_Output.Default =>
if ARM_Output."=" (Body_Font, ARM_Output.Swiss) then
Font_String(3) := '1';
Into.Size := Into.Size - 1;
else -- Roman.
Font_String(3) := '0';
end if;
when ARM_Output.Roman =>
Font_String(3) := '0';
when ARM_Output.Swiss =>
Font_String(3) := '1';
when ARM_Output.Fixed =>
Font_String(3) := '2';
end case;
Into.Indent := Style_Indent;
Into.Hang_Width := Style_Hang_Width;
Into.Before := Style_Before;
Into.After := Style_After;
Into.Is_Justified := Style_Justified;
declare
Style : constant String :=
Style_String_Prefix & " " &
Font_String &
Make ("fs", Into.Size) &
Make ("li", Into.Indent) &
Make ("fi-", Into.Hang_Width) &
Make ("sb", Into.Before) &
Make ("sa", Into.After) &
Style_String_Suffix;
begin
Ada.Strings.Fixed.Move (Source => Style,
Target => Into.Format_String);
Into.Format_Len := Style'Length;
end;
end Set_Style;
procedure Write_Style (Fyle : in Ada.Text_IO.File_Type;
Style : in Format_Info_Type) is
-- Internal routine.
-- Write a header to start a style definition for Style.
begin
if not Style.Defined then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Undefined Style in style table");
end if;
Ada.Text_IO.Put (Fyle, "{" &
Style.Format_String(1 .. Style.Format_Len));
end Write_Style;
procedure Write_Style_for_Paragraph (Fyle : in Ada.Text_IO.File_Type;
Style : in Format_Info_Type;
Count : out Natural) is
-- Internal routine.
-- Write a header to start a paragraph in Style. Count is set to
-- the characters written.
begin
if not Style.Defined then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Undefined Style in paragraph");
end if;
Ada.Text_IO.Put (Fyle, "{\pard\plain " &
Style.Format_String(1 .. Style.Format_Len));
Count := Style.Format_Len + 13;
end Write_Style_for_Paragraph;
procedure Write_Headers (Output_Object : in out RTF_Output_Type) is
-- Write the page headers for this object into the current file.
Junk : Natural;
begin
-- Default header/footer:
Ada.Text_IO.Put (Output_Object.Output_File, "{\headerl ");
Write_Style_for_Paragraph (Output_Object.Output_File, Header_Info, Junk);
if Ada.Strings.Unbounded.Length (Output_Object.Header_Prefix) = 0 then
Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\b\f1 " &
Ada.Strings.Unbounded.To_String (Output_Object.Title) &
"\par}}}");
elsif Ada.Strings.Unbounded.Length (Output_Object.Title) = 0 then
Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\b\f1 " &
Ada.Strings.Unbounded.To_String (Output_Object.Header_Prefix) &
"\par}}}");
else
Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\b\f1 " &
Ada.Strings.Unbounded.To_String (Output_Object.Header_Prefix) &
" \emdash " &
Ada.Strings.Unbounded.To_String (Output_Object.Title) &
"\par}}}");
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "{\headerr ");
Write_Style_for_Paragraph (Output_Object.Output_File, Header_Info, Junk);
if Ada.Strings.Unbounded.Length (Output_Object.Header_Prefix) = 0 then
Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\qr\b\f1 " &
Ada.Strings.Unbounded.To_String (Output_Object.Title) &
"\par}}}");
elsif Ada.Strings.Unbounded.Length (Output_Object.Title) = 0 then
Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\qr\b\f1 " &
Ada.Strings.Unbounded.To_String (Output_Object.Header_Prefix) &
"\par}}}");
else
Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\qr\b\f1 " &
Ada.Strings.Unbounded.To_String (Output_Object.Header_Prefix) &
" \emdash " &
Ada.Strings.Unbounded.To_String (Output_Object.Title) &
"\par}}}");
end if;
-- Note: We don't need the default footers; none probably work better, anyway.
-- Ada.Text_IO.Put (Output_Object.Output_File, "{\footerl ");
-- Write_Style_for_Paragraph (Output_Object.Output_File, Footer_Info, Junk);
-- if Name = "00" or else Name = "TOC" or else Name = "Ttl" then
-- -- No section number.
-- Ada.Text_IO.Put (Output_Object.Output_File, "{\f0 ");
-- else
-- Ada.Text_IO.Put (Output_Object.Output_File, "{\b\f1 ");
-- if Name(1) = '0' then -- Strip leading zero...
-- Ada.Text_IO.Put (Output_Object.Output_File, Name(2..Name'Last));
-- else
-- Ada.Text_IO.Put (Output_Object.Output_File, Name);
-- end if;
-- Ada.Text_IO.Put (Output_Object.Output_File, "}\~\~\~{\f0 ");
-- end if;
-- Ada.Text_IO.Put (Output_Object.Output_File, Title);
-- Ada.Text_IO.Put_Line (Output_Object.Output_File, "\tab \tab{\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}\par}}}");
-- Ada.Text_IO.Put (Output_Object.Output_File, "{\footerr ");
-- Write_Style_for_Paragraph (Output_Object.Output_File, Footer_Info, Junk);
-- Ada.Text_IO.Put (Output_Object.Output_File, "{\f0 {\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}\tab \tab ");
-- Ada.Text_IO.Put (Output_Object.Output_File, Title);
-- if Name = "00" or else Name = "TOC" or else Name = "Ttl" then
-- null; -- No section number.
-- else
-- Ada.Text_IO.Put (Output_Object.Output_File, "\~\~\~\b\f1 ");
-- if Name(1) = '0' then -- Strip leading zero...
-- Ada.Text_IO.Put (Output_Object.Output_File, Name(2..Name'Last));
-- else
-- Ada.Text_IO.Put (Output_Object.Output_File, Name);
-- end if;
-- end if;
-- Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par}}}");
end Write_Headers;
procedure Start_RTF_File (Output_Object : in out RTF_Output_Type;
File_Name : in String;
Title : in String;
Name : in String) is
-- Internal routine.
-- Create an RTF file, and generate the needed text to start an RTF
-- file. The file name is just the name portion, not the path or
-- extension. "Name" is a short identifier, typically the clause
-- number or letter.
INDENT_UNIT : constant := 360;
subtype PWidth is String(1..4);
function Paper_Width return PWidth is
-- Return the paper width in twips:
begin
case Output_Object.Page_Size is
when ARM_RTF.A4 =>
return "9030";
when ARM_RTF.Letter =>
return "9360";
when ARM_RTF.Half_Letter =>
return "5760";
when ARM_RTF.Ada95 =>
return "7740";
end case;
end Paper_Width;
function Half_Paper_Width return PWidth is
-- Return the center of the paper width in twips:
begin
case Output_Object.Page_Size is
when ARM_RTF.A4 =>
return "4515";
when ARM_RTF.Letter =>
return "4680";
when ARM_RTF.Half_Letter =>
return "2880";
when ARM_RTF.Ada95 =>
return "3870";
end case;
end Half_Paper_Width;
begin
Ada.Text_IO.Create (Output_Object.Output_File, Ada.Text_IO.Out_File,
Ada.Strings.Unbounded.To_String (Output_Object.Output_Path) &
File_Name & ".RTF");
-- Note: This header (simplified) is from a Word 97 created file.
-- File introduction:
Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033");
-- rtf1=RTF file marker;
-- ansi=character set is ansi;
-- ansicpg=code page for ansi-Unicode conversion (1252);
-- uc1=One character replacement for Unicode characters;
-- deff0=Default font to use (Font 0);
-- deflang=default language (1033 - American English);
-- deflangfe=default language (asian text) (1033 - American English).
-- Font table:
Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\fonttbl");
case Output_Object.Primary_Serif_Font is
when Times_New_Roman =>
Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\f0\froman\fcharset0 Times New Roman;}");
when Souvenir =>
Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\f0\froman\fcharset0 Souvenir{\*\falt Souvienne};}");
end case;
case Output_Object.Primary_Sans_Serif_Font is
when Helvetica =>
Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\f1\fswiss\fcharset0 Helvetica{\*\falt Arial};}"); -- Usually Arial on most Windows machines.
when Arial =>
Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\f1\fswiss\fcharset0 Arial{\*\falt Helvetica};}"); -- Give Arial preference, because otherwise it screwed up Jim Moore's machine.
end case;
Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\f2\fmodern\fcharset0\fprq1 Courier New;}");
Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\f3\ftech\fcharset0 Symbol;}}");
-- f=Font number;
-- fswiss,froman,fmodern,gtech=font family;
-- fcharset=character set (0=Ansi);
-- fprq=pitch (0=anything (default); 1=fixed; 2=variable);
-- falt=alternative font name;
-- followed by the font name
-- File table: (None used.)
-- Color table:
Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\colortbl;");
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red0\green0\blue0;"); -- Color 1
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red0\green0\blue255;"); -- Color 2
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red0\green255\blue255;"); -- Color 3
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red0\green255\blue0;"); -- Color 4
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red255\green0\blue255;"); -- Color 5
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red255\green0\blue0;"); -- Color 6
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red255\green255\blue0;"); -- Color 7
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red255\green255\blue255;"); -- Color 8
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red0\green0\blue128;"); -- Color 9
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red0\green128\blue128;"); -- Color 10
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red0\green128\blue0;"); -- Color 11
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red128\green0\blue128;"); -- Color 12
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red128\green0\blue0;"); -- Color 13
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red128\green128\blue0;"); -- Color 14
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red128\green128\blue128;"); -- Color 15
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red192\green192\blue192;}"); -- Color 16
-- Style sheet:
Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\stylesheet");
if Output_Object.Page_Size = ARM_RTF.Ada95 or else
Output_Object.Page_Size = ARM_RTF.Half_Letter then
-- These are smaller page sizes than the other sizes.
-- ** TBD: Consider putting this into a separate parameter (there is
-- ** little reason for the font size to depend on the page size).
Set_Style (Paragraph_Info(ARM_Output.Normal, 0),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => 0,
Style_Before => 0,
Style_After => 120,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s0\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-220\slmult0 \snext0 ");
Set_Style (Heading_1_Info,
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 28,
Style_Indent => 0,
Style_Before => 0,
Style_After => 210,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s1\keepn\widctlpar\outlinelevel0\adjustright",
Style_String_Suffix => "\b\kerning28\qc\cgrid \sbasedon0 \snext0 ");
Set_Style (Heading_2_Info,
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 24,
Style_Indent => 0,
Style_Before => 240,
Style_After => 120,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s2\keepn\widctlpar\outlinelevel1\adjustright",
Style_String_Suffix => "\b\ql\cgrid \sbasedon0 \snext0 ");
Set_Style (Heading_3_Info,
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 23,
Style_Indent => 0,
Style_Before => 210,
Style_After => 90,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s3\keepn\widctlpar\outlinelevel2\adjustright",
Style_String_Suffix => "\b\ql\cgrid \sbasedon0 \snext0 ");
Set_Style (Category_Header_Info,
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 14,
Style_Indent => 0,
Style_Before => 100,
Style_After => 60,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s4\keepn\adjustright",
Style_String_Suffix => "\cgrid\qc\i \snext0 ");
Set_Style (Normal_Paragraph_Number_Info,
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 12,
Style_Indent => 0,
Style_Before => 0,
Style_After => 0,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s5\keepn\widctlpar\adjustright " &
"\pvpara\phpg\posxo\posy0\absw450\dxfrtext100\dfrmtxtx120\dfrmtxty120"&
"\cgrid\qc",
Style_String_Suffix => "\snext0 "); -- Note: We adjust the space before on use.
Set_Style (Wide_Paragraph_Number_Info,
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 12,
Style_Indent => 0,
Style_Before => 0,
Style_After => 0,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s5\keepn\widctlpar\adjustright " &
"\pvpara\phpg\posxo\posy0\absw490\dxfrtext100\dfrmtxtx120\dfrmtxty120"&
"\cgrid\qc",
Style_String_Suffix => "\snext0 "); -- Note: We adjust the space before on use.
Set_Style (Paragraph_Info(ARM_Output.Small, 1), -- Notes
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => INDENT_UNIT*1,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s6\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-180\slmult0 \snext6 ");
Set_Style (Paragraph_Info(ARM_Output.Small, 2), -- Annotations
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => INDENT_UNIT*2,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s7\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-180\slmult0 \snext7 ");
Set_Style (Paragraph_Info(ARM_Output.Examples, 1),
Font => ARM_Output.Fixed,
Body_Font => Output_Object.Body_Font,
Font_Size => 16,
Style_Indent => INDENT_UNIT*1,
Style_Before => 0,
Style_After => 80,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s8\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\sl-160\ql \snext8 ");
Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 3),
Font => ARM_Output.Fixed,
Body_Font => Output_Object.Body_Font,
Font_Size => 14,
Style_Indent => INDENT_UNIT*3,
Style_Before => 0,
Style_After => 70,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s9\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\sl-140\ql \snext9 ");
Set_Style (Paragraph_Info(ARM_Output.Normal, 1), -- Syntax indent
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*1,
Style_Before => 0,
Style_After => 80,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s10\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-200 \snext10 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Normal, 3), -- Regular indent
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*3,
Style_Before => 0,
Style_After => 120,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s11\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-220\slmult0 \snext11 ");
Set_Style (Paragraph_Info(ARM_Output.Small, 5), -- Regular annotation indent
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => INDENT_UNIT*5,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s12\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-180\slmult0 \snext12 ");
Set_Style (Paragraph_Info(ARM_Output.Wide_Hanging, 3),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*3,
Style_Hang_Width => 1080,
Style_Before => 0,
Style_After => 100,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s13\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext13 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Narrow_Hanging, 1),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*1,
Style_Hang_Width => 360,
Style_Before => 0,
Style_After => 100,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s14\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext14 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Wide_Hanging, 5),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => INDENT_UNIT*5,
Style_Hang_Width => 1080,
Style_Before => 0,
Style_After => 80,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s15\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-170\slmult0 \snext15 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Narrow_Hanging, 3),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => INDENT_UNIT*3,
Style_Hang_Width => 360,
Style_Before => 0,
Style_After => 80,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s16\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-170\slmult0 \snext16 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Bulleted, 1),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*1,
Style_Hang_Width => 240,
Style_Before => 0,
Style_After => 100,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s17\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx360 \snext17 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Nested_Bulleted, 2),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*2,
Style_Hang_Width => 220,
Style_Before => 0,
Style_After => 100,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s18\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx720 \snext18 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Bulleted, 3),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => INDENT_UNIT*3,
Style_Hang_Width => 220,
Style_Before => 0,
Style_After => 80,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s19\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-170\slmult0\tx1080 \snext19 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Nested_Bulleted, 4),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => INDENT_UNIT*4,
Style_Hang_Width => 200,
Style_Before => 0,
Style_After => 80,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s20\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-170\slmult0\tx1440 \snext20 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Bulleted, 4), -- Indented bullets
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*4,
Style_Hang_Width => 240,
Style_Before => 0,
Style_After => 100,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s21\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx1080 \snext21 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Bulleted, 2), -- Syntax indent bullets
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*2,
Style_Hang_Width => 240,
Style_Before => 0,
Style_After => 80,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s22\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx720 \snext22 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Bulleted, 3), -- Code indented bullets
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*3,
Style_Hang_Width => 240,
Style_Before => 0,
Style_After => 100,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s23\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx1080 \snext23 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Normal, 2), -- Code indented
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*2,
Style_Before => 0,
Style_After => 120,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s24\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-220\slmult0 \snext24 ");
Set_Style (Paragraph_Info(ARM_Output.Small, 4), -- Code indented annotations.
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => INDENT_UNIT*4,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s25\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-180\slmult0 \snext25 ");
Set_Style (Paragraph_Info(ARM_Output.Examples, 4), -- Indented examples
Font => ARM_Output.Fixed,
Body_Font => Output_Object.Body_Font,
Font_Size => 16,
Style_Indent => INDENT_UNIT*4,
Style_Before => 0,
Style_After => 80,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s26\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-160 \snext26 ");
Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 6), -- Indented annotation examples.
Font => ARM_Output.Fixed,
Body_Font => Output_Object.Body_Font,
Font_Size => 14,
Style_Indent => INDENT_UNIT*6,
Style_Before => 0,
Style_After => 70,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s27\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-140 \snext27 ");
Set_Style (Header_Info,
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 17,
Style_Indent => 0,
Style_Before => 0,
Style_After => 0,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s28\widctlpar\tqc\tx" & Half_Paper_Width &
"\tqr\tx" & Paper_Width & "\adjustright",
Style_String_Suffix => "\cgrid \sbasedon0 \snext28 ");
Set_Style (Footer_Info,
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 17,
Style_Indent => 0,
Style_Before => 0,
Style_After => 0,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s29\widctlpar" & -- "\tqc\tx" & Half_Paper_Width & -- We don't use or define the center tab; it causes problems with very long titles.
"\tqr\tx" & Paper_Width & "\adjustright",
Style_String_Suffix => "\cgrid \sbasedon0 \snext29 ");
Set_Style (Paragraph_Info(ARM_Output.Index, 0),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => 225,
Style_Hang_Width => 225,
Style_Before => 0,
Style_After => 0,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s31\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-180\slmult0 \snext31 ");
Set_Style (Paragraph_Info(ARM_Output.Wide_Above, 0),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => 0,
Style_Before => 120,
Style_After => 120,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s32\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-220\slmult0 \snext0 ");
Set_Style (Paragraph_Info(ARM_Output.Small_Wide_Above, 2), -- Wide above annotations.
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => INDENT_UNIT*2,
Style_Before => 90,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s33\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-180\slmult0 \snext7 ");
Set_Style (Paragraph_Info(ARM_Output.Small_Header, 1), -- Notes header
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => INDENT_UNIT*1,
Style_Before => 0,
Style_After => 0,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s34\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-180\slmult0 \snext6 ");
-- Note: No extra space afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Bulleted, 2), -- Bullets in notes
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => INDENT_UNIT*2,
Style_Hang_Width => 240,
Style_Before => 0,
Style_After => 60,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s35\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-170\slmult0\tx720 \snext35 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Nested_Bulleted, 3), -- Nested bullets in notes
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => INDENT_UNIT*3,
Style_Hang_Width => 230,
Style_Before => 0,
Style_After => 60,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s36\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-170\slmult0\tx1080 \snext36 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Hanging_in_Bulleted, 3),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*3,
Style_Hang_Width => 720,
Style_Before => 0,
Style_After => 100,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s37\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0 \snext14 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Hanging_in_Bulleted, 5),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => INDENT_UNIT*5,
Style_Hang_Width => 720,
Style_Before => 0,
Style_After => 80,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s38\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-170\slmult0 \snext16 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Nested_Bulleted, 4), -- Code indent nested bullets
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*4,
Style_Hang_Width => 220,
Style_Before => 0,
Style_After => 100,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s39\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx1440 \snext39 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Syntax_Summary, 1),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => INDENT_UNIT*1,
Style_Before => 0,
Style_After => 65,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s40\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-170\slmult0 \snext40 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Enumerated, 1),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*1,
Style_Hang_Width => 240,
Style_Before => 0,
Style_After => 100,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s41\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx360 \snext41 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Enumerated, 3),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => INDENT_UNIT*3,
Style_Hang_Width => 220,
Style_Before => 0,
Style_After => 80,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s42\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-170\slmult0\tx1080 \snext42 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Enumerated, 2),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*2,
Style_Hang_Width => 260,
Style_Before => 0,
Style_After => 100,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s43\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx360 \snext43 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Enumerated, 4),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => INDENT_UNIT*4,
Style_Hang_Width => 240,
Style_Before => 0,
Style_After => 80,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s44\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-170\slmult0\tx1080 \snext44 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Nested_Bulleted, 3), -- Doubly nested bullets
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*3,
Style_Hang_Width => 220,
Style_Before => 0,
Style_After => 100,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s45\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx720 \snext45 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Nested_Bulleted, 5), -- Doubly nested bullets
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => INDENT_UNIT*5,
Style_Hang_Width => 200,
Style_Before => 0,
Style_After => 80,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s46\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-170\slmult0\tx1440 \snext46 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Nested_Bulleted, 5), -- Indented nested bullets.
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*5,
Style_Hang_Width => 240,
Style_Before => 0,
Style_After => 100,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s47\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx1080 \snext47 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Normal, 4), -- Inner indented
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*4,
Style_Before => 0,
Style_After => 120,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s48\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-220\slmult0 \snext48 ");
Set_Style (Paragraph_Info(ARM_Output.Small, 6), -- Inner indented
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => INDENT_UNIT*6,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s49\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-180\slmult0 \snext49 ");
Set_Style (Paragraph_Info(ARM_Output.Small, 3), -- Annotations in syntax indentation
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => INDENT_UNIT*3,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s50\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-180\slmult0 \snext50 ");
Set_Style (Paragraph_Info(ARM_Output.Swiss_Examples, 1),
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 16,
Style_Indent => INDENT_UNIT*1,
Style_Before => 0,
Style_After => 80,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s51\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\sl-180\ql \snext51 ");
Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 3),
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 14,
Style_Indent => INDENT_UNIT*3,
Style_Before => 0,
Style_After => 70,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s52\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\sl-160\ql \snext52 ");
Set_Style (Paragraph_Info(ARM_Output.Swiss_Examples, 4), -- Indented
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 16,
Style_Indent => INDENT_UNIT*4,
Style_Before => 0,
Style_After => 80,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s53\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-180 \snext53 ");
Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 6), -- Indented
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 14,
Style_Indent => INDENT_UNIT*6,
Style_Before => 0,
Style_After => 70,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s54\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-160 \snext54 ");
Set_Style (Paragraph_Info(ARM_Output.Enumerated, 3), -- Doubly nested enumerations
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*3,
Style_Hang_Width => 260,
Style_Before => 0,
Style_After => 100,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s55\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx360 \snext43 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Enumerated, 5), -- Doubly nested enumerations
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => INDENT_UNIT*5,
Style_Hang_Width => 240,
Style_Before => 0,
Style_After => 80,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s56\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-170\slmult0\tx1080 \snext56 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Examples, 2), -- Syntax Indented examples
Font => ARM_Output.Fixed,
Body_Font => Output_Object.Body_Font,
Font_Size => 16,
Style_Indent => INDENT_UNIT*2,
Style_Before => 0,
Style_After => 80,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s57\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-160 \snext57 ");
Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 4), -- Syntax Indented annotation examples.
Font => ARM_Output.Fixed,
Body_Font => Output_Object.Body_Font,
Font_Size => 14,
Style_Indent => INDENT_UNIT*4,
Style_Before => 0,
Style_After => 70,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s58\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-140 \snext58 ");
Set_Style (Paragraph_Info(ARM_Output.Swiss_Examples, 2), -- Syntax Indented
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 16,
Style_Indent => INDENT_UNIT*2,
Style_Before => 0,
Style_After => 80,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s59\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-180 \snext59 ");
Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 4), -- Syntax Indented
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 14,
Style_Indent => INDENT_UNIT*4,
Style_Before => 0,
Style_After => 70,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s60\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-160 \snext60 ");
Set_Style (Paragraph_Info(ARM_Output.Examples, 3), -- Code Indented examples
Font => ARM_Output.Fixed,
Body_Font => Output_Object.Body_Font,
Font_Size => 16,
Style_Indent => INDENT_UNIT*3,
Style_Before => 0,
Style_After => 80,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s61\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-160 \snext61 ");
Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 5), -- Code Indented annotation examples.
Font => ARM_Output.Fixed,
Body_Font => Output_Object.Body_Font,
Font_Size => 14,
Style_Indent => INDENT_UNIT*5,
Style_Before => 0,
Style_After => 70,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s62\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-140 \snext62 ");
Set_Style (Paragraph_Info(ARM_Output.Swiss_Examples, 3), -- Code Indented
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 16,
Style_Indent => INDENT_UNIT*3,
Style_Before => 0,
Style_After => 80,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s63\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-180 \snext63 ");
Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 5), -- Code Indented
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 14,
Style_Indent => INDENT_UNIT*5,
Style_Before => 0,
Style_After => 70,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s64\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-160 \snext64 ");
Set_Style (Paragraph_Info(ARM_Output.Title, 0),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 34, -- Slightly less than double.
Style_Indent => 0,
Style_Before => 120,
Style_After => 120,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s65\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-360\slmult0 \snext0 ");
Set_Style (Paragraph_Info(ARM_Output.Giant_Hanging, 4),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*4,
Style_Hang_Width => 1440,
Style_Before => 0,
Style_After => 100,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s66\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext66 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Medium_Hanging, 2),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*2,
Style_Hang_Width => 720,
Style_Before => 0,
Style_After => 100,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s67\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext67 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Giant_Hanging, 6),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => INDENT_UNIT*6,
Style_Hang_Width => 1440,
Style_Before => 0,
Style_After => 80,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s68\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-170\slmult0 \snext68 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Medium_Hanging, 4),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => INDENT_UNIT*4,
Style_Hang_Width => 720,
Style_Before => 0,
Style_After => 80,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s69\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-170\slmult0 \snext69 ");
-- Note: Narrower space between and afterwards.
-- The following are indented one extra level:
Set_Style (Paragraph_Info(ARM_Output.Narrow_Hanging, 2),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*2,
Style_Hang_Width => 360,
Style_Before => 0,
Style_After => 100,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s70\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext70 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Medium_Hanging, 3),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*3,
Style_Hang_Width => 720,
Style_Before => 0,
Style_After => 100,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s71\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext71 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Wide_Hanging, 4),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*4,
Style_Hang_Width => 1080,
Style_Before => 0,
Style_After => 100,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s72\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext72 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Narrow_Hanging, 4),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => INDENT_UNIT*4,
Style_Hang_Width => 360,
Style_Before => 0,
Style_After => 80,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s73\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-170\slmult0 \snext73 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Medium_Hanging, 5),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => INDENT_UNIT*5,
Style_Hang_Width => 720,
Style_Before => 0,
Style_After => 80,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s74\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-170\slmult0 \snext74 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Wide_Hanging, 6),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => INDENT_UNIT*6,
Style_Hang_Width => 1080,
Style_Before => 0,
Style_After => 80,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s75\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-170\slmult0 \snext75 ");
-- Note: Narrower space between and afterwards.
-- The following are indented two extra levels:
Set_Style (Paragraph_Info(ARM_Output.Narrow_Hanging, 3),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*3,
Style_Hang_Width => 360,
Style_Before => 0,
Style_After => 100,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s76\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext76 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Medium_Hanging, 4),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*4,
Style_Hang_Width => 720,
Style_Before => 0,
Style_After => 100,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s77\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext77 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Narrow_Hanging, 5),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => INDENT_UNIT*5,
Style_Hang_Width => 360,
Style_Before => 0,
Style_After => 80,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s78\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-170\slmult0 \snext78 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Medium_Hanging, 6),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => INDENT_UNIT*6,
Style_Hang_Width => 720,
Style_Before => 0,
Style_After => 80,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s79\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-170\slmult0 \snext79 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 2), -- Notes indent
Font => ARM_Output.Fixed,
Body_Font => Output_Object.Body_Font,
Font_Size => 14,
Style_Indent => INDENT_UNIT*2,
Style_Before => 0,
Style_After => 70,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s80\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\sl-140\ql \snext80 ");
Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 1),
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 14,
Style_Indent => INDENT_UNIT*1,
Style_Before => 0,
Style_After => 70,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s81\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\sl-160\ql \snext81 ");
Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 2),
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 14,
Style_Indent => INDENT_UNIT*1,
Style_Before => 0,
Style_After => 70,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s82\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\sl-160\ql \snext82 ");
Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 1),
Font => ARM_Output.Fixed,
Body_Font => Output_Object.Body_Font,
Font_Size => 14,
Style_Indent => INDENT_UNIT*1,
Style_Before => 0,
Style_After => 70,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s83\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\sl-140\ql \snext83 ");
Set_Style (Paragraph_Info(ARM_Output.Examples, 5), -- Child Indented examples
Font => ARM_Output.Fixed,
Body_Font => Output_Object.Body_Font,
Font_Size => 16,
Style_Indent => INDENT_UNIT*5,
Style_Before => 0,
Style_After => 80,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s84\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-160 \snext84 ");
Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 7), -- Child Indented annotation examples.
Font => ARM_Output.Fixed,
Body_Font => Output_Object.Body_Font,
Font_Size => 14,
Style_Indent => INDENT_UNIT*7,
Style_Before => 0,
Style_After => 70,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s85\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-140 \snext85 ");
-- The following are indented three extra levels:
Set_Style (Paragraph_Info(ARM_Output.Narrow_Hanging, 4),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*4,
Style_Hang_Width => 360,
Style_Before => 0,
Style_After => 100,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s86\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext86 ");
-- Note: Narrower space between and afterwards.
-- New styles should be added here, following numbers will need adjustments.
Set_Style (Heading_4_Info,
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => 0,
Style_Before => 210,
Style_After => 90,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s87\keepn\widctlpar\outlinelevel3\adjustright",
Style_String_Suffix => "\b\ql\cgrid \sbasedon0 \snext0 ");
if Output_Object.Big_Files then
-- Define the TOC styles:
Set_Style (TOC_1_Info,
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 20,
Style_Indent => 0,
Style_Before => 45,
Style_After => 45,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s88\widctlpar\tqr\tldot\tx" & Paper_Width & "\adjustright",
Style_String_Suffix => "\b\cgrid \sbasedon0 \snext0 ");
Set_Style (TOC_2_Info,
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 17,
Style_Indent => 200,
Style_Before => 0,
Style_After => 0,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s89\widctlpar\tqr\tldot\tx" & Paper_Width & "\adjustright",
Style_String_Suffix => "\b\cgrid \sbasedon0 \snext0 ");
Set_Style (TOC_3_Info,
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 17,
Style_Indent => 400,
Style_Before => 0,
Style_After => 0,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s90\widctlpar\tqr\tldot\tx" & Paper_Width & "\adjustright",
Style_String_Suffix => "\b\cgrid \sbasedon0 \snext0 ");
Set_Style (TOC_4_Info,
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 17,
Style_Indent => 600,
Style_Before => 0,
Style_After => 0,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s91\widctlpar\tqr\tldot\tx" & Paper_Width & "\adjustright",
Style_String_Suffix => "\b\cgrid \sbasedon0 \snext0 ");
end if;
Set_Style (Table_C_Text_Info,
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => 0,
Style_Before => 20,
Style_After => 20,
Style_Justified => FALSE,
Style_String_Prefix => "",
Style_String_Suffix => "\qc ");
-- We use a bit of space above and below to avoid overrunning
-- the borders of the cells.
Set_Style (Table_L_Text_Info,
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => 0,
Style_Before => 20,
Style_After => 20,
Style_Justified => FALSE,
Style_String_Prefix => "",
Style_String_Suffix => "\ql ");
Set_Style (Table_C_Sml_Text_Info,
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => 0,
Style_Before => 20,
Style_After => 20,
Style_Justified => FALSE,
Style_String_Prefix => "",
Style_String_Suffix => "\qc ");
Set_Style (Table_L_Sml_Text_Info,
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 15,
Style_Indent => 0,
Style_Before => 20,
Style_After => 20,
Style_Justified => FALSE,
Style_String_Prefix => "",
Style_String_Suffix => "\ql ");
else
Set_Style (Paragraph_Info(ARM_Output.Normal, 0),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => 0,
Style_Before => 0,
Style_After => 120,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s0\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-260\slmult0 \snext0 ");
Set_Style (Heading_1_Info,
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 36,
Style_Indent => 0,
Style_Before => 0,
Style_After => 210,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s1\keepn\widctlpar\outlinelevel0\adjustright",
Style_String_Suffix => "\b\kerning36\qc\cgrid \sbasedon0 \snext0 ");
Set_Style (Heading_2_Info,
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 28,
Style_Indent => 0,
Style_Before => 240,
Style_After => 120,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s2\keepn\widctlpar\outlinelevel1\adjustright",
Style_String_Suffix => "\b\ql\cgrid \sbasedon0 \snext0 ");
Set_Style (Heading_3_Info,
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 28,
Style_Indent => 0,
Style_Before => 210,
Style_After => 100,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s3\keepn\widctlpar\outlinelevel2\adjustright",
Style_String_Suffix => "\b\ql\cgrid \sbasedon0 \snext0 ");
Set_Style (Category_Header_Info,
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 16,
Style_Indent => 0,
Style_Before => 120,
Style_After => 120,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s4\keepn\adjustright",
Style_String_Suffix => "\cgrid\qc\i \snext0 ");
Set_Style (Normal_Paragraph_Number_Info,
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 14,
Style_Indent => 0,
Style_Before => 0,
Style_After => 0,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s5\keepn\widctlpar\adjustright " &
"\pvpara\phpg\posxo\posy0\absw580\dxfrtext100\dfrmtxtx150\dfrmtxty150"&
"\cgrid\qc",
Style_String_Suffix => "\snext0 "); -- We adjust the space before for each number.
-- Frame commands:
-- \pvpara - positions the frame vertically with the next paragraph;
-- \phpg - positions the frame horizonatally within the page;
-- \posxo - positions the paragraph outside of the frame;
-- \posy0 - positions the paragraph at the top of the frame;
-- \absw - frame width in twips (640);
-- \dxfrtext - distance of frame from text in all directions (twips);
-- \dfrmtxtx - horizontal distance of text from frame (twips);
-- \dfrmtxty - vertical distance of text from frame (twips).
Set_Style (Wide_Paragraph_Number_Info,
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 14,
Style_Indent => 0,
Style_Before => 0,
Style_After => 0,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s5\keepn\widctlpar\adjustright " &
"\pvpara\phpg\posxo\posy0\absw640\dxfrtext100\dfrmtxtx150\dfrmtxty150"&
"\cgrid\qc",
Style_String_Suffix => "\snext0 "); -- We adjust the space before for each number.
Set_Style (Paragraph_Info(ARM_Output.Small, 1), -- Notes
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*1,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s6\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext6 ");
Set_Style (Paragraph_Info(ARM_Output.Small, 2), -- Annotations
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*2,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s7\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext7 ");
Set_Style (Paragraph_Info(ARM_Output.Examples, 1),
Font => ARM_Output.Fixed,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*1,
Style_Before => 0,
Style_After => 100,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s8\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-190\slmult0 \snext8 ");
Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 3),
Font => ARM_Output.Fixed,
Body_Font => Output_Object.Body_Font,
Font_Size => 16,
Style_Indent => INDENT_UNIT*3,
Style_Before => 0,
Style_After => 80,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s9\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-170\slmult0 \snext9 ");
Set_Style (Paragraph_Info(ARM_Output.Normal, 1), -- Syntax indented
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => INDENT_UNIT*1,
Style_Before => 0,
Style_After => 100,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s10\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-240 \snext10 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Normal, 3), -- Indented
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => INDENT_UNIT*3,
Style_Before => 0,
Style_After => 120,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s11\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-260\slmult0 \snext11 ");
Set_Style (Paragraph_Info(ARM_Output.Small, 5), -- Indented annotations
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*5,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s12\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext12 ");
Set_Style (Paragraph_Info(ARM_Output.Wide_Hanging, 3),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => INDENT_UNIT*3,
Style_Hang_Width => 1080,
Style_Before => 0,
Style_After => 110,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s13\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext13 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Narrow_Hanging, 1),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => INDENT_UNIT*1,
Style_Hang_Width => 360,
Style_Before => 0,
Style_After => 120,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s14\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext14 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Wide_Hanging, 5), -- Indented two levels for use in indented text.
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*5,
Style_Hang_Width => 1080,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s15\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-190\slmult0 \snext15 ");
-- Note: Narrower space between.
Set_Style (Paragraph_Info(ARM_Output.Small_Narrow_Hanging, 3), -- Indented two levels for use in indented text.
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*3,
Style_Hang_Width => 360,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s16\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-190\slmult0 \snext16 ");
-- Note: Narrower space between.
Set_Style (Paragraph_Info(ARM_Output.Bulleted, 1),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => INDENT_UNIT*1,
Style_Hang_Width => 250,
Style_Before => 0,
Style_After => 110,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s17\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx360 \snext17 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Nested_Bulleted, 2),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => INDENT_UNIT*2,
Style_Hang_Width => 220,
Style_Before => 0,
Style_After => 110,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s18\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx720 \snext18 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Bulleted, 3),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*3,
Style_Hang_Width => 220,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s19\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-190\slmult0\tx1080 \snext19 ");
-- Note: Narrower space between.
Set_Style (Paragraph_Info(ARM_Output.Small_Nested_Bulleted, 4),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*4,
Style_Hang_Width => 200,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s20\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-190\slmult0\tx1440 \snext20 ");
-- Note: Narrower space between.
Set_Style (Paragraph_Info(ARM_Output.Bulleted, 4), -- Indented bulleted
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => INDENT_UNIT*4,
Style_Hang_Width => 250,
Style_Before => 0,
Style_After => 110,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s21\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx1080 \snext21 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Bulleted, 2), -- Bullets in syntax indenting
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => INDENT_UNIT*2,
Style_Hang_Width => 250,
Style_Before => 0,
Style_After => 110,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s22\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx720 \snext22 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Bulleted, 3), -- Bullets in syntax indenting
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => INDENT_UNIT*3,
Style_Hang_Width => 250,
Style_Before => 0,
Style_After => 110,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s23\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx1080 \snext23 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Normal, 2), -- Code indenting
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => INDENT_UNIT*2,
Style_Before => 0,
Style_After => 120,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s24\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-260\slmult0 \snext24 ");
Set_Style (Paragraph_Info(ARM_Output.Small, 4), -- Annotations in code indenting
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*4,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s25\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext25 ");
Set_Style (Paragraph_Info(ARM_Output.Examples, 4), -- Indented examples
Font => ARM_Output.Fixed,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*4,
Style_Before => 0,
Style_After => 100,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s26\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-190\slmult0 \snext26 ");
Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 6), -- Indented examples in annotations.
Font => ARM_Output.Fixed,
Body_Font => Output_Object.Body_Font,
Font_Size => 16,
Style_Indent => INDENT_UNIT*6,
Style_Before => 0,
Style_After => 80,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s27\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-170\slmult0 \snext27 ");
Set_Style (Header_Info,
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 20,
Style_Indent => 0,
Style_Before => 0,
Style_After => 0,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s28\widctlpar\tqc\tx" & Half_Paper_Width &
"\tqr\tx" & Paper_Width & "\adjustright",
Style_String_Suffix => "\cgrid \sbasedon0 \snext28 ");
Set_Style (Footer_Info,
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 20,
Style_Indent => 0,
Style_Before => 0,
Style_After => 0,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s29\widctlpar" & -- "\tqc\tx" & Half_Paper_Width & -- We don't use or define the center tab; it causes problems with very long titles.
"\tqr\tx" & Paper_Width & "\adjustright",
Style_String_Suffix => "\cgrid \sbasedon0 \snext29 ");
Set_Style (Paragraph_Info(ARM_Output.Index, 0),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => 270,
Style_Hang_Width => 270,
Style_Before => 0,
Style_After => 0,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s31\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-200\slmult0 \snext31 ");
Set_Style (Paragraph_Info(ARM_Output.Wide_Above, 0),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => 0,
Style_Before => 120,
Style_After => 120,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s32\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-260\slmult0 \snext0 ");
Set_Style (Paragraph_Info(ARM_Output.Small_Wide_Above, 2), -- Wide above annotations.
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*2,
Style_Before => 90,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s33\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext7 ");
Set_Style (Paragraph_Info(ARM_Output.Small_Header, 1), -- Notes header
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*1,
Style_Before => 0,
Style_After => 0,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s34\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext6 ");
-- Note: No space afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Bulleted, 2), -- Bullets in notes
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*2,
Style_Hang_Width => 250,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s35\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-190\slmult0\tx720 \snext35 ");
-- Note: Narrower space between.
Set_Style (Paragraph_Info(ARM_Output.Small_Nested_Bulleted, 3), -- Nested bullets in notes
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*3,
Style_Hang_Width => 220,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s36\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-190\slmult0\tx1080 \snext36 ");
-- Note: Narrower space between.
Set_Style (Paragraph_Info(ARM_Output.Hanging_in_Bulleted, 3),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => INDENT_UNIT*3,
Style_Hang_Width => 720,
Style_Before => 0,
Style_After => 110,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s37\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0 \snext14 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Hanging_in_Bulleted, 5),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*5,
Style_Hang_Width => 720,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s38\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-190\slmult0 \snext16 ");
-- Note: Narrower space between.
Set_Style (Paragraph_Info(ARM_Output.Nested_Bulleted, 4), -- Nested bullets in code indenting
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => INDENT_UNIT*4,
Style_Hang_Width => 220,
Style_Before => 0,
Style_After => 110,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s39\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx1440 \snext39 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Syntax_Summary, 1),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*1,
Style_Before => 0,
Style_After => 90,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s40\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-200\slmult0 \snext40 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Enumerated, 1),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => INDENT_UNIT*1,
Style_Hang_Width => 250,
Style_Before => 0,
Style_After => 110,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s41\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx360 \snext41 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Enumerated, 3),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*3,
Style_Hang_Width => 220,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s42\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-190\slmult0\tx1080 \snext42 ");
-- Note: Narrower space between.
Set_Style (Paragraph_Info(ARM_Output.Enumerated, 2), -- Nested enumerations.
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => INDENT_UNIT*2,
Style_Hang_Width => 270,
Style_Before => 0,
Style_After => 110,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s43\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx360 \snext43 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Enumerated, 4), -- Small nested enumerations.
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*4,
Style_Hang_Width => 240,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s44\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-190\slmult0\tx1080 \snext44 ");
-- Note: Narrower space between.
Set_Style (Paragraph_Info(ARM_Output.Nested_Bulleted, 3), -- Doubly nested bullets
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => INDENT_UNIT*3,
Style_Hang_Width => 220,
Style_Before => 0,
Style_After => 110,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s45\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx720 \snext45 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Nested_Bulleted, 5), -- Doubly nested bullets
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*5,
Style_Hang_Width => 200,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s46\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-190\slmult0\tx1440 \snext46 ");
-- Note: Narrower space between.
Set_Style (Paragraph_Info(ARM_Output.Nested_Bulleted, 5), -- Indented nested bullets
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => INDENT_UNIT*5,
Style_Hang_Width => 250,
Style_Before => 0,
Style_After => 110,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s47\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx1080 \snext47 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Normal, 4), -- Inner indented
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => INDENT_UNIT*4,
Style_Before => 0,
Style_After => 120,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s48\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-260\slmult0 \snext48 ");
Set_Style (Paragraph_Info(ARM_Output.Small, 6), -- Inner indented
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*6,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s49\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext49 ");
Set_Style (Paragraph_Info(ARM_Output.Small, 3), -- Annotations in syntax indenting
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*4,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s50\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext50 ");
Set_Style (Paragraph_Info(ARM_Output.Swiss_Examples, 1),
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 20,
Style_Indent => INDENT_UNIT*1,
Style_Before => 0,
Style_After => 110,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s51\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-240\slmult0 \snext51 ");
Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 3),
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 16,
Style_Indent => INDENT_UNIT*3,
Style_Before => 0,
Style_After => 80,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s52\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-180\slmult0 \snext52 ");
Set_Style (Paragraph_Info(ARM_Output.Swiss_Examples, 4), -- Indented examples
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 20,
Style_Indent => INDENT_UNIT*4,
Style_Before => 0,
Style_After => 110,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s53\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-240\slmult0 \snext53 ");
Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 6), -- Indented examples
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 16,
Style_Indent => INDENT_UNIT*6,
Style_Before => 0,
Style_After => 80,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s54\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-180\slmult0 \snext54 ");
Set_Style (Paragraph_Info(ARM_Output.Enumerated, 3), -- Doubly nested enumerations.
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => INDENT_UNIT*3,
Style_Hang_Width => 270,
Style_Before => 0,
Style_After => 110,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s55\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx360 \snext55 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Enumerated, 5), -- Small doubly nested enumerations.
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*5,
Style_Hang_Width => 240,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s56\widctlpar\adjustright",
Style_String_Suffix => "\ri360\cgrid\qj\sl-190\slmult0\tx1080 \snext56 ");
-- Note: Narrower space between.
Set_Style (Paragraph_Info(ARM_Output.Examples, 2), -- Syntax Indented examples
Font => ARM_Output.Fixed,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*2,
Style_Before => 0,
Style_After => 100,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s57\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-190\slmult0 \snext57 ");
Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 4), -- Syntax Indented examples in annotations.
Font => ARM_Output.Fixed,
Body_Font => Output_Object.Body_Font,
Font_Size => 16,
Style_Indent => INDENT_UNIT*4,
Style_Before => 0,
Style_After => 80,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s58\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-170\slmult0 \snext58 ");
Set_Style (Paragraph_Info(ARM_Output.Swiss_Examples, 2), -- Syntax Indented examples
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 20,
Style_Indent => INDENT_UNIT*2,
Style_Before => 0,
Style_After => 110,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s59\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-240\slmult0 \snext59 ");
Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 4), -- Syntax Indented examples
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 16,
Style_Indent => INDENT_UNIT*4,
Style_Before => 0,
Style_After => 80,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s60\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-180\slmult0 \snext60 ");
Set_Style (Paragraph_Info(ARM_Output.Examples, 3), -- Code Indented examples
Font => ARM_Output.Fixed,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*3,
Style_Before => 0,
Style_After => 100,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s61\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-190\slmult0 \snext61 ");
Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 5), -- Code Indented examples in annotations.
Font => ARM_Output.Fixed,
Body_Font => Output_Object.Body_Font,
Font_Size => 16,
Style_Indent => INDENT_UNIT*5,
Style_Before => 0,
Style_After => 80,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s62\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-170\slmult0 \snext62 ");
Set_Style (Paragraph_Info(ARM_Output.Swiss_Examples, 3), -- Code Indented examples
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 20,
Style_Indent => INDENT_UNIT*3,
Style_Before => 0,
Style_After => 110,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s63\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-240\slmult0 \snext63 ");
Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 5), -- Code Indented examples
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 16,
Style_Indent => INDENT_UNIT*5,
Style_Before => 0,
Style_After => 80,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s64\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-180\slmult0 \snext64 ");
Set_Style (Paragraph_Info(ARM_Output.Title, 0),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 42, -- Slight less than double (3 pts larger than Heading_1).
Style_Indent => 0,
Style_Before => 120,
Style_After => 120,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s65\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-440\slmult0 \snext0 ");
Set_Style (Paragraph_Info(ARM_Output.Giant_Hanging, 4),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => INDENT_UNIT*4,
Style_Hang_Width => 1440,
Style_Before => 0,
Style_After => 110,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s66\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext66 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Medium_Hanging, 2),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => INDENT_UNIT*2,
Style_Hang_Width => 720,
Style_Before => 0,
Style_After => 120,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s67\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext67 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Giant_Hanging, 6),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*6,
Style_Hang_Width => 1440,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s68\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-190\slmult0 \snext68 ");
-- Note: Narrower space between.
Set_Style (Paragraph_Info(ARM_Output.Small_Medium_Hanging, 4),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*4,
Style_Hang_Width => 720,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s69\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-190\slmult0 \snext69 ");
-- Note: Narrower space between.
-- The following are indented one extra level:
Set_Style (Paragraph_Info(ARM_Output.Narrow_Hanging, 2),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => INDENT_UNIT*2,
Style_Hang_Width => 360,
Style_Before => 0,
Style_After => 120,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s70\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext70 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Medium_Hanging, 3),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => INDENT_UNIT*3,
Style_Hang_Width => 720,
Style_Before => 0,
Style_After => 120,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s71\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext71 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Wide_Hanging, 4),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => INDENT_UNIT*4,
Style_Hang_Width => 1080,
Style_Before => 0,
Style_After => 120,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s72\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext72 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Narrow_Hanging, 4),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*4,
Style_Hang_Width => 360,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s73\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-190\slmult0 \snext73 ");
-- Note: Narrower space between.
Set_Style (Paragraph_Info(ARM_Output.Small_Medium_Hanging, 5),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*5,
Style_Hang_Width => 720,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s74\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-190\slmult0 \snext74 ");
-- Note: Narrower space between.
Set_Style (Paragraph_Info(ARM_Output.Small_Wide_Hanging, 6),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*6,
Style_Hang_Width => 1080,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s75\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-190\slmult0 \snext75 ");
-- Note: Narrower space between.
-- The following are indented two extra levels:
Set_Style (Paragraph_Info(ARM_Output.Narrow_Hanging, 3),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => INDENT_UNIT*3,
Style_Hang_Width => 360,
Style_Before => 0,
Style_After => 120,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s76\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext76 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Medium_Hanging, 4),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => INDENT_UNIT*4,
Style_Hang_Width => 720,
Style_Before => 0,
Style_After => 120,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s77\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext77 ");
-- Note: Narrower space between and afterwards.
Set_Style (Paragraph_Info(ARM_Output.Small_Narrow_Hanging, 5),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*5,
Style_Hang_Width => 360,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s78\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-190\slmult0 \snext78 ");
-- Note: Narrower space between.
Set_Style (Paragraph_Info(ARM_Output.Small_Medium_Hanging, 6),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*6,
Style_Hang_Width => 720,
Style_Before => 0,
Style_After => 90,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s79\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-190\slmult0 \snext79 ");
-- Note: Narrower space between.
Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 2), -- Indented for notes.
Font => ARM_Output.Fixed,
Body_Font => Output_Object.Body_Font,
Font_Size => 16,
Style_Indent => INDENT_UNIT*2,
Style_Before => 0,
Style_After => 80,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s80\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-170\slmult0 \snext80 ");
Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 1),
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 16,
Style_Indent => INDENT_UNIT*1,
Style_Before => 0,
Style_After => 80,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s81\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-180\slmult0 \snext81 ");
Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 2),
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 16,
Style_Indent => INDENT_UNIT*2,
Style_Before => 0,
Style_After => 80,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s82\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-180\slmult0 \snext82 ");
Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 1),
Font => ARM_Output.Fixed,
Body_Font => Output_Object.Body_Font,
Font_Size => 16,
Style_Indent => INDENT_UNIT*1,
Style_Before => 0,
Style_After => 80,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s83\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-170\slmult0 \snext83 ");
Set_Style (Paragraph_Info(ARM_Output.Examples, 5), -- Child Indented examples
Font => ARM_Output.Fixed,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => INDENT_UNIT*5,
Style_Before => 0,
Style_After => 100,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s84\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-190\slmult0 \snext84 ");
Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 7), -- Child Indented examples in annotations.
Font => ARM_Output.Fixed,
Body_Font => Output_Object.Body_Font,
Font_Size => 16,
Style_Indent => INDENT_UNIT*7,
Style_Before => 0,
Style_After => 80,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s85\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\ql\sl-170\slmult0 \snext85 ");
-- The following are indented three extra levels:
Set_Style (Paragraph_Info(ARM_Output.Narrow_Hanging, 4),
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => INDENT_UNIT*4,
Style_Hang_Width => 360,
Style_Before => 0,
Style_After => 120,
Style_Justified => TRUE,
Style_String_Prefix =>
"\s86\widctlpar\adjustright",
Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext86 ");
-- Note: Narrower space between and afterwards.
-- New styles should be added here, following numbers will need adjustments.
Set_Style (Heading_4_Info,
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 27,
Style_Indent => 0,
Style_Before => 210,
Style_After => 100,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s87\keepn\widctlpar\outlinelevel3\adjustright",
Style_String_Suffix => "\b\ql\cgrid \sbasedon0 \snext0 ");
if Output_Object.Big_Files then
-- Define the TOC styles:
Set_Style (TOC_1_Info,
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 24,
Style_Indent => 0,
Style_Before => 60,
Style_After => 60,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s88\widctlpar\tqr\tldot\tx" & Paper_Width & "\adjustright",
Style_String_Suffix => "\b\cgrid \sbasedon0 \snext0 ");
Set_Style (TOC_2_Info,
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => 200,
Style_Before => 0,
Style_After => 0,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s89\widctlpar\tqr\tldot\tx" & Paper_Width & "\adjustright",
Style_String_Suffix => "\b\cgrid \sbasedon0 \snext0 ");
Set_Style (TOC_3_Info,
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => 400,
Style_Before => 0,
Style_After => 0,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s90\widctlpar\tqr\tldot\tx" & Paper_Width & "\adjustright",
Style_String_Suffix => "\b\cgrid \sbasedon0 \snext0 ");
Set_Style (TOC_4_Info,
Font => ARM_Output.Swiss,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => 600,
Style_Before => 0,
Style_After => 0,
Style_Justified => FALSE,
Style_String_Prefix =>
"\s91\widctlpar\tqr\tldot\tx" & Paper_Width & "\adjustright",
Style_String_Suffix => "\b\cgrid \sbasedon0 \snext0 ");
end if;
Set_Style (Table_C_Text_Info,
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => 0,
Style_Before => 10,
Style_After => 10,
Style_Justified => FALSE,
Style_String_Prefix => "",
Style_String_Suffix => "\qc ");
-- We use a bit of space above and below to avoid overrunning
-- the borders of the cells.
Set_Style (Table_L_Text_Info,
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 22,
Style_Indent => 0,
Style_Before => 20,
Style_After => 20,
Style_Justified => FALSE,
Style_String_Prefix => "",
Style_String_Suffix => "\ql ");
Set_Style (Table_C_Sml_Text_Info,
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => 0,
Style_Before => 20,
Style_After => 20,
Style_Justified => FALSE,
Style_String_Prefix => "",
Style_String_Suffix => "\qc ");
Set_Style (Table_L_Sml_Text_Info,
Font => ARM_Output.Default,
Body_Font => Output_Object.Body_Font,
Font_Size => 18,
Style_Indent => 0,
Style_Before => 20,
Style_After => 20,
Style_Justified => FALSE,
Style_String_Prefix => "",
Style_String_Suffix => "\ql ");
end if;
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Normal, 0));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Normal;}");
-- Normal style.
Write_Style (Output_Object.Output_File, Heading_1_Info);
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Heading 1;}");
Write_Style (Output_Object.Output_File, Heading_2_Info);
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Heading 2;}");
Write_Style (Output_Object.Output_File, Heading_3_Info);
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Heading 3;}");
Write_Style (Output_Object.Output_File, Category_Header_Info);
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Category Header;}");
Write_Style (Output_Object.Output_File, Normal_Paragraph_Number_Info);
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Paragraph Number;}");
Write_Style (Output_Object.Output_File, Wide_Paragraph_Number_Info);
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Large Paragraph Number;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small, 1));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Notes;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small, 2));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Annotations;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Examples, 1));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Examples;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Examples, 3));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Examples;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Normal, 1));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Syntax Indented;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Normal, 3));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Normal Indented;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small, 5));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Indented;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Wide_Hanging, 3));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Hanging;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Narrow_Hanging, 1));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Narrow Hanging;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Wide_Hanging, 5));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Hanging;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Narrow_Hanging, 3));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Narrow Hanging;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Bulleted, 1));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Bulleted;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Nested_Bulleted, 2));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Nested Bulleted;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Bulleted, 3));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Bulleted;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Nested_Bulleted, 4));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Nested Bulleted;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Bulleted, 4));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Indented Bulleted;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Bulleted, 2));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Syntax Indented Bulleted;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Bulleted, 3));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Code Indented Bulleted;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Normal, 2));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Code Indented;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small, 4));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Code Indented;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Examples, 4));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Indented Examples;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Examples, 6));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Indented Examples;}");
Write_Style (Output_Object.Output_File, Header_Info);
Ada.Text_IO.Put_Line (Output_Object.Output_File, "header;}");
Write_Style (Output_Object.Output_File, Footer_Info);
Ada.Text_IO.Put_Line (Output_Object.Output_File, "footer;}");
Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\*\cs30 \additive \sbasedon30 page number;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Index, 0));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Index;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Wide_Above, 0));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Wide;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Wide_Above, 2));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Wide Annotations;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Header, 1));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Notes Header;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Bulleted, 2));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Notes Bulleted;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Nested_Bulleted, 3));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Notes Nested Bulleted;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Hanging_in_Bulleted, 3));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Hanging in Bulleted;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Hanging_in_Bulleted, 5));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Hanging in Bulleted;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Nested_Bulleted, 4));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Code Indented Bulleted;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Syntax_Summary, 1));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Syntax Summary;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Enumerated, 1));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Enumerated;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Enumerated, 3));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Enumerated;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Enumerated, 2));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Nested Enumerated;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Enumerated, 4));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Nested Enumerated;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Nested_Bulleted, 3));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Nested X2 Bulleted;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Nested_Bulleted, 5));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Nested X2 Bulleted;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Nested_Bulleted, 5));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Indented Nested Bulleted;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Normal, 4));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Inner Indented;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small, 6));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Inner Indented;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small, 3));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Syntax Indented;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Swiss_Examples, 1));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Swiss Examples;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Swiss_Examples, 3));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Swiss Examples;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Swiss_Examples, 4));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Swiss Indented Examples;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Swiss_Examples, 6));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Swiss Indented Examples;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Enumerated, 3));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Nested X2 Enumerated;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Enumerated, 5));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Nested X2 Enumerated;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Examples, 2));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Syntax Indented Examples;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Examples, 4));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Syntax Indented Examples;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Swiss_Examples, 2));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Swiss Syntax Indented Examples;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Swiss_Examples, 4));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Swiss Syntax Indented Examples;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Examples, 3));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Code Indented Examples;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Examples, 5));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Code Indented Examples;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Swiss_Examples, 3));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Swiss Code Indented Examples;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Swiss_Examples, 5));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Swiss Code Indented Examples;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Title, 0));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Standard Title;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Giant_Hanging, 4));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Giant Hanging;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Medium_Hanging, 2));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Medium Hanging;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Giant_Hanging, 6));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Giant Hanging;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Medium_Hanging, 4));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Medium Hanging;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Narrow_Hanging, 2));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Indented Narrow Hanging;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Medium_Hanging, 3));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Indented Narrow Hanging;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Wide_Hanging, 4));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Indented Hanging;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Narrow_Hanging, 4));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Indented Narrow Hanging;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Medium_Hanging, 5));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Indented Medium Hanging;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Wide_Hanging, 6));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Indented Hanging;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Narrow_Hanging, 3));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Dbl Indented Narrow Hanging;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Medium_Hanging, 4));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Dbl Indented Narrow Hanging;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Narrow_Hanging, 5));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Dbl Indented Narrow Hanging;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Medium_Hanging, 6));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Dbl Indented Medium Hanging;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Examples, 2));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Notes Indented Examples;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Swiss_Examples, 1));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Swiss Basic Examples;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Swiss_Examples, 2));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Swiss Indented Basic Examples;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Examples, 1));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Basic Examples;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Examples, 5));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Child Indented Examples;}");
Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Examples, 6));
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Child Indented Examples;}");
if Output_Object.Big_Files then
Write_Style (Output_Object.Output_File, Heading_4_Info);
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Heading 4;}");
-- Define the TOC styles:
Write_Style (Output_Object.Output_File, TOC_1_Info);
Ada.Text_IO.Put_Line (Output_Object.Output_File, "toc 1;}");
Write_Style (Output_Object.Output_File, TOC_2_Info);
Ada.Text_IO.Put_Line (Output_Object.Output_File, "toc 2;}");
Write_Style (Output_Object.Output_File, TOC_3_Info);
Ada.Text_IO.Put_Line (Output_Object.Output_File, "toc 3;}");
Write_Style (Output_Object.Output_File, TOC_4_Info);
Ada.Text_IO.Put_Line (Output_Object.Output_File, "toc 4;}}");
else
Write_Style (Output_Object.Output_File, Heading_4_Info);
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Heading 4;}}");
end if;
-- \additive means that the style inherits from the previous style.
-- \basedon defines the style that the style was inherited from.
-- \snext defines the next style to use (if omitted, use same style).
-- \shidden - Don't show the style in the drop down menu.
-- Formatting properties:
-- \widctlpar - Widow/orphan control in this paragraph;
-- \adjustright - adjust right indent for document properties;
-- \fs - font size in halfpoints (.5 pt);
-- \f - font number;
-- \q - text alignment (j - justified, c - centered, l - left, r -right);
-- \cgrid - set the character grid(?) to the default;
-- \li - left indent, in twips (.1 pt);
-- \fi - first line indent, in twips (.1 pt);
-- \sa - space after paragraph, in twips (.1 pt);
-- \sb - space before paragraph, in twips (.1 pt);
-- \sl - space between lines, in twips. "Exactly" if negative, "At least" if positive.
-- \slmult0 - line space multiple - 0 - Exactly or "At least"/.
-- \pard - reset to default paragraph properties;
-- \plain - reset to default font/character properties;
-- \tx - set tab at location, in twips (.1 pt);
-- \tqc - set following tab as a centered tab;
-- \tqr - set following tab as a right tab.
-- Revision table:
Ada.Text_IO.Put (Output_Object.Output_File, "{\*\revtbl ");
if Ada.Strings.Unbounded.Length (Output_Object.Version_Names('0')) = 0 then
Ada.Text_IO.Put (Output_Object.Output_File, "{Original Text;}");
else
Ada.Text_IO.Put (Output_Object.Output_File, "{" &
Ada.Strings.Unbounded.To_String(Output_Object.Version_Names('0')) &
";}");
end if;
for Version in Character range '1' .. '9' loop
if Ada.Strings.Unbounded.Length (Output_Object.Version_Names(Version)) /= 0 then
Ada.Text_IO.Put (Output_Object.Output_File, "{" &
Ada.Strings.Unbounded.To_String(Output_Object.Version_Names(Version)) &
";}");
else exit; -- No more after the first empty one.
end if;
end loop;
Ada.Text_IO.Put_Line (Output_Object.Output_File, "}");
-- Information (truncated):
Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\info{\title " &
Ada.Strings.Unbounded.To_String (Output_Object.Title) & "}");
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\version2");
Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\author AXE Consultants}"); -- Working.
Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\operator Randall Brukardt, Principle Technician}}");
--Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\author JTC1/SC22/WG9/ARG}"); -- Final.
--Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\operator Randall Brukardt, ARG Editor}}");
-- Initial setup (document properties):
-- Paper size:
-- Note: If changing the page size or margins, be sure to change the
-- header and footer tab settings as well.
case Output_Object.Page_Size is
when ARM_RTF.A4 =>
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\paperw11909\paperh16834"); -- Set paper to A4.
when ARM_RTF.Letter =>
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\paperw12240\paperh15840"); -- Set paper to US Letter.
when ARM_RTF.Half_Letter =>
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\paperw7920\paperh12240"); -- Set paper to 5.5x8.5.
when ARM_RTF.Ada95 =>
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\paperw10080\paperh12960"); -- Set paper to 7x9.
end case;
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\facingp\margmirror"); -- Set to facing pages and mirrored margins.
-- Margins.
case Output_Object.Page_Size is
when ARM_RTF.Ada95 | ARM_RTF.Half_Letter =>
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\margl1440\margr900\margt1080\margb1080");
when ARM_RTF.Letter | ARM_RTF.A4 =>
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\margl1800\margr1080\margt1440\margb1440");
end case;
-- Revisions:
if Output_Object.Includes_Changes then
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\revisions\revprop3 \revbar0 ");
-- \revisions - Revisions marking is on;
-- \revprop3 - Show revisions as underlined.
-- \revbar0 - No revision bars.
-- Alternatively, use \revprop0\revbar3, using the infamous
-- vertical bar on the outside, and no other highlighting.
-- else not changes, thus no revisions.
end if;
-- Other properties:
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\widowctrl\ftnbj\aenddoc\lytprtmet\formshade\viewkind1\viewscale100");
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\pgbrdrhead\pgbrdrfoot\fet0");
-- \widowctrl - Enable widow and orphan control;
-- \ftnbj - Footnotes at bottom of page;
-- \aenddoc - Endnotes at end of document;
-- \lytprtmet - Layout using printer metrics;
-- \formshade - Form field shading is on;
-- \viewkind - Default view of the document (1-Page Layout; 4-Normal);
-- \viewscale100 - Percentage zoom of the document (100%);
-- \pgbrdrhead - Page border surrounds header;
-- \pgbrdrfoot - Page border surrounds footer;
-- \fet0 - Footnote/endnote control: 0 - Footnotes only (or none);
-- Section properties:
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sectd\linex0\endnhere\sectdefaultcl\sbkodd\headery540\footery540");
-- \sectd - Default section properties;
-- \linex0 - Line number spacing (0 - none);
-- \endnhere- Endnotes included;
-- \sectdefaultcl - Default character layout for section.
-- \sbkodd - Start at top of odd page.
-- \headery - Distance (in twips) of header from top of page.
-- \footery - Distance (in twips) of footerr from bottom of page.
if Name = "Ttl" or else -- Title page
Name = "All" then -- Single giant file
-- No page numbers, headers, or footers here.
null;
else
if Name = "00" or else Name = "TOC" then
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\pgnlcrm\pgncont "); -- Lower-case roman numeral, numbers continue.
elsif Name = "01" then
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\pgndec\pgnstart1\pgnrestart "); -- Decimal page number; starts at 1 here.
else
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\pgndec\pgncont "); -- Decimal page number, numbers continue.
end if;
-- Write the page headers:
Write_Headers (Output_Object);
end if;
Output_Object.Wrote_into_Section := False;
end Start_RTF_File;
procedure End_RTF_File (Output_Object : in out RTF_Output_Type) is
-- Internal routine.
-- Generate the needed text to end an RTF file. Also closes the file.
begin
Ada.Text_IO.Put_Line (Output_Object.Output_File, "}");
Ada.Text_IO.Close (Output_Object.Output_File);
end End_RTF_File;
procedure Create (Output_Object : in out RTF_Output_Type;
Page_Size : in ARM_RTF.Page_Size;
Includes_Changes : in Boolean;
Big_Files : in Boolean;
File_Prefix : in String;
Output_Path : in String;
Primary_Sans_Serif_Font : in Sans_Serif_Fonts := Arial;
Primary_Serif_Font : in Serif_Fonts := Times_New_Roman;
Body_Font : in ARM_Output.Font_Family_Type := ARM_Output.Roman;
Header_Prefix : in String := "";
Footer_Use_Date : in Boolean;
Footer_Use_Clause_Name : in Boolean;
Footer_Use_ISO_Format : in Boolean;
Footer_Text : in String := "";
Version_Names : in ARM_Contents.Versioned_String;
Title : in String := "") is
-- Create an Output_Object for a document with the specified page
-- size. Changes from the base document are included if
-- Includes_Changes is True (otherwise no revisions are generated).
-- Generate a few large output files if
-- Big_Files is True; otherwise generate smaller output files.
-- The prefix of the output file names is File_Prefix - this
-- should be no more then 4 characters allowed in file names.
-- The files will be written into Output_Path.
-- The title of the document is Title.
-- The header prefix appears in the header (if any) before the title,
-- separated by a dash.
-- The footer consists of the page number, the date if Footer_Use_Date
-- is true, and the clause name if Footer_Use_Clase_Name is True, and
-- the Footer_Text otherwise. The font and size of the footer is as
-- an ISO standard if Footer_Use_ISO_Format is True, and as the
-- Ada Reference Manual otherwise.
-- The primary font used for the Sans_Serif text, and for the Serif
-- text, is as specified.
-- Which font is used for the body is specified by Body_Font.
-- The author names of the various versions is specified by the
-- Version_Names.
begin
if Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Already valid object");
end if;
Output_Object.Is_Valid := True;
Output_Object.Page_Size := Page_Size;
Output_Object.Includes_Changes := Includes_Changes;
Output_Object.Big_Files := Big_Files;
Ada.Strings.Fixed.Move (Target => Output_Object.File_Prefix,
Source => File_Prefix);
Output_Object.Output_Path :=
Ada.Strings.Unbounded.To_Unbounded_String (Output_Path);
Output_Object.Primary_Sans_Serif_Font := Primary_Sans_Serif_Font;
Output_Object.Primary_Serif_Font := Primary_Serif_Font;
Output_Object.Body_Font := Body_Font;
Output_Object.Title := Ada.Strings.Unbounded.To_Unbounded_String (Title);
Output_Object.Header_Prefix :=
Ada.Strings.Unbounded.To_Unbounded_String (Header_Prefix);
Output_Object.Footer_Text :=
Ada.Strings.Unbounded.To_Unbounded_String (Footer_Text);
Output_Object.Footer_Use_Date := Footer_Use_Date;
Output_Object.Footer_Use_Clause_Name := Footer_Use_Clause_Name;
Output_Object.Footer_Use_ISO_Format := Footer_Use_ISO_Format;
Output_Object.Version_Names := Version_Names;
if Big_Files then
-- We're going to generate a single giant file. Open it now.
Start_RTF_File (Output_Object,
Ada.Strings.Fixed.Trim (Output_Object.File_Prefix, Ada.Strings.Right),
Ada.Strings.Unbounded.To_String (Output_Object.Title),
"All");
Ada.Text_IO.New_Line (Output_Object.Output_File);
end if;
end Create;
procedure Close (Output_Object : in out RTF_Output_Type) is
-- Close an Output_Object. No further output to the object is
-- allowed after this call.
begin
if not Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not valid object");
end if;
if Ada.Text_IO.Is_Open (Output_Object.Output_File) then
End_RTF_File (Output_Object);
end if;
Output_Object.Is_Valid := False;
end Close;
procedure Section (Output_Object : in out RTF_Output_Type;
Section_Title : in String;
Section_Name : in String) is
-- Start a new section. The title is Section_Title (this is
-- intended for humans). The name is Section_Name (this is
-- intended to be suitable to be a portion of a file name).
begin
if not Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not valid object");
end if;
if Output_Object.Is_In_Paragraph then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Section in paragraph");
end if;
if not Output_Object.Big_Files then
if Ada.Text_IO.Is_Open (Output_Object.Output_File) then
End_RTF_File (Output_Object);
end if;
-- Create a new file for this section:
Start_RTF_File (Output_Object,
Ada.Strings.Fixed.Trim (Output_Object.File_Prefix, Ada.Strings.Right) &
"-" & Section_Name,
Section_Title,
Section_Name);
Ada.Text_IO.New_Line (Output_Object.Output_File);
else
if Output_Object.Wrote_into_Section then
-- Just a new section header (odd page break) and page number setup:
if Section_Name = "TOC" then
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sect\sbkodd\pgnlcrm\pgnstart1\pgnrestart ");
-- Lower-case roman number page number; reset to 1.
elsif Section_Name = "00" then
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sect\sbkodd\pgnlcrm\pgncont ");
-- Lower-case roman numeral, numbers continue.
elsif Section_Name = "01" then
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sect\sbkodd\pgndec\pgnstart1\pgnrestart ");
-- Decimal page number; starts at 1 here.
else
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sect\sbkodd\pgndec\pgncont ");
-- Decimal page number, numbers continue.
end if;
-- Write the page headers:
Write_Headers (Output_Object);
-- else Probably the title page: no headers or footers.
end if;
Output_Object.Wrote_into_Section := False;
end if;
end Section;
procedure Set_Columns (Output_Object : in out RTF_Output_Type;
Number_of_Columns : in ARM_Output.Column_Count) is
-- Set the number of columns.
-- Raises Not_Valid_Error if in a paragraph.
begin
if not Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not valid object");
end if;
if Output_Object.Is_In_Paragraph then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"In paragraph");
end if;
if Number_of_Columns = Output_Object.Column_Count then
return;
end if;
if Output_Object.Wrote_into_Section then
Ada.Text_IO.Put (Output_Object.Output_File, "\sect\sbknone");
end if;
case Number_of_Columns is
when 1 => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cols1 ");
when 2 => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cols2\colsx0 ");
-- Two columns, no space between. (Paragraph formatting
-- will take care of that.)
when 3 => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cols3\colsx0 ");
when 4 => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cols4\colsx0 ");
when 5 => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cols5\colsx0 ");
when 6 => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cols6\colsx0 ");
when 7 => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cols7\colsx0 ");
when 8 => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cols8\colsx0 ");
end case;
Output_Object.Column_Count := Number_of_Columns;
end Set_Columns;
procedure Set_Tabs (Output_Object : in out RTF_Output_Type;
Style : in ARM_Output.Paragraph_Style_Type;
Indent : in ARM_Output.Paragraph_Indent_Type) is
-- Set tabs in the current (just started) paragraph.
begin
case Style is
when ARM_Output.Normal | ARM_Output.Wide_Above |
ARM_Output.Small | ARM_Output.Small_Wide_Above |
ARM_Output.Header | ARM_Output.Small_Header |
ARM_Output.Index | ARM_Output.Syntax_Summary |
ARM_Output.Title |
ARM_Output.Examples | ARM_Output.Small_Examples |
ARM_Output.Swiss_Examples | ARM_Output.Small_Swiss_Examples =>
if Output_Object.Tab_Stops.Number /= 0 then
if (Output_Object.Tab_Stops.Number * 8) + Output_Object.Char_Count >
LINE_LENGTH then
Ada.Text_IO.New_Line (Output_Object.Output_File);
Output_Object.Char_Count := 0;
end if;
declare
function Stop_in_Twips (Stop : ARM_Output.Tab_Stop_Type) return Natural is
-- Return the value of a tab stop in Twips:
begin
if ARM_Output."="(Stop.Kind, ARM_Output.Left_Fixed) then
return Stop.Stop*120 +
Paragraph_Info(Style, Indent).Indent;
-- *120 is to convert picas to Twips.
else
-- Scale with font size. (Stop assumes 12 pt
-- type).
-- Raw formula:
-- (Stop.Stop * 120) -- Stop in twips.
-- * (Paragraph_Info(Format).Size / 24) -- Font scale.
-- After rearranging, we get:
return
Stop.Stop * Paragraph_Info(Style, Indent).Size * 5 +
Paragraph_Info(Style, Indent).Indent;
end if;
end Stop_in_Twips;
begin
for I in 1 .. Output_Object.Tab_Stops.Number loop
-- Define tab stops.
declare
Num : String := Integer'Image (Stop_in_Twips (
Output_Object.Tab_Stops.Stops(I)));
begin
Ada.Text_IO.Put (Output_Object.Output_File, "\tx");
Ada.Text_IO.Put (Output_Object.Output_File, Num(2..Num'Length));
Ada.Text_IO.Put (Output_Object.Output_File, " ");
Output_Object.Char_Count := Output_Object.Char_Count + 4 + Num'Length-1;
end;
end loop;
end;
-- else no tabs defined.
end if;
when ARM_Output.Bulleted | ARM_Output.Nested_Bulleted |
ARM_Output.Small_Bulleted | ARM_Output.Small_Nested_Bulleted |
ARM_Output.Giant_Hanging | ARM_Output.Wide_Hanging |
ARM_Output.Medium_Hanging | ARM_Output.Narrow_Hanging |
ARM_Output.Hanging_in_Bulleted |
ARM_Output.Small_Giant_Hanging | ARM_Output.Small_Wide_Hanging |
ARM_Output.Small_Medium_Hanging | ARM_Output.Small_Narrow_Hanging |
ARM_Output.Small_Hanging_in_Bulleted |
ARM_Output.Enumerated | ARM_Output.Small_Enumerated =>
if Output_Object.Tab_Stops.Number /= 0 then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Tabs in hanging/bulleted paragraph");
end if;
end case;
end Set_Tabs;
procedure Start_Paragraph (Output_Object : in out RTF_Output_Type;
Style : in ARM_Output.Paragraph_Style_Type;
Indent : in ARM_Output.Paragraph_Indent_Type;
Number : in String;
No_Prefix : in Boolean := False;
Tab_Stops : in ARM_Output.Tab_Info := ARM_Output.NO_TABS;
No_Breaks : in Boolean := False;
Keep_with_Next : in Boolean := False;
Space_After : in ARM_Output.Space_After_Type
:= ARM_Output.Normal;
Justification : in ARM_Output.Justification_Type
:= ARM_Output.Default) is
-- Start a new paragraph. The style and indent of the paragraph is as
-- specified. The (AA)RM paragraph number (which might include update
-- and version numbers as well: [12.1/1]) is Number. If the format is
-- a type with a prefix (bullets, hangining items), the prefix is
-- omitted if No_Prefix is true. Tab_Stops defines the tab stops for
-- the paragraph. If No_Breaks is True, we will try to avoid page breaks
-- in the paragraph. If Keep_with_Next is true, we will try to avoid
-- separating this paragraph and the next one. (These may have no
-- effect in formats that don't have page breaks). Space_After
-- specifies the amount of space following the paragraph. Justification
-- specifies the text justification for the paragraph. Not_Valid_Error
-- is raised if Tab_Stops /= NO_TABS for a hanging or bulleted format.
begin
if not Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not valid object");
end if;
if Output_Object.Is_In_Paragraph then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Already in paragraph");
end if;
if not Paragraph_Info(Style, Indent).Defined then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Undefined Style " & ARM_Output.Paragraph_Style_Type'Image(Style) &
" and Indent:" & ARM_Output.Paragraph_Indent_Type'Image(Indent));
end if;
Output_Object.Is_In_Paragraph := True;
Output_Object.Had_Prefix := not No_Prefix;
Output_Object.Char_Count := 0;
Output_Object.Saw_Hang_End := False;
Output_Object.Wrote_into_Section := True;
-- First, write the paragraph number, if any. This has its own style.
if Number /= "" then -- We have a paragraph number.
-- Most paragraph numbers are 7 or fewer characters. The box is
-- sized for 7 characters. If we have 8 characters (as in 277.10/2),
-- we need a wider box.
if Number'Length > 7 then
Write_Style_for_Paragraph (Output_Object.Output_File,
Wide_Paragraph_Number_Info, Output_Object.Char_Count);
else
Write_Style_for_Paragraph (Output_Object.Output_File,
Normal_Paragraph_Number_Info, Output_Object.Char_Count);
end if;
-- Figure the space above: (We use a variable space above so the
-- numbers align with the bottom of the text, not the top).
declare
Diff : Natural := (Paragraph_Info(Style, Indent).Size -
Normal_Paragraph_Number_Info.Size) +
(Paragraph_Info(Style, Indent).Before/10);
-- This would seem to be double the required adjustment for the
-- size, but it works. So why question it?
begin
if Diff >= 30 then
Ada.Text_IO.Put (Output_Object.Output_File, "\sb3" &
Character'Val(Diff mod 10 + Character'Pos('0')) & "0 ");
elsif Diff >= 20 then
Ada.Text_IO.Put (Output_Object.Output_File, "\sb2" &
Character'Val(Diff mod 10 + Character'Pos('0')) & "0 ");
elsif Diff >= 10 then
Ada.Text_IO.Put (Output_Object.Output_File, "\sb1" &
Character'Val(Diff mod 10 + Character'Pos('0')) & "0 ");
else
Ada.Text_IO.Put (Output_Object.Output_File, "\sb" &
Character'Val(Diff + Character'Pos('0')) & "0 ");
end if;
end;
--*** Box width??
Ada.Text_IO.Put (Output_Object.Output_File, Number);
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par}");
Output_Object.Char_Count := 0;
-- else no paragraph number.
end if;
-- Now, write the paragraph header:
case Style is
when ARM_Output.Normal | ARM_Output.Wide_Above |
ARM_Output.Small | ARM_Output.Small_Wide_Above |
ARM_Output.Header | ARM_Output.Small_Header |
ARM_Output.Index | ARM_Output.Syntax_Summary |
ARM_Output.Title |
ARM_Output.Examples | ARM_Output.Small_Examples |
ARM_Output.Swiss_Examples | ARM_Output.Small_Swiss_Examples =>
Write_Style_for_Paragraph (Output_Object.Output_File,
Paragraph_Info(Style, Indent),
Output_Object.Char_Count);
--Ada.Text_IO.Put_Line ("Start paragraph - full style");
when ARM_Output.Bulleted | ARM_Output.Nested_Bulleted |
ARM_Output.Small_Bulleted | ARM_Output.Small_Nested_Bulleted =>
Write_Style_for_Paragraph (Output_Object.Output_File,
Paragraph_Info(Style, Indent),
Output_Object.Char_Count);
--Ada.Text_IO.Put_Line ("Start paragraph - full style (bullet)");
if No_Prefix then
Ada.Text_IO.Put (Output_Object.Output_File, "\tab ");
Output_Object.Char_Count := Output_Object.Char_Count + 5;
else
if ARM_Output."=" (Style, ARM_Output.Nested_Bulleted) or else
ARM_Output."=" (Style, ARM_Output.Small_Nested_Bulleted) then
-- Make a smaller bullet.
if Paragraph_Info(Style, Indent).Size = 15 then
Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\fs12\'b7}\tab ");
elsif Paragraph_Info(Style, Indent).Size = 16 then
Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\fs12\'b7}\tab ");
elsif Paragraph_Info(Style, Indent).Size = 18 then
Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\fs14\'b7}\tab ");
elsif Paragraph_Info(Style, Indent).Size = 20 then
Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\fs16\'b7}\tab ");
else --if Paragraph_Info(Style, Indent).Size = 22 then
Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\fs18\'b7}\tab ");
end if;
Output_Object.Char_Count := Output_Object.Char_Count + 19;
else -- Normal bullet.
Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\'b7}\tab ");
Output_Object.Char_Count := Output_Object.Char_Count + 14;
end if;
end if;
when ARM_Output.Giant_Hanging | ARM_Output.Wide_Hanging |
ARM_Output.Medium_Hanging | ARM_Output.Narrow_Hanging |
ARM_Output.Hanging_in_Bulleted |
ARM_Output.Small_Giant_Hanging | ARM_Output.Small_Wide_Hanging |
ARM_Output.Small_Medium_Hanging | ARM_Output.Small_Narrow_Hanging |
ARM_Output.Small_Hanging_in_Bulleted |
ARM_Output.Enumerated | ARM_Output.Small_Enumerated =>
Write_Style_for_Paragraph (Output_Object.Output_File,
Paragraph_Info(Style, Indent),
Output_Object.Char_Count);
--Ada.Text_IO.Put_Line ("Start paragraph - full style (hang)");
if No_Prefix then
Ada.Text_IO.Put (Output_Object.Output_File, "\tab ");
Output_Object.Char_Count := Output_Object.Char_Count + 5;
Output_Object.Saw_Hang_End := True;
else -- Has prefix.
Output_Object.Saw_Hang_End := False;
Output_Object.Prefix_Large_Char_Count := 0;
end if;
end case;
Output_Object.Paragraph_Style := Style;
Output_Object.Paragraph_Indent := Indent;
Output_Object.Font := ARM_Output.Default;
Output_Object.Is_Bold := False;
Output_Object.Is_Italic := False;
Output_Object.Size := 0;
Output_Object.Color := ARM_Output.Default;
Output_Object.Real_Size := Paragraph_Info(Style,Indent).Size;
Output_Object.Tab_Stops := Tab_Stops;
Output_Object.Current_Space_After := Space_After;
Set_Tabs (Output_Object, Style, Indent);
if No_Breaks or Keep_with_Next then
if Output_Object.Char_Count + 13 >
LINE_LENGTH then
Ada.Text_IO.New_Line (Output_Object.Output_File);
Output_Object.Char_Count := 0;
end if;
if No_Breaks then
Ada.Text_IO.Put (Output_Object.Output_File, "\keep ");
Output_Object.Char_Count := Output_Object.Char_Count + 6;
end if;
if Keep_with_Next then
Ada.Text_IO.Put (Output_Object.Output_File, "\keepn ");
Output_Object.Char_Count := Output_Object.Char_Count + 7;
end if;
end if;
if ARM_Output."=" (Space_After, ARM_Output.Narrow) then
-- Reduce the following space by 30%:
declare
SA : constant String := Natural'Image((Paragraph_Info(Style, Indent).After*(LEADING_PERCENT/10))/10);
begin
if Output_Object.Char_Count + 4 + SA'Length - 1 >
LINE_LENGTH then
Ada.Text_IO.New_Line (Output_Object.Output_File);
Output_Object.Char_Count := 0;
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "\sa");
Ada.Text_IO.Put (Output_Object.Output_File, SA(2..SA'Last));
Ada.Text_IO.Put (Output_Object.Output_File, " ");
Output_Object.Char_Count := 4 + SA'Length - 1;
end;
elsif ARM_Output."=" (Space_After, ARM_Output.Wide) then
-- Increase the following space by 50%:
declare
SA : constant String := Natural'Image((Paragraph_Info(Style, Indent).After*(TRAILING_PERCENT/10))/10);
begin
if Output_Object.Char_Count + 4 + SA'Length - 1 >
LINE_LENGTH then
Ada.Text_IO.New_Line (Output_Object.Output_File);
Output_Object.Char_Count := 0;
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "\sa");
Ada.Text_IO.Put (Output_Object.Output_File, SA(2..SA'Last));
Ada.Text_IO.Put (Output_Object.Output_File, " ");
Output_Object.Char_Count := 4 + SA'Length - 1;
end;
end if;
if ARM_Output."/=" (Justification, ARM_Output.Default) then
if Output_Object.Char_Count + 4 >
LINE_LENGTH then
Ada.Text_IO.New_Line (Output_Object.Output_File);
Output_Object.Char_Count := 0;
end if;
case Justification is
when ARM_Output.Default => null; -- Can't get here.
when ARM_Output.Left =>
Ada.Text_IO.Put (Output_Object.Output_File, "\ql ");
Output_Object.Char_Count := Output_Object.Char_Count + 4;
when ARM_Output.Center =>
Ada.Text_IO.Put (Output_Object.Output_File, "\qc ");
Output_Object.Char_Count := Output_Object.Char_Count + 4;
when ARM_Output.Right =>
Ada.Text_IO.Put (Output_Object.Output_File, "\qr ");
Output_Object.Char_Count := Output_Object.Char_Count + 4;
when ARM_Output.Justified =>
Ada.Text_IO.Put (Output_Object.Output_File, "\qj ");
Output_Object.Char_Count := Output_Object.Char_Count + 4;
end case;
end if;
-- Start hang (last), so we get a clean count of prefix characters:
case Style is
when ARM_Output.Giant_Hanging | ARM_Output.Wide_Hanging |
ARM_Output.Medium_Hanging | ARM_Output.Narrow_Hanging |
ARM_Output.Small_Giant_Hanging | ARM_Output.Small_Wide_Hanging |
ARM_Output.Small_Medium_Hanging | ARM_Output.Small_Narrow_Hanging |
ARM_Output.Hanging_in_Bulleted | ARM_Output.Small_Hanging_in_Bulleted |
ARM_Output.Enumerated | ARM_Output.Small_Enumerated =>
if not No_Prefix then
Ada.Text_IO.New_Line (Output_Object.Output_File);
Output_Object.Char_Count := 0;
--Ada.Text_Io.Put ("Start Hang:");
-- else no prefix, no need to count.
end if;
when others => null;
end case;
end Start_Paragraph;
procedure End_Paragraph (Output_Object : in out RTF_Output_Type) is
-- End a paragraph.
begin
if not Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not valid object");
end if;
if not Output_Object.Is_In_Paragraph then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not in paragraph");
end if;
Output_Object.Is_In_Paragraph := False;
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par}");
Output_Object.Char_Count := 0;
--Ada.Text_IO.Put_Line ("End paragraph '}'");
end End_Paragraph;
procedure Category_Header (Output_Object : in out RTF_Output_Type;
Header_Text : String) is
-- Output a Category header (that is, "Legality Rules",
-- "Dynamic Semantics", etc.)
-- (Note: We did not use a enumeration here to insure that these
-- headers are spelled the same in all output versions).
-- Raises Not_Valid_Error if in a paragraph.
Count : Natural; -- Not used after being set.
begin
if not Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not valid object");
end if;
if Output_Object.Is_In_Paragraph then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Header in paragraph");
end if;
Ada.Text_IO.New_Line (Output_Object.Output_File);
Write_Style_for_Paragraph (Output_Object.Output_File,
Category_Header_Info, Count);
Ada.Text_IO.Put_Line (Output_Object.Output_File,
Header_Text & "\par}");
Output_Object.Char_Count := 0;
Output_Object.Wrote_into_Section := True;
end Category_Header;
function Current_Date return String is
-- Local routine:
Date : Ada.Calendar.Time := Ada.Calendar.Clock;
Day : constant String := Ada.Calendar.Day_Number'Image(Ada.Calendar.Day(Date));
Year : constant String := Ada.Calendar.Year_Number'Image(Ada.Calendar.Year(Date));
Month : constant Ada.Calendar.Month_Number := Ada.Calendar.Month(Date);
begin
case Month is
when 1 => return Day(2..Day'Last) & " January" & Year;
when 2 => return Day(2..Day'Last) & " February" & Year;
when 3 => return Day(2..Day'Last) & " March" & Year;
when 4 => return Day(2..Day'Last) & " April" & Year;
when 5 => return Day(2..Day'Last) & " May" & Year;
when 6 => return Day(2..Day'Last) & " June" & Year;
when 7 => return Day(2..Day'Last) & " July" & Year;
when 8 => return Day(2..Day'Last) & " August" & Year;
when 9 => return Day(2..Day'Last) & " September" & Year;
when 10 => return Day(2..Day'Last) & " October" & Year;
when 11 => return Day(2..Day'Last) & " November" & Year;
when 12 => return Day(2..Day'Last) & " December" & Year;
end case;
end Current_Date;
procedure Clause_Footer (Output_Object : in out RTF_Output_Type;
Header_Text : in String;
Level : in ARM_Contents.Level_Type;
Clause_Number : in String;
No_Page_Break : in Boolean := False) is
-- Local routine: Set up the footer for the header.
Count : Natural; -- Not used after being set.
begin
-- Adjust footer.
if Output_Object.Wrote_into_Section then
-- Start a new section:
if No_Page_Break or else
ARM_Contents."="(Level, ARM_Contents.Clause) or else
ARM_Contents."="(Level, ARM_Contents.Subclause) or else
ARM_Contents."="(Level, ARM_Contents.Subsubclause) then
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sect\sbknone\pgncont ");
else
-- Start sections on a new page. (Should only happen in the
-- introduction).
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sect\sbkpage\pgncont ");
end if;
-- else just use the existing section.
end if;
if Clause_Number = "" or else
ARM_Contents."="(Level, ARM_Contents.Unnumbered_Section) then
Ada.Text_IO.Put (Output_Object.Output_File, "{\footerl ");
Write_Style_for_Paragraph (Output_Object.Output_File, Footer_Info, Count);
if Output_Object.Footer_Use_ISO_Format then
Ada.Text_IO.Put (Output_Object.Output_File, "{\f1\fs16 ");
elsif ARM_Output."="(Output_Object.Body_Font, ARM_Output.Swiss) then
Ada.Text_IO.Put (Output_Object.Output_File, "{\f1 ");
else
Ada.Text_IO.Put (Output_Object.Output_File, "{\f0 ");
end if;
if Output_Object.Footer_Use_Clause_Name then
Ada.Text_IO.Put (Output_Object.Output_File, Header_Text);
else
Ada.Text_IO.Put (Output_Object.Output_File,
Ada.Strings.Unbounded.To_String (Output_Object.Footer_Text));
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "\tab ");
if Output_Object.Footer_Use_Date then
Ada.Text_IO.Put (Output_Object.Output_File, Current_Date);
-- else no date.
end if;
if Output_Object.Footer_Use_ISO_Format then
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\~\~\~\~\~\~{\f1\fs22\b {\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}}\par}}}");
else
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\~\~\~\~\~\~{\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}\par}}}");
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "{\footerr ");
Write_Style_for_Paragraph (Output_Object.Output_File, Footer_Info, Count);
if Output_Object.Footer_Use_ISO_Format then
Ada.Text_IO.Put (Output_Object.Output_File, "{\f1\fs22\b {\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}}\~\~\~\~\~\~");
elsif ARM_Output."="(Output_Object.Body_Font, ARM_Output.Swiss) then
Ada.Text_IO.Put (Output_Object.Output_File, "{\f1 {\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}}\~\~\~\~\~\~");
else
Ada.Text_IO.Put (Output_Object.Output_File, "{\f0 {\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}}\~\~\~\~\~\~");
end if;
if Output_Object.Footer_Use_Date then
Ada.Text_IO.Put (Output_Object.Output_File, Current_Date);
-- else no date.
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "\tab ");
if Output_Object.Footer_Use_ISO_Format then
Ada.Text_IO.Put (Output_Object.Output_File, "{\f1\fs16 ");
end if;
if Output_Object.Footer_Use_Clause_Name then
Ada.Text_IO.Put (Output_Object.Output_File, Header_Text);
else
Ada.Text_IO.Put (Output_Object.Output_File,
Ada.Strings.Unbounded.To_String (Output_Object.Footer_Text));
end if;
if Output_Object.Footer_Use_ISO_Format then
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par}}}");
else
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par}}");
end if;
else
Ada.Text_IO.Put (Output_Object.Output_File, "{\footerl ");
Write_Style_for_Paragraph (Output_Object.Output_File, Footer_Info, Count);
if Output_Object.Footer_Use_Clause_Name then
Ada.Text_IO.Put (Output_Object.Output_File, "{\b\f1 ");
if Level in ARM_Contents.Plain_Annex .. ARM_Contents.Normative_Annex then
-- Clause Number includes "Annex". Just use the letter.
Ada.Text_IO.Put (Output_Object.Output_File, Clause_Number(Clause_Number'Last));
else
Ada.Text_IO.Put (Output_Object.Output_File, Clause_Number);
end if;
if Output_Object.Footer_Use_ISO_Format then
Ada.Text_IO.Put (Output_Object.Output_File, "}\~\~\~{\f1\fs16 ");
elsif ARM_Output."="(Output_Object.Body_Font, ARM_Output.Swiss) then
Ada.Text_IO.Put (Output_Object.Output_File, "}\~\~\~{\f1 ");
else
Ada.Text_IO.Put (Output_Object.Output_File, "}\~\~\~{\f0 ");
end if;
Ada.Text_IO.Put (Output_Object.Output_File, Header_Text);
else
if Output_Object.Footer_Use_ISO_Format then
Ada.Text_IO.Put (Output_Object.Output_File, "{\f1\fs16 ");
elsif ARM_Output."="(Output_Object.Body_Font, ARM_Output.Swiss) then
Ada.Text_IO.Put (Output_Object.Output_File, "{\f1 ");
else
Ada.Text_IO.Put (Output_Object.Output_File, "{\f0 ");
end if;
Ada.Text_IO.Put (Output_Object.Output_File,
Ada.Strings.Unbounded.To_String (Output_Object.Footer_Text));
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "\tab ");
if Output_Object.Footer_Use_Date then
Ada.Text_IO.Put (Output_Object.Output_File, Current_Date);
-- else no date.
end if;
if Output_Object.Footer_Use_ISO_Format then
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\~\~\~\~\~\~{\f1\fs22\b {\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}}\par}}}");
else
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\~\~\~\~\~\~{\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}\par}}}");
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "{\footerr ");
Write_Style_for_Paragraph (Output_Object.Output_File, Footer_Info, Count);
if Output_Object.Footer_Use_ISO_Format then
Ada.Text_IO.Put (Output_Object.Output_File, "{\f1\fs22\b {\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}}\~\~\~\~\~\~");
elsif ARM_Output."="(Output_Object.Body_Font, ARM_Output.Swiss) then
Ada.Text_IO.Put (Output_Object.Output_File, "{\f1 {\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}}\~\~\~\~\~\~");
else
Ada.Text_IO.Put (Output_Object.Output_File, "{\f0 {\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}}\~\~\~\~\~\~");
end if;
if Output_Object.Footer_Use_Date then
Ada.Text_IO.Put (Output_Object.Output_File, Current_Date);
-- else no date.
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "\tab ");
if Output_Object.Footer_Use_ISO_Format then
Ada.Text_IO.Put (Output_Object.Output_File, "{\f1\fs16 ");
elsif ARM_Output."="(Output_Object.Body_Font, ARM_Output.Swiss) then
Ada.Text_IO.Put (Output_Object.Output_File, "{\f1 ");
else
Ada.Text_IO.Put (Output_Object.Output_File, "{\f0 ");
end if;
if Output_Object.Footer_Use_Clause_Name then
Ada.Text_IO.Put (Output_Object.Output_File, Header_Text);
Ada.Text_IO.Put (Output_Object.Output_File, "}\~\~\~\b\f1 ");
if Level in ARM_Contents.Plain_Annex .. ARM_Contents.Normative_Annex then
-- Clause Number includes "Annex". Just use the letter.
Ada.Text_IO.Put (Output_Object.Output_File, Clause_Number(Clause_Number'Last));
else
Ada.Text_IO.Put (Output_Object.Output_File, Clause_Number);
end if;
else
Ada.Text_IO.Put (Output_Object.Output_File,
Ada.Strings.Unbounded.To_String (Output_Object.Footer_Text));
Ada.Text_IO.Put (Output_Object.Output_File, "}");
end if;
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par}}");
end if;
Output_Object.Wrote_into_Section := True;
end Clause_Footer;
procedure Clause_Header (Output_Object : in out RTF_Output_Type;
Header_Text : in String;
Level : in ARM_Contents.Level_Type;
Clause_Number : in String;
Top_Level_Subdivision_Name : in ARM_Output.Top_Level_Subdivision_Name_Kind;
No_Page_Break : in Boolean := False) is
-- Output a Clause header. The level of the header is specified
-- in Level. The Clause Number is as specified; the top-level (and
-- other) subdivision names are as specified. These should appear in
-- the table of contents.
-- For hyperlinked formats, this should generate a link target.
-- If No_Page_Break is True, suppress any page breaks.
-- Raises Not_Valid_Error if in a paragraph.
Count : Natural; -- Not used after being set.
begin
if not Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not valid object");
end if;
if Output_Object.Is_In_Paragraph then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Header in paragraph");
end if;
Ada.Text_IO.New_Line (Output_Object.Output_File);
-- Adjust footer.
Clause_Footer (Output_Object, Header_Text, Level, Clause_Number, No_Page_Break);
-- Special for table of contents:
if Clause_Number = "" and then
(Header_Text = "Table of Contents" or else -- Ada 95 format
Header_Text = "Contents") then -- ISO 2004 format.
if Header_Text = "Table of Contents" then
Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\pard\plain \s1\sb240\sa60\keepn\widctlpar\outlinelevel0\adjustright \b\f1\fs36\kerning36\qc\cgrid Table of Contents\par}");
else
Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\pard\plain \s1\sb240\sa60\keepn\widctlpar\outlinelevel0\adjustright \b\f1\fs36\kerning36\qc\cgrid Contents\par}");
end if;
Output_Object.Char_Count := 0;
return;
end if;
case Level is
when ARM_Contents.Plain_Annex =>
Write_Style_for_Paragraph (Output_Object.Output_File,
Heading_1_Info, Count);
Ada.Text_IO.Put_Line (Output_Object.Output_File,
Clause_Number & ": " & Header_Text & "\par}");
-- Note: Clause_Number includes "Annex"
when ARM_Contents.Normative_Annex =>
Write_Style_for_Paragraph (Output_Object.Output_File,
Heading_1_Info, Count);
Ada.Text_IO.Put_Line (Output_Object.Output_File, Clause_Number & "\line ");
-- Note: Clause_Number includes "Annex"
Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\b0 (normative)}\line ");
Ada.Text_IO.Put_Line (Output_Object.Output_File, Header_Text & "\par}");
when ARM_Contents.Informative_Annex =>
Write_Style_for_Paragraph (Output_Object.Output_File,
Heading_1_Info, Count);
Ada.Text_IO.Put_Line (Output_Object.Output_File, Clause_Number & "\line ");
-- Note: Clause_Number includes "Annex"
Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\b0 (informative)}\line ");
Ada.Text_IO.Put_Line (Output_Object.Output_File, Header_Text & "\par}");
when ARM_Contents.Unnumbered_Section =>
if Header_Text /= "" then
Write_Style_for_Paragraph (Output_Object.Output_File,
Heading_1_Info, Count);
Ada.Text_IO.Put_Line (Output_Object.Output_File, Header_Text & "\par}");
end if;
when ARM_Contents.Section =>
case Top_Level_Subdivision_Name is
when ARM_Output.Chapter =>
Write_Style_for_Paragraph (Output_Object.Output_File,
Heading_1_Info, Count);
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Chapter " &
Clause_Number & ": " & Header_Text & "\par}");
when ARM_Output.Section =>
Write_Style_for_Paragraph (Output_Object.Output_File,
Heading_1_Info, Count);
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Section " &
Clause_Number & ": " & Header_Text & "\par}");
when ARM_Output.Clause =>
Write_Style_for_Paragraph (Output_Object.Output_File,
Heading_1_Info, Count);
Ada.Text_IO.Put_Line (Output_Object.Output_File,
Clause_Number & "\~\~\~" & Header_Text & "\par}");
end case;
when ARM_Contents.Clause =>
Write_Style_for_Paragraph (Output_Object.Output_File,
Heading_2_Info, Count);
Ada.Text_IO.Put_Line (Output_Object.Output_File,
Clause_Number & " " & Header_Text & "\par}");
when ARM_Contents.Subclause =>
Write_Style_for_Paragraph (Output_Object.Output_File,
Heading_3_Info, Count);
Ada.Text_IO.Put_Line (Output_Object.Output_File,
Clause_Number & " " & Header_Text & "\par}");
when ARM_Contents.Subsubclause =>
Write_Style_for_Paragraph (Output_Object.Output_File,
Heading_4_Info, Count);
Ada.Text_IO.Put_Line (Output_Object.Output_File,
Clause_Number & " " & Header_Text & "\par}");
when ARM_Contents.Dead_Clause =>
raise Program_Error; -- No headers for dead clauses.
end case;
Output_Object.Char_Count := 0;
end Clause_Header;
procedure Revised_Clause_Header
(Output_Object : in out RTF_Output_Type;
New_Header_Text : in String;
Old_Header_Text : in String;
Level : in ARM_Contents.Level_Type;
Clause_Number : in String;
Version : in ARM_Contents.Change_Version_Type;
Old_Version : in ARM_Contents.Change_Version_Type;
Top_Level_Subdivision_Name : in ARM_Output.Top_Level_Subdivision_Name_Kind;
No_Page_Break : in Boolean := False) is
-- Output a revised clause header. Both the original and new text will
-- be output. The level of the header is specified in Level. The Clause
-- Number is as specified; the top-level (and other) subdivision names
-- are as specified. These should appear in the table of contents.
-- For hyperlinked formats, this should generate a link target.
-- Version is the insertion version of the new text; Old_Version is
-- the insertion version of the old text.
-- If No_Page_Break is True, suppress any page breaks.
-- Raises Not_Valid_Error if in a paragraph.
Count : Natural; -- Not used after being set.
function Header_Text return String is
begin
if Old_Version = '0' then -- Old is original text
return "{\revised\revauth" & Version & " " & New_Header_Text & "}{\deleted\revauthdel" & Version & " " & Old_Header_Text & "}";
else
return "{\revised\revauth" & Version & " " & New_Header_Text &
"}{\deleted\revauthdel" & Version &
"\revised\revauth" & Old_Version & " " &
Old_Header_Text & "}";
end if;
end Header_Text;
begin
if not Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not valid object");
end if;
if Output_Object.Is_In_Paragraph then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Header in paragraph");
end if;
Ada.Text_IO.New_Line (Output_Object.Output_File);
-- Adjust footer.
Clause_Footer (Output_Object, New_Header_Text, Level,
Clause_Number, No_Page_Break);
case Level is
when ARM_Contents.Plain_Annex =>
Write_Style_for_Paragraph (Output_Object.Output_File,
Heading_1_Info, Count);
Ada.Text_IO.Put_Line (Output_Object.Output_File,
Clause_Number & ": " & Header_Text & "\par}");
-- Note: Clause_Number includes "Annex"
when ARM_Contents.Normative_Annex =>
Write_Style_for_Paragraph (Output_Object.Output_File,
Heading_1_Info, Count);
Ada.Text_IO.Put_Line (Output_Object.Output_File, Clause_Number & "\line ");
-- Note: Clause_Number includes "Annex"
Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\b0 (normative)}\line ");
Ada.Text_IO.Put_Line (Output_Object.Output_File, Header_Text & "\par}");
when ARM_Contents.Informative_Annex =>
Write_Style_for_Paragraph (Output_Object.Output_File,
Heading_1_Info, Count);
Ada.Text_IO.Put_Line (Output_Object.Output_File, Clause_Number & "\line ");
-- Note: Clause_Number includes "Annex"
Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\b0 (informative)}\line ");
Ada.Text_IO.Put_Line (Output_Object.Output_File, Header_Text & "\par}");
when ARM_Contents.Unnumbered_Section =>
if Header_Text /= "" then
Write_Style_for_Paragraph (Output_Object.Output_File,
Heading_1_Info, Count);
Ada.Text_IO.Put_Line (Output_Object.Output_File, Header_Text & "\par}");
end if;
when ARM_Contents.Section =>
case Top_Level_Subdivision_Name is
when ARM_Output.Chapter =>
Write_Style_for_Paragraph (Output_Object.Output_File,
Heading_1_Info, Count);
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Chapter " &
Clause_Number & ": " & Header_Text & "\par}");
when ARM_Output.Section =>
Write_Style_for_Paragraph (Output_Object.Output_File,
Heading_1_Info, Count);
Ada.Text_IO.Put_Line (Output_Object.Output_File, "Section " &
Clause_Number & ": " & Header_Text & "\par}");
when ARM_Output.Clause =>
Write_Style_for_Paragraph (Output_Object.Output_File,
Heading_1_Info, Count);
Ada.Text_IO.Put_Line (Output_Object.Output_File,
Clause_Number & "\~\~\~" & Header_Text & "\par}");
end case;
when ARM_Contents.Clause =>
Write_Style_for_Paragraph (Output_Object.Output_File,
Heading_2_Info, Count);
Ada.Text_IO.Put_Line (Output_Object.Output_File,
Clause_Number & " " & Header_Text & "\par}");
when ARM_Contents.Subclause =>
Write_Style_for_Paragraph (Output_Object.Output_File,
Heading_3_Info, Count);
Ada.Text_IO.Put_Line (Output_Object.Output_File,
Clause_Number & " " & Header_Text & "\par}");
when ARM_Contents.Subsubclause =>
Write_Style_for_Paragraph (Output_Object.Output_File,
Heading_4_Info, Count);
Ada.Text_IO.Put_Line (Output_Object.Output_File,
Clause_Number & " " & Header_Text & "\par}");
when ARM_Contents.Dead_Clause =>
raise Program_Error; -- No headers for dead clauses.
end case;
Output_Object.Char_Count := 0;
end Revised_Clause_Header;
procedure TOC_Marker (Output_Object : in out RTF_Output_Type;
For_Start : in Boolean) is
-- Mark the start (if For_Start is True) or end (if For_Start is
-- False) of the table of contents data. Output objects that
-- auto-generate the table of contents can use this to do needed
-- actions.
begin
if not Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not valid object");
end if;
if Output_Object.Is_In_Paragraph then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"TOC in paragraph");
end if;
if Output_Object.Big_Files then
if For_Start then
-- Create a Table of contents field:
Write_Style_for_Paragraph (Output_Object.Output_File,
Paragraph_Info(ARM_Output.Normal, 0),
Output_Object.Char_Count);
Ada.Text_IO.Put_Line (Output_Object.Output_File,
"{\field\fldedit{\*\fldinst TOC \\o ""1-3"" }{\fldrslt ");
Output_Object.Char_Count := 0;
else -- End.
-- Close the field:
Ada.Text_IO.Put_Line (Output_Object.Output_File, "}}\par}");
end if;
else -- Small files:
null; -- We're not generating a table of contents.
end if;
end TOC_Marker;
procedure New_Page (Output_Object : in out RTF_Output_Type;
Kind : ARM_Output.Page_Kind_Type := ARM_Output.Any_Page) is
-- Output a page break.
-- Note that this has no effect on non-printing formats.
-- Any_Page breaks to the top of the next page (whatever it is);
-- Odd_Page_Only breaks to the top of the odd-numbered page;
-- Soft_Page allows a page break but does not force one (use in
-- "No_Breaks" paragraphs.)
-- Raises Not_Valid_Error if in a paragraph if Kind = Any_Page or
-- Odd_Page, and if not in a paragraph if Kind = Soft_Page.
begin
if not Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not valid object");
end if;
case Kind is
when ARM_Output.Any_Page =>
if Output_Object.Is_In_Paragraph then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Page in paragraph");
end if;
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sect\sbkpage\pgncont ");
-- A section break and start on a new page, with page numbers continuing.
-- All other section properties are inherited.
-- We use a section break here, and not
-- "\page", because that gives the wrong footers if the next
-- item is a clause header (as it usually is).
Output_Object.Wrote_into_Section := False;
when ARM_Output.Odd_Page_Only =>
if Output_Object.Is_In_Paragraph then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Page in paragraph");
end if;
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sect\sbkodd\pgncont ");
-- A section break and start on an odd page, with page numbers continuing.
-- All other section properties are inherited.
Output_Object.Wrote_into_Section := False;
when ARM_Output.Soft_Page =>
if not Output_Object.Is_In_Paragraph then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Soft page not in paragraph");
end if;
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\softpage ");
end case;
end New_Page;
procedure New_Column (Output_Object : in out RTF_Output_Type) is
-- Output a column break.
-- Raises Not_Valid_Error if in a paragraph, or if the number of
-- columns is 1.
begin
if not Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not valid object");
end if;
if Output_Object.Is_In_Paragraph then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"New Column in paragraph");
end if;
if Output_Object.Column_Count <= 1 then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Column break, but no columns");
end if;
-- Set the font size to the most recently used one, because
-- otherwise this takes a 12 pt. space, much too large in some cases:
declare
FS : constant String := Natural'Image(
Paragraph_Info(Output_Object.Paragraph_Style,
Output_Object.Paragraph_Indent).Size);
begin
Ada.Text_IO.Put (Output_Object.Output_File, "\fs");
Ada.Text_IO.Put (Output_Object.Output_File, FS(2..FS'Last));
end;
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\column ");
end New_Column;
procedure Separator_Line (Output_Object : in out RTF_Output_Type;
Is_Thin : Boolean := True) is
-- Output a separator line. It is thin if "Is_Thin" is true.
-- Raises Not_Valid_Error if in a paragraph.
begin
if not Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not valid object");
end if;
if Output_Object.Is_In_Paragraph then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Separator in paragraph");
end if;
Ada.Text_IO.New_Line (Output_Object.Output_File);
if Is_Thin then
Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\pard \widctlpar\brdrb\brdrs\brdrw15\brsp20 \adjustright \fs4\par }");
-- \brdrb - Bottom border; \brdrs - Single thickness;
-- \brdrw15 - thickness of 15 twips (max 75);
-- \brsp20 - spacing between border and text.
else
Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\pard \widctlpar\brdrb\brdrs\brdrw30\brsp20 \adjustright \fs4\par }");
end if;
Ada.Text_IO.New_Line (Output_Object.Output_File);
end Separator_Line;
function Format_Value (Value : in Integer) return String is
Str : constant String := Natural'Image(Value);
begin
if Value < 0 then
return Str;
else
return Str(2..Str'Last);
end if;
end Format_Value;
type Table_Info_Kind is (Caption, Header, Header_no_Caption, First_Row, Row, Last_Row);
procedure RTF_Table_Info (Output_Object : in out RTF_Output_Type;
Kind : in Table_Info_Kind) is
-- Output the current table definition (Word needs this on every row):
use type ARM_Output.Column_Text_Alignment;
begin
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\trowd \trgaph108 ");
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\trrh" &
Format_Value(Paragraph_Info(ARM_Output.Normal,0).Size * 16) &
"\trleft" & Format_Value(Output_Object.Table_Indent) & " ");
if Output_Object.Table_Has_Border then
-- Set all of the borders to the normal:
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\trbrdrt\brdrs\brdrw10 " &
"\trbrdrl\brdrs\brdrw10 " & "\trbrdrb\brdrs\brdrw10 " &
"\trbrdrr\brdrs\brdrw10 " & "\trbrdrh\brdrs\brdrw10 " &
"\trbrdrv\brdrs\brdrw10 ");
-- else nothing.
end if;
if Output_Object.Table_No_Page_Break then
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\trkeep\trkeepfollow ");
elsif Kind = Header_no_Caption then
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\trhdr\trkeep ");
else
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\trkeep ");
end if;
case Kind is
when Caption =>
-- Now, define the cell borders:
if Output_Object.Table_Has_Border then
Ada.Text_IO.Put_Line (Output_Object.Output_File,
"\clvertalc \clbrdrt\brdrs\brdrw10 " &
"\clbrdrl\brdrs\brdrw10 " &
"\clbrdrb\brdrs\brdrw10 " &
"\clbrdrr\brdrs\brdrw10 ");
else
Ada.Text_IO.Put_Line (Output_Object.Output_File,
"\clvertalc ");
end if;
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cltxlrtb\cellx" &
Format_Value(Output_Object.Table_Indent + Output_Object.Table_Width) & " ");
-- Caption cell crosses entire line.
-- Now, set up text (normal, centered):
if Output_Object.Table_Has_Small_Text then
Write_Style_for_Paragraph (Output_Object.Output_File,
Table_C_Sml_Text_Info,
Output_Object.Char_Count);
Output_Object.Real_Size := Table_C_Sml_Text_Info.Size;
Output_Object.Size := 0;
else
Write_Style_for_Paragraph (Output_Object.Output_File,
Table_C_Text_Info,
Output_Object.Char_Count);
Output_Object.Real_Size := Table_C_Text_Info.Size;
Output_Object.Size := 0;
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "\intbl ");
Output_Object.Char_Count := Output_Object.Char_Count + 6;
when Header | Header_No_Caption =>
-- Now, define the cell borders for each cell:
for I in 1 .. Output_Object.Column_Count loop
if Output_Object.Table_Has_Border then
Ada.Text_IO.Put_Line (Output_Object.Output_File,
"\clvertalc \clbrdrt\brdrs\brdrw10 " &
"\clbrdrl\brdrs\brdrw10 " &
"\clbrdrb\brdrs\brdrw10 " &
"\clbrdrr\brdrs\brdrw10 ");
else
Ada.Text_IO.Put_Line (Output_Object.Output_File,
"\clvertalc ");
end if;
--Ada.Text_IO.Put_Line("Header:");
--Ada.Text_IO.Put_Line("Indent:" & Natural'Image(Output_Object.Table_Indent) &
-- " Count:" & Natural'Image(I+Output_Object.Table_First_Column_Mult-1));
if I /= Output_Object.Column_Count then
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cltxlrtb\cellx" &
Format_Value(Output_Object.Table_Indent +
Output_Object.Table_Column_Width*(Integer(I+Output_Object.Table_First_Column_Mult-1))) & " ");
else -- Last cell, full width.
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cltxlrtb\cellx" &
Format_Value(Output_Object.Table_Indent + Output_Object.Table_Width) & " ");
end if;
end loop;
-- Now, define text format:
if Output_Object.Table_Alignment = ARM_Output.Center_All then
if Output_Object.Table_Has_Small_Text then
Write_Style_for_Paragraph (Output_Object.Output_File,
Table_C_Sml_Text_Info,
Output_Object.Char_Count);
Output_Object.Real_Size := Table_C_Sml_Text_Info.Size;
Output_Object.Size := 0;
else
Write_Style_for_Paragraph (Output_Object.Output_File,
Table_C_Text_Info,
Output_Object.Char_Count);
Output_Object.Real_Size := Table_C_Text_Info.Size;
Output_Object.Size := 0;
end if;
else
if Output_Object.Table_Has_Small_Text then
Write_Style_for_Paragraph (Output_Object.Output_File,
Table_L_Sml_Text_Info,
Output_Object.Char_Count);
Output_Object.Real_Size := Table_L_Sml_Text_Info.Size;
Output_Object.Size := 0;
else
Write_Style_for_Paragraph (Output_Object.Output_File,
Table_L_Text_Info,
Output_Object.Char_Count);
Output_Object.Real_Size := Table_L_Text_Info.Size;
Output_Object.Size := 0;
end if;
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "\intbl ");
Output_Object.Char_Count := Output_Object.Char_Count + 6;
when First_Row | Row | Last_Row =>
-- Now, define the cell borders for each cell:
for I in 1 .. Output_Object.Column_Count loop
if Output_Object.Table_Has_Border then
if Kind = First_Row then
Ada.Text_IO.Put_Line (Output_Object.Output_File,
"\clvertalc \clbrdrt\brdrs\brdrw10 " &
"\clbrdrl\brdrs\brdrw10 " &
"\clbrdrb\brdrs\brdrw10 " &
"\clbrdrr\brdrs\brdrw10 ");
elsif Kind = Row then
--Ada.Text_IO.Put_Line (Output_Object.Output_File,
-- "\clvertalc \clbrdrl\brdrs\brdrw10 " &
-- "\clbrdrr\brdrs\brdrw10 ");
-- Why no bottom border??
-- No top border!
Ada.Text_IO.Put_Line (Output_Object.Output_File,
"\clvertalc \clbrdrl\brdrs\brdrw10 " &
"\clbrdrb\brdrs\brdrw10 " &
"\clbrdrr\brdrs\brdrw10 ");
else -- Kind = Last_Row then
-- No top border!
Ada.Text_IO.Put_Line (Output_Object.Output_File,
"\clvertalc \clbrdrl\brdrs\brdrw10 " &
"\clbrdrb\brdrs\brdrw10 " &
"\clbrdrr\brdrs\brdrw10 ");
end if;
else
Ada.Text_IO.Put_Line (Output_Object.Output_File,
"\clvertalc ");
end if;
if I /= Output_Object.Column_Count then
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cltxlrtb\cellx" &
Format_Value(Output_Object.Table_Indent +
Output_Object.Table_Column_Width*(Integer(I+Output_Object.Table_First_Column_Mult-1))) & " ");
else -- Last cell, full width.
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cltxlrtb\cellx" &
Format_Value(Output_Object.Table_Indent + Output_Object.Table_Width) & " ");
end if;
end loop;
-- Now, define text format:
if Output_Object.Table_Alignment = ARM_Output.Center_All then
if Output_Object.Table_Has_Small_Text then
Write_Style_for_Paragraph (Output_Object.Output_File,
Table_C_Sml_Text_Info,
Output_Object.Char_Count);
Output_Object.Real_Size := Table_C_Sml_Text_Info.Size;
Output_Object.Size := 0;
else
Write_Style_for_Paragraph (Output_Object.Output_File,
Table_C_Text_Info,
Output_Object.Char_Count);
Output_Object.Real_Size := Table_C_Text_Info.Size;
Output_Object.Size := 0;
end if;
else
if Output_Object.Table_Has_Small_Text then
Write_Style_for_Paragraph (Output_Object.Output_File,
Table_L_Sml_Text_Info,
Output_Object.Char_Count);
Output_Object.Real_Size := Table_L_Sml_Text_Info.Size;
Output_Object.Size := 0;
else
Write_Style_for_Paragraph (Output_Object.Output_File,
Table_L_Text_Info,
Output_Object.Char_Count);
Output_Object.Real_Size := Table_L_Text_Info.Size;
Output_Object.Size := 0;
end if;
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "\intbl ");
Output_Object.Char_Count := Output_Object.Char_Count + 6;
end case;
-- \trowd - Start a table row.
-- \row - End a table row.
-- \trgaph - Half of of the gap between cells, in twips.
-- \trhdr - Repeat line as header on following pages.
-- \trkeep - Keep the row together (no page break).
-- \trkeepfollow - Keep the row with the following (no page break).
-- \trleft - Left edge of table row (in twips).
-- \trrh - Row height (minimum if positive, absolute if negative).
-- \clveralc - Text is centered vertically in cell.
-- \cltxlrtb - Text flows top to bottom and left to right.
-- \cellx - Right edge of cell, in Twips. (This is an absolute position).
-- \intbl - Required marker for each cell.
-- \cell - Ends cell (use instead of \par).
-- \trbrdrt - Row Top border
-- \trbrdrl - Row Left border
-- \trbrdrb - Row Bottom border
-- \trbrdrr - Row Right border
-- \trbrdrh - Row Horizontal border
-- \trbrdrv - Row Vertical border
-- \clbrdrt - Cell Top border
-- \clbrdrl - Cell Left border
-- \clbrdrb - Cell Bottom border
-- \clbrdrr - Cell Right border
-- \brdrs - Single width border
-- \brdrw - Width of the pen (can't be more than 75).
end RTF_Table_Info;
procedure Start_Table (Output_Object : in out RTF_Output_Type;
Columns : in ARM_Output.Column_Count;
First_Column_Width : in ARM_Output.Column_Count;
Last_Column_Width : in ARM_Output.Column_Count;
Alignment : in ARM_Output.Column_Text_Alignment;
No_Page_Break : in Boolean;
Has_Border : in Boolean;
Small_Text_Size : in Boolean;
Header_Kind : in ARM_Output.Header_Kind_Type) is
-- Starts a table. The number of columns is Columns; the first
-- column has First_Column_Width times the normal column width, and
-- the last column has Last_Column_Width times the normal column width.
-- Alignment is the horizontal text alignment within the columns.
-- No_Page_Break should be True to keep the table intact on a single
-- page; False to allow it to be split across pages.
-- Has_Border should be true if a border is desired, false otherwise.
-- Small_Text_Size means that the contents will have the AARM size;
-- otherwise it will have the normal size.
-- Header_Kind determines whether the table has headers.
-- This command starts a paragraph; the entire table is a single
-- paragraph. Text will be considered part of the caption until the
-- next table marker call.
-- Raises Not_Valid_Error if in a paragraph.
Page_Width : Natural;
Column_Units : constant Natural :=
Natural(Columns+First_Column_Width+Last_Column_Width-2);
-- The number of column units (a unit being a regular width column).
begin
if not Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not valid object");
end if;
if Output_Object.Is_In_Paragraph then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Table in paragraph");
end if;
Output_Object.Is_In_Paragraph := True;
Output_Object.Is_In_Table := True;
Output_Object.Table_No_Page_Break := No_Page_Break;
Output_Object.Table_Alignment := Alignment;
Output_Object.Table_First_Column_Mult := First_Column_Width;
Output_Object.Table_Last_Column_Mult := Last_Column_Width;
Output_Object.Table_Has_Border := Has_Border;
Output_Object.Table_Has_Small_Text := Small_Text_Size;
case Output_Object.Page_Size is
when ARM_RTF.A4 =>
Page_Width := 9030;
when ARM_RTF.Letter =>
Page_Width := 9360;
when ARM_RTF.Half_Letter =>
Page_Width := 5040;
when ARM_RTF.Ada95 =>
Page_Width := 7740;
end case;
if Column_Units <= 3 then
Output_Object.Table_Indent := Page_Width / 6;
elsif Column_Units <= 8 then
Output_Object.Table_Indent := Page_Width / 16;
else
Output_Object.Table_Indent := 0;
end if;
Output_Object.Table_Width := Page_Width - Output_Object.Table_Indent*2;
Output_Object.Table_Column_Width := Output_Object.Table_Width / (Column_Units);
Output_Object.Column_Count := Columns;
--Ada.Text_IO.Put_Line("Table information");
--Ada.Text_IO.Put_Line("Columns:" & Natural'Image(Columns) &
-- " 1st column mult:" & Natural'Image(First_Column_Width) &
-- " last column mult:" & Natural'Image(Last_Column_Width));
--Ada.Text_IO.Put_Line("Width (twips):" & Natural'Image(Output_Object.Table_Width) &
-- " Column width:" & Natural'Image(Output_Object.Table_Column_Width));
-- Make a blank line before, of the right size:
Write_Style_for_Paragraph (Output_Object.Output_File,
Table_L_Text_Info,
Output_Object.Char_Count);
Ada.Text_IO.Put (Output_Object.Output_File, "\par }");
Output_Object.Char_Count := 0;
case Header_Kind is
when ARM_Output.Both_Caption_and_Header =>
RTF_Table_Info (Output_Object, Kind => Caption);
when ARM_Output.Header_Only =>
RTF_Table_Info (Output_Object, Kind => Header_no_Caption);
when ARM_Output.No_Headers =>
RTF_Table_Info (Output_Object, Kind => Row);
end case;
end Start_Table;
procedure Table_Marker (Output_Object : in out RTF_Output_Type;
Marker : in ARM_Output.Table_Marker_Type) is
-- Marks the end of an entity in a table.
-- If Marker is End_Caption, the table caption ends and the
-- future text is part of the table header.
-- If Marker is End_Header, the table header ends and the
-- future text is part of the table body.
-- If Marker is End_Row, a row in the table is completed, and another
-- row started.
-- If Marker is End_Row_Next_Is_Last, a row in the table is completed,
-- and another row started. That row is the last row in the table.
-- If Marker is End_Item, an item in the table header or body is ended,
-- and another started.
-- If Marker is End_Table, the entire table is finished.
-- Raises Not_Valid_Error if not in a table.
use type ARM_Output.Column_Text_Alignment;
begin
if not Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not valid object");
end if;
if (not Output_Object.Is_In_Paragraph) or (not Output_Object.Is_In_Table) then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Table marker not in table");
end if;
case Marker is
when ARM_Output.End_Item =>
if Output_Object.Table_Alignment = ARM_Output.Center_except_First then
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cell }");
Output_Object.Char_Count := 0;
-- Now, define text format:
if Output_Object.Table_Has_Small_Text then
Write_Style_for_Paragraph (Output_Object.Output_File,
Table_C_Sml_Text_Info,
Output_Object.Char_Count);
Output_Object.Real_Size := Table_C_Sml_Text_Info.Size;
Output_Object.Size := 0;
else
Write_Style_for_Paragraph (Output_Object.Output_File,
Table_C_Text_Info,
Output_Object.Char_Count);
Output_Object.Real_Size := Table_C_Text_Info.Size;
Output_Object.Size := 0;
end if;
else -- Text format stays the same.
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cell ");
Output_Object.Char_Count := 0;
end if;
when ARM_Output.End_Caption =>
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cell }");
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\row "); -- End row.
-- Start header row:
RTF_Table_Info (Output_Object, Kind => Header); -- Repeat table definition.
when ARM_Output.End_Header =>
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cell }");
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\row "); -- End row.
-- Start 1st body row:
RTF_Table_Info (Output_Object, Kind => First_Row); -- Repeat table definition.
when ARM_Output.End_Row =>
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cell }");
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\row "); -- End row.
-- Start other body rows (no top border!):
RTF_Table_Info (Output_Object, Kind => Row); -- Repeat table definition.
when ARM_Output.End_Row_Next_Is_Last =>
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cell }");
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\row "); -- End row.
-- Start other body rows (no top border!):
RTF_Table_Info (Output_Object, Kind => Last_Row); -- Repeat table definition.
when ARM_Output.End_Table =>
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cell }");
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\row "); -- End last row of table.
Output_Object.Is_In_Paragraph := False;
Output_Object.Is_In_Table := False;
Output_Object.Column_Count := 1;
-- Make a blank line after, of the right size:
Write_Style_for_Paragraph (Output_Object.Output_File,
Table_L_Text_Info,
Output_Object.Char_Count);
Ada.Text_IO.Put (Output_Object.Output_File, "\par }");
Output_Object.Char_Count := 0;
Ada.Text_IO.New_Line (Output_Object.Output_File);
end case;
end Table_Marker;
-- Text output: These are only allowed after a Start_Paragraph and
-- before any End_Paragraph. Raises Not_Valid_Error if not allowed.
Special_Set : constant Ada.Strings.Maps.Character_Set :=
Ada.Strings.Maps."or" (Ada.Strings.Maps.To_Set ('\'),
Ada.Strings.Maps."or" (Ada.Strings.Maps.To_Set ('{'),
Ada.Strings.Maps.To_Set ('}')));
procedure Ordinary_Text (Output_Object : in out RTF_Output_Type;
Text : in String) is
-- Output ordinary text.
-- The text must end at a word break, never in the middle of a word.
begin
if not Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not valid object");
end if;
if not Output_Object.Is_In_Paragraph then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not in paragraph");
end if;
if Ada.Strings.Fixed.Count (Text, Special_Set) = 0 and then
(Output_Object.Paragraph_Style not in
ARM_Output.Text_Prefixed_Style_Subtype or else
Output_Object.Saw_Hang_End) then
-- The second condition so that prefixes have their
-- characters counted properly...
if Output_Object.Char_Count + Text'Length > LINE_LENGTH then
Ada.Text_IO.New_Line (Output_Object.Output_File);
Ada.Text_IO.Put (Output_Object.Output_File, Text);
Output_Object.Char_Count := Text'Length;
elsif Output_Object.Char_Count + Text'Length >= LINE_LENGTH - 10 then
Ada.Text_IO.Put_Line (Output_Object.Output_File, Text);
Output_Object.Char_Count := 0;
else
Ada.Text_IO.Put (Output_Object.Output_File, Text);
Output_Object.Char_Count := Output_Object.Char_Count + Text'Length;
end if;
else
for I in Text'range loop
Ordinary_Character (Output_Object, Text(I));
end loop;
end if;
end Ordinary_Text;
procedure Ordinary_Character (Output_Object : in out RTF_Output_Type;
Char : in Character) is
-- Output an ordinary character.
-- Spaces will be used to break lines as needed.
begin
if not Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not valid object");
end if;
if not Output_Object.Is_In_Paragraph then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not in paragraph");
end if;
if Char = ' ' and then Output_Object.Char_Count >= LINE_LENGTH - 5 then
Ada.Text_IO.Put_Line (Output_Object.Output_File, " ");
Output_Object.Char_Count := 0;
else
if Char = '\' then
Ada.Text_IO.Put (Output_Object.Output_File, "\\");
Output_Object.Char_Count := Output_Object.Char_Count + 2;
elsif Char = '{' then
Ada.Text_IO.Put (Output_Object.Output_File, "\{");
Output_Object.Char_Count := Output_Object.Char_Count + 2;
elsif Char = '}' then
Ada.Text_IO.Put (Output_Object.Output_File, "\}");
Output_Object.Char_Count := Output_Object.Char_Count + 2;
elsif Char >= Character'Val(126) then -- All higher Latin-1 characters.
declare
Code : constant Natural := Character'Pos(Char);
begin
if Code mod 16 >= 10 then
if Code / 16 >= 10 then
Ada.Text_IO.Put (Output_Object.Output_File, "\'" &
Character'Val((Code / 16 - 10) + Character'Pos('a')) &
Character'Val((Code mod 16 - 10) + Character'Pos('a')));
else
Ada.Text_IO.Put (Output_Object.Output_File, "\'" &
Character'Val((Code / 16) + Character'Pos('0')) &
Character'Val((Code mod 16 - 10) + Character'Pos('a')));
end if;
else
if Code / 16 >= 10 then
Ada.Text_IO.Put (Output_Object.Output_File, "\'" &
Character'Val((Code / 16 - 10) + Character'Pos('a')) &
Character'Val((Code mod 16) + Character'Pos('0')));
else
Ada.Text_IO.Put (Output_Object.Output_File, "\'" &
Character'Val((Code / 16) + Character'Pos('0')) &
Character'Val((Code mod 16) + Character'Pos('0')));
end if;
end if;
Output_Object.Char_Count := Output_Object.Char_Count + 5;
end;
if Output_Object.Paragraph_Style in
ARM_Output.Text_Prefixed_Style_Subtype and then
(not Output_Object.Saw_Hang_End) then
if not Ada.Characters.Handling.Is_Lower (Char) then
Output_Object.Prefix_Large_Char_Count :=
Output_Object.Prefix_Large_Char_Count + 1;
-- else small character. (This isn't perfectly accurate, but
-- these aren't used much in prefixes.)
end if;
end if;
else
Ada.Text_IO.Put (Output_Object.Output_File, Char);
Output_Object.Char_Count := Output_Object.Char_Count + 1;
if Output_Object.Paragraph_Style in
ARM_Output.Text_Prefixed_Style_Subtype and then
(not Output_Object.Saw_Hang_End) then
--Ada.Text_Io.Put (Char);
if Char in 'A' .. 'H' or else Char in 'J' .. 'Z' or else -- Capital 'I' is narrow.
Char in '0' .. '9' or else
Char = '+' or else Char = '_' or else Char = '@' or else
Char = '#' or else Char = '$' or else Char = '%' or else
Char = '&' or else Char = '*' or else Char = '<' or else
Char = '>' then
Output_Object.Prefix_Large_Char_Count :=
Output_Object.Prefix_Large_Char_Count + 1;
elsif Char = '.' then
-- '.' is extra narrow; treat it as canceling out a
-- a large character.
if Output_Object.Prefix_Large_Char_Count > 0 then
Output_Object.Prefix_Large_Char_Count :=
Output_Object.Prefix_Large_Char_Count - 1;
end if;
-- else small character.
end if;
end if;
end if;
end if;
end Ordinary_Character;
procedure Hard_Space (Output_Object : in out RTF_Output_Type) is
-- Output a hard space. No line break should happen at a hard space.
begin
if not Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not valid object");
end if;
if not Output_Object.Is_In_Paragraph then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not in paragraph");
end if;
if Output_Object.Paragraph_Style in ARM_Output.Examples ..
ARM_Output.Small_Examples then
-- Fixed width fonts; hard spaces seem to be a different width
-- than regular ones. So use regular spaces.
Ada.Text_IO.Put (Output_Object.Output_File, " ");
Output_Object.Char_Count := Output_Object.Char_Count + 1;
else
Ada.Text_IO.Put (Output_Object.Output_File, "\~");
Output_Object.Char_Count := Output_Object.Char_Count + 2;
end if;
end Hard_Space;
procedure Line_Break (Output_Object : in out RTF_Output_Type) is
-- Output a line break. This does not start a new paragraph.
-- This corresponds to a "<BR>" in HTML.
begin
if not Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not valid object");
end if;
if not Output_Object.Is_In_Paragraph then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not in paragraph");
end if;
if Output_Object.Is_In_Table then
-- We can't use \Par in a table, or Word deadlocks.
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\line ");
Output_Object.Char_Count := 0;
elsif not Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).Is_Justified then
-- We can't use \Par, as that inserts paragraph spacing.
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\line ");
Output_Object.Char_Count := 0;
else
-- We can't use \Line, as that will cause the line to be justified.
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sa0\par ");
-- We have to turn off the inter-paragraph spacing.
-- Now, reset the \sa setting.
declare
SA_Width : Natural := Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).After;
begin
if ARM_Output."="(Output_Object.Current_Space_After,
ARM_Output.Narrow) then
SA_Width := SA_Width*(LEADING_PERCENT/10)/10;
elsif ARM_Output."="(Output_Object.Current_Space_After,
ARM_Output.Wide) then
SA_Width := SA_Width*(TRAILING_PERCENT/10)/10;
end if;
declare
SA : constant String := Natural'Image(SA_Width);
begin
Ada.Text_IO.Put (Output_Object.Output_File, "\sa");
Ada.Text_IO.Put (Output_Object.Output_File, SA(2..SA'Last));
Ada.Text_IO.Put (Output_Object.Output_File, " ");
Output_Object.Char_Count := 4 + SA'Length - 1;
end;
end;
if (Output_Object.Paragraph_Style in ARM_Output.Bulleted ..
ARM_Output.Small_Hanging_in_Bulleted) then -- Always "NoPrefix" here.
Ada.Text_IO.Put (Output_Object.Output_File, "\tab ");
Output_Object.Char_Count := Output_Object.Char_Count + 5;
end if;
end if;
end Line_Break;
procedure Index_Line_Break (Output_Object : in out RTF_Output_Type;
Clear_Keep_with_Next : in Boolean) is
-- Output a line break for the index. This does not start a new
-- paragraph in terms of spacing. This corresponds to a "<BR>"
-- in HTML. If Clear_Keep_with_Next is true, insure that the next
-- line does not require the following line to stay with it.
-- Raises Not_Valid_Error if the paragraph is not in the index format.
begin
if not Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not valid object");
end if;
if not Output_Object.Is_In_Paragraph then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not in paragraph");
end if;
if ARM_Output."/=" (Output_Object.Paragraph_Style, ARM_Output.Index) or else
ARM_Output."/=" (Output_Object.Paragraph_Indent, 0) then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not in index paragraph");
end if;
-- We have to use /par here, because otherwise we don't get the "undent"
-- at the start of the paragraph.
if Clear_Keep_with_Next then
-- Note: We need this special routine, because ending the paragraph
-- would add blank lines to the HTML.
End_Paragraph (Output_Object);
Start_Paragraph (Output_Object, ARM_Output.Index, Indent => 0,
Number => "", No_Breaks => True, Keep_with_Next => False,
Tab_Stops => Output_Object.Tab_Stops);
else
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par ");
-- Inherits the paragraph properties.
end if;
Output_Object.Char_Count := 0;
end Index_Line_Break;
procedure Soft_Line_Break (Output_Object : in out RTF_Output_Type) is
-- Output a soft line break. This is a place (in the middle of a
-- "word") that we allow a line break. It is usually used after
-- underscores in long non-terminals.
begin
if not Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not valid object");
end if;
if not Output_Object.Is_In_Paragraph then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not in paragraph");
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "\softline ");
--Ada.Text_IO.Put (Output_Object.Output_File, "\zwbo ");
-- -- Zero-width break opportunity. (Word 7.0 [Word 95] or later).
-- (Doesn't work).
Output_Object.Char_Count := Output_Object.Char_Count + 10;
end Soft_Line_Break;
procedure Soft_Hyphen_Break (Output_Object : in out RTF_Output_Type) is
-- Output a soft line break, with a hyphen. This is a place (in the middle of
-- a "word") that we allow a line break. If the line break is used,
-- a hyphen will be added to the text.
begin
if not Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not valid object");
end if;
if not Output_Object.Is_In_Paragraph then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not in paragraph");
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "\-");
Output_Object.Char_Count := Output_Object.Char_Count + 2;
end Soft_Hyphen_Break;
procedure Tab (Output_Object : in out RTF_Output_Type) is
-- Output a tab, inserting space up to the next tab stop.
-- Raises Not_Valid_Error if the paragraph was created with
-- Tab_Stops = ARM_Output.NO_TABS.
begin
if not Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not valid object");
end if;
if not Output_Object.Is_In_Paragraph then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not in paragraph");
end if;
if ARM_Output."="(Output_Object.Tab_Stops, ARM_Output.NO_TABS) then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Tab, but none set");
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "\tab ");
Output_Object.Char_Count := Output_Object.Char_Count + 5;
end Tab;
procedure Special_Character (Output_Object : in out RTF_Output_Type;
Char : in ARM_Output.Special_Character_Type) is
-- Output an special character.
begin
if not Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not valid object");
end if;
if not Output_Object.Is_In_Paragraph then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not in paragraph");
end if;
case Char is
when ARM_Output.EM_Dash =>
Ada.Text_IO.Put (Output_Object.Output_File, "\emdash ");
Output_Object.Char_Count := Output_Object.Char_Count + 8;
when ARM_Output.EN_Dash =>
Ada.Text_IO.Put (Output_Object.Output_File, "\endash ");
Output_Object.Char_Count := Output_Object.Char_Count + 8;
when ARM_Output.GEQ =>
--Unicode: Doesn't work on Windows 98:
--Ada.Text_IO.Put (Output_Object.Output_File, "\uc2\u8805 >=");
--Output_Object.Char_Count := Output_Object.Char_Count + 13;
-- Character 179, Symbol font.
Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\'B3}");
Output_Object.Char_Count := Output_Object.Char_Count + 9;
when ARM_Output.LEQ =>
--Unicode: Doesn't work on Windows 98:
--Ada.Text_IO.Put (Output_Object.Output_File, "\uc2\u8804 <=");
--Output_Object.Char_Count := Output_Object.Char_Count + 13;
-- Character 163, Symbol font.
Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\'A3}");
Output_Object.Char_Count := Output_Object.Char_Count + 9;
when ARM_Output.NEQ =>
--Unicode: Doesn't work on Windows 98:
--Ada.Text_IO.Put (Output_Object.Output_File, "\uc2\u8800 /=");
--Output_Object.Char_Count := Output_Object.Char_Count + 13;
-- Character 185, Symbol font.
Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\'B9}");
Output_Object.Char_Count := Output_Object.Char_Count + 9;
when ARM_Output.PI =>
--Unicode: Doesn't work on Windows 98:
--Ada.Text_IO.Put (Output_Object.Output_File, "\uc2\u960 PI");
--Output_Object.Char_Count := Output_Object.Char_Count + 12;
-- Character 112, Symbol font.
Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\'70}");
Output_Object.Char_Count := Output_Object.Char_Count + 9;
when ARM_Output.Left_Ceiling =>
--Unicode: Doesn't work on Windows 98:
--Ada.Text_IO.Put (Output_Object.Output_File, "\uc8\u8968 Ceiling(");
--Output_Object.Char_Count := Output_Object.Char_Count + 19;
-- Character 233, Symbol font.
Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\'E9}");
Output_Object.Char_Count := Output_Object.Char_Count + 9;
when ARM_Output.Right_Ceiling =>
--Unicode: Doesn't work on Windows 98:
--Ada.Text_IO.Put (Output_Object.Output_File, "\uc1\u8969 )");
--Output_Object.Char_Count := Output_Object.Char_Count + 11;
-- Character 249, Symbol font.
Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\'F9}");
Output_Object.Char_Count := Output_Object.Char_Count + 9;
when ARM_Output.Left_Floor =>
--Unicode: Doesn't work on Windows 98:
--Ada.Text_IO.Put (Output_Object.Output_File, "\uc6\u8970 Floor(");
--Output_Object.Char_Count := Output_Object.Char_Count + 17;
-- Character 235, Symbol font.
Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\'EB}");
Output_Object.Char_Count := Output_Object.Char_Count + 9;
when ARM_Output.Right_Floor =>
--Unicode: Doesn't work on Windows 98:
--Ada.Text_IO.Put (Output_Object.Output_File, "\uc1\u8971 )");
--Output_Object.Char_Count := Output_Object.Char_Count + 11;
-- Character 251, Symbol font.
Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\'FB}");
Output_Object.Char_Count := Output_Object.Char_Count + 9;
when ARM_Output.Thin_Space =>
Ada.Text_IO.Put (Output_Object.Output_File, "\qmspace ");
Output_Object.Char_Count := Output_Object.Char_Count + 9;
when ARM_Output.Left_Quote =>
Ada.Text_IO.Put (Output_Object.Output_File, "\lquote ");
Output_Object.Char_Count := Output_Object.Char_Count + 8;
when ARM_Output.Right_Quote =>
Ada.Text_IO.Put (Output_Object.Output_File, "\rquote ");
Output_Object.Char_Count := Output_Object.Char_Count + 8;
when ARM_Output.Left_Double_Quote =>
Ada.Text_IO.Put (Output_Object.Output_File, "\ldblquote ");
Output_Object.Char_Count := Output_Object.Char_Count + 11;
when ARM_Output.Right_Double_Quote =>
Ada.Text_IO.Put (Output_Object.Output_File, "\rdblquote ");
Output_Object.Char_Count := Output_Object.Char_Count + 11;
when ARM_Output.Small_Dotless_I =>
--Unicode: Doesn't work on Windows 98: but we have no choice here:
Ada.Text_IO.Put (Output_Object.Output_File, "\uc1\u305 i");
-- Note: \uc1 means ASCII version has one character;
-- \u305 means use Unicode character 305.
Output_Object.Char_Count := Output_Object.Char_Count + 11;
when ARM_Output.Capital_Dotted_I =>
--Unicode: Doesn't work on Windows 98: but we have no choice here:
Ada.Text_IO.Put (Output_Object.Output_File, "\uc1\u304 I");
Output_Object.Char_Count := Output_Object.Char_Count + 11;
end case;
if Output_Object.Paragraph_Style in
ARM_Output.Text_Prefixed_Style_Subtype and then
(not Output_Object.Saw_Hang_End) then
Output_Object.Prefix_Large_Char_Count :=
Output_Object.Prefix_Large_Char_Count + 1;
end if;
end Special_Character;
procedure Unicode_Character (Output_Object : in out RTF_Output_Type;
Char : in ARM_Output.Unicode_Type) is
-- Output a Unicode character, with code position Char.
Char_Code : constant String := ARM_Output.Unicode_Type'Image(Char);
Len : constant String := Natural'Image(Char_Code'Length+2);
begin
-- We don't check this, we just output it.
if not Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not valid object");
end if;
if not Output_Object.Is_In_Paragraph then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not in paragraph");
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "\uc" & Len(2..Len'Last) &
"\u" & Char_Code(2..Char_Code'Last) & " <U" &
Char_Code(2..Char_Code'Last) & ">");
Output_Object.Char_Count := Output_Object.Char_Count + 9 + Len'Last-1 +
(Char_Code'Last-1)*2;
if Output_Object.Paragraph_Style in
ARM_Output.Text_Prefixed_Style_Subtype and then
(not Output_Object.Saw_Hang_End) then
Output_Object.Prefix_Large_Char_Count :=
Output_Object.Prefix_Large_Char_Count + 1;
end if;
end Unicode_Character;
procedure End_Hang_Item (Output_Object : in out RTF_Output_Type) is
-- Marks the end of a hanging item. Call only once per paragraph.
-- Raises Not_Valid_Error if the paragraph style is not in
-- Text_Prefixed_Style_Subtype, or if this has already been
-- called for the current paragraph, or if the paragraph was started
-- with No_Prefix = True.
Current_Format : ARM_Output.Format_Type;
begin
if not Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not valid object");
end if;
if not Output_Object.Is_In_Paragraph then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not in paragraph");
end if;
if Output_Object.Paragraph_Style not in ARM_Output.Text_Prefixed_Style_Subtype then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not a hanging paragraph");
end if;
if Output_Object.Saw_Hang_End then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Already saw the end of the hanging part");
end if;
Output_Object.Saw_Hang_End := True;
--Ada.Text_Io.Put (": Cnt=" & Natural'Image(Output_Object.Char_Count) & " Lrg=" &
-- Natural'Image(Output_Object.Prefix_Large_Char_Count));
--Ada.Text_Io.Put (" Style=" & ARM_Output.Paragraph_Style_Type'Image(Output_Object.Paragraph_Style));
--Ada.Text_Io.Put (" Indent=" & ARM_Output.Paragraph_Indent_Type'Image(Output_Object.Paragraph_Indent));
--Ada.Text_Io.Put (" Count=" & Natural'Image(
-- ((Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).Hang_Width * 6 * 2) /
-- (Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).Size * 5 * 5)) - 1));
--Ada.Text_Io.Put (" Hang_Width=" & Natural'Image(Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).Hang_Width));
--Ada.Text_Io.Put (" Size=" & Natural'Image(Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).Size));
if Output_Object.Char_Count*2 + Output_Object.Prefix_Large_Char_Count
<= ((Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).Hang_Width * 6 * 2) /
(Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).Size * 5 * 5)) - 1 then
-- No line break needed. (I can't find a way to get Word to do
-- this properly, so we have to do it. We assume large characters
-- are about 1 1/2 times normal characters, and that normal
-- characters are about 5/6 the pt. size in width. Note that "Size"
-- is in 1/2 pts., while "Hang_Width" is in .1 pts., so we need
-- the "5" to correct the units.) The "- 1" is to allow space
-- for the trailing space/tab. (Running into the text looks bad!).
Ada.Text_IO.Put (Output_Object.Output_File, "\tab ");
Output_Object.Char_Count := Output_Object.Char_Count + 5;
--Ada.Text_Io.Put_Line (" No_Break");
else -- Line break needed.
-- Just writing a line break clobbers any open styles.
-- We have to save the current style, close it properly,
-- do the line break stuff, and then reopen it. This showed as
-- a bug only in RM-All, 3.3.1(19) [which should be shown as
-- deleted, but was not.]
-- Note that the HTML version does this save and restore dance,
-- why we didn't do it here I'm not sure - RLB - 8/19/16.
Current_Format := (Bold => Output_Object.Is_Bold,
Italic => Output_Object.Is_Italic,
Font => Output_Object.Font,
Size => Output_Object.Size,
Color => Output_Object.Color,
Change => Output_Object.Change,
Version => Output_Object.Version,
Added_Version => Output_Object.Added_Version,
Location=> Output_Object.Location);
Text_Format (Output_Object, ARM_Output.NORMAL_FORMAT);
-- Clear the existing format.
--Ada.Text_IO.Put_Line (Output_Object.Output_File, "\line ");
--Output_Object.Char_Count := 0;
--This idiot program JUSTIFIES the text fragment, so a line
--break cannot be used if the text is justified.
Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sa0\keepn\par }");
Write_Style_for_Paragraph (Output_Object.Output_File,
Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent),
Output_Object.Char_Count);
Set_Tabs (Output_Object, Output_Object.Paragraph_Style,
Output_Object.Paragraph_Indent);
-- Reset after spacing:
if ARM_Output."="(Output_Object.Current_Space_After,
ARM_Output.Narrow) then
declare
SA_Width : Natural := Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).After*(LEADING_PERCENT/10)/10;
SA : constant String := Natural'Image(SA_Width);
begin
Ada.Text_IO.Put (Output_Object.Output_File, "\sa");
Ada.Text_IO.Put (Output_Object.Output_File, SA(2..SA'Last));
Ada.Text_IO.Put (Output_Object.Output_File, " ");
Output_Object.Char_Count := 4 + SA'Length - 1;
end;
elsif ARM_Output."="(Output_Object.Current_Space_After,
ARM_Output.Wide) then
declare
SA_Width : Natural := Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).After*(TRAILING_PERCENT/10)/10;
SA : constant String := Natural'Image(SA_Width);
begin
Ada.Text_IO.Put (Output_Object.Output_File, "\sa");
Ada.Text_IO.Put (Output_Object.Output_File, SA(2..SA'Last));
Ada.Text_IO.Put (Output_Object.Output_File, " ");
Output_Object.Char_Count := 4 + SA'Length - 1;
end;
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "\tab ");
Output_Object.Char_Count := Output_Object.Char_Count + 5;
--Ada.Text_Io.Put_Line (" Break");
-- Reset the format:
Text_Format (Output_Object, Current_Format);
end if;
end End_Hang_Item;
procedure Text_Format (Output_Object : in out RTF_Output_Type;
Format : in ARM_Output.Format_Type) is
-- Change the text format so that all of the properties are as specified.
-- Note: Changes to these properties ought be stack-like; that is,
-- Bold on, Italic on, Italic off, Bold off is OK; Bold on, Italic on,
-- Bold off, Italic off should be avoided (as separate commands).
TRACE_TF : constant Boolean := FALSE;
use type ARM_Output.Change_Type;
use type ARM_Output.Location_Type;
use type ARM_Output.Size_Type;
use type ARM_Output.Color_Type;
procedure Make_Size_Command (Size : in Natural) is
-- Write a \fs command to the file for Size.
-- Max 29.5 pt, min 5 pt.
begin
if Output_Object.Real_Size >= 50 then
Ada.Text_IO.Put (Output_Object.Output_File, "\fs5" &
Character'Val(Output_Object.Real_Size mod 10 + Character'Pos('0')));
elsif Output_Object.Real_Size >= 40 then
Ada.Text_IO.Put (Output_Object.Output_File, "\fs4" &
Character'Val(Output_Object.Real_Size mod 10 + Character'Pos('0')));
elsif Output_Object.Real_Size >= 30 then
Ada.Text_IO.Put (Output_Object.Output_File, "\fs3" &
Character'Val(Output_Object.Real_Size mod 10 + Character'Pos('0')));
elsif Output_Object.Real_Size >= 20 then
Ada.Text_IO.Put (Output_Object.Output_File, "\fs2" &
Character'Val(Output_Object.Real_Size mod 10 + Character'Pos('0')));
elsif Output_Object.Real_Size >= 10 then
Ada.Text_IO.Put (Output_Object.Output_File, "\fs1" &
Character'Val(Output_Object.Real_Size mod 10 + Character'Pos('0')));
else
Ada.Text_IO.Put (Output_Object.Output_File, "\fs10");
end if;
Output_Object.Char_Count := Output_Object.Char_Count + 6;
end Make_Size_Command;
procedure Close_Basic_Format is
-- Close any open basic format (Bold/Italic/Size/Font) command.
begin
if (not Output_Object.Is_Bold) and (not Output_Object.Is_Italic) and
ARM_Output."=" (Output_Object.Font, ARM_Output.Default) and
Output_Object.Color = ARM_Output.Default and
Output_Object.Size = 0 then
-- No format previously set, so none to close (default).
return;
end if;
if TRACE_TF then
Ada.Text_Io.Put (" Close basic format [");
if Output_Object.Is_Bold then
Ada.Text_Io.Put ('B');
end if;
if Output_Object.Is_Italic then
Ada.Text_Io.Put ('I');
end if;
if Output_Object.Size /= 0 then
Ada.Text_Io.Put ('S');
end if;
if Output_Object.Color /= ARM_Output.Default then
Ada.Text_Io.Put ('C');
end if;
if ARM_Output."/=" (Output_Object.Font, ARM_Output.Default) then
Ada.Text_Io.Put ('F');
end if;
Ada.Text_Io.Put (']');
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "}");
Output_Object.Char_Count := Output_Object.Char_Count + 1;
Output_Object.Real_Size := Output_Object.Real_Size -
(Integer(Output_Object.Size)*2);
Output_Object.Size := 0;
Output_Object.Is_Bold := False;
Output_Object.Is_Italic := False;
Output_Object.Color := ARM_Output.Default;
case Output_Object.Font is
when ARM_Output.Default => null;
when ARM_Output.Fixed => null;
when ARM_Output.Roman => null;
when ARM_Output.Swiss =>
-- Undo the size adjustment, if any.
if ARM_Output."/=" (Output_Object.Body_Font, ARM_Output.Swiss) then
Output_Object.Real_Size := Output_Object.Real_Size + 1;
-- else no adjustment.
end if;
end case;
Output_Object.Font := ARM_Output.Default;
end Close_Basic_Format;
procedure Make_Basic_Format is
-- Make any needed Bold/Italic/Size/Font command.
begin
if (not Format.Bold) and (not Format.Italic) and
ARM_Output."=" (Format.Font, ARM_Output.Default) and
Format.Color = ARM_Output.Default and
Format.Size = 0 then
-- No format needed (default).
return;
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "{");
Output_Object.Char_Count := Output_Object.Char_Count + 1;
if TRACE_TF then
Ada.Text_Io.Put (" Make basic {");
end if;
-- Bold:
if Format.Bold then
if TRACE_TF then
Ada.Text_Io.Put (" Change bold");
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "\b");
Output_Object.Char_Count := Output_Object.Char_Count + 2;
Output_Object.Is_Bold := True;
end if;
-- Italic:
if Format.Italic then
if TRACE_TF then
Ada.Text_Io.Put (" Change italics");
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "\i");
Output_Object.Char_Count := Output_Object.Char_Count + 2;
Output_Object.Is_Italic := True;
end if;
-- Size:
if Format.Size /= 0 then
if TRACE_TF then
Ada.Text_Io.Put (" Change size " & ARM_Output.Size_Type'Image(Format.Size));
end if;
Output_Object.Real_Size := Output_Object.Real_Size +
Integer(Format.Size)*2;
if ARM_Output."/=" (Format.Font, ARM_Output.Swiss)
or else ARM_Output."=" (Output_Object.Body_Font, ARM_Output.Swiss) then
Make_Size_Command (Output_Object.Real_Size);
-- else it will be done by the Font, below.
end if;
end if;
Output_Object.Size := Format.Size;
-- Color:
if Format.Color /= ARM_Output.Default then
if TRACE_TF then
Ada.Text_Io.Put (" Change color " & ARM_Output.Color_Type'Image(Format.Color));
end if;
case Format.Color is
when ARM_Output.Default => null;
when ARM_Output.Black => -- Color 1
Ada.Text_IO.Put (Output_Object.Output_File, "\cf1");
Output_Object.Char_Count := Output_Object.Char_Count + 4;
when ARM_Output.Red => -- Color 13
Ada.Text_IO.Put (Output_Object.Output_File, "\cf13");
Output_Object.Char_Count := Output_Object.Char_Count + 5;
when ARM_Output.Green => -- Color 11
Ada.Text_IO.Put (Output_Object.Output_File, "\cf11");
Output_Object.Char_Count := Output_Object.Char_Count + 5;
when ARM_Output.Blue => -- Color 9
Ada.Text_IO.Put (Output_Object.Output_File, "\cf9");
Output_Object.Char_Count := Output_Object.Char_Count + 4;
end case;
end if;
Output_Object.Color := Format.Color;
-- Font:
case Format.Font is
when ARM_Output.Default => null;
when ARM_Output.Fixed =>
if TRACE_TF then
Ada.Text_Io.Put (" Change font fixed");
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "\f2");
Output_Object.Char_Count := Output_Object.Char_Count + 4;
when ARM_Output.Roman =>
if TRACE_TF then
Ada.Text_Io.Put (" Change font roman");
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "\f0");
Output_Object.Char_Count := Output_Object.Char_Count + 4;
when ARM_Output.Swiss =>
if TRACE_TF then
Ada.Text_Io.Put (" Change font swiss");
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "\f1");
Output_Object.Char_Count := Output_Object.Char_Count + 3;
-- Swiss fonts always appear too large, so shrink it a bit,
-- but not if the main body is a Swiss font.
if ARM_Output."/=" (Output_Object.Body_Font, ARM_Output.Swiss) then
Output_Object.Real_Size := Output_Object.Real_Size - 1;
Make_Size_Command (Output_Object.Real_Size);
end if;
end case;
Ada.Text_IO.Put (Output_Object.Output_File, " ");
Output_Object.Char_Count := Output_Object.Char_Count + 1;
Output_Object.Font := Format.Font;
end Make_Basic_Format;
procedure Make_Revision is
-- Make any needed revision:
begin
-- We could "improve" this by keeping similar changes together,
-- especially for changes to/from Both, but its a lot more work
-- and unnecessary.
case Format.Change is
when ARM_Output.Insertion =>
if TRACE_TF then
Ada.Text_Io.Put (" Change insertion");
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "{\revised\revauth" & Format.Version & ' ');
Output_Object.Char_Count := Output_Object.Char_Count + 18;
-- Note: \revauthN indicates the author. Each version
-- that we'll use needs an entry in the \revtbl.
-- We could include a date with \revddtm??, but that's messy.
when ARM_Output.Deletion =>
if TRACE_TF then
Ada.Text_Io.Put (" Change deletion");
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "{\deleted\revauthdel" & Format.Version & ' ');
Output_Object.Char_Count := Output_Object.Char_Count + 21;
-- Note: \revauthdelN indicates the author. Each version
-- that we'll use needs an entry in the \revtbl.
-- We could include a date with \revddtmdel??, but that's messy.
when ARM_Output.Both =>
if TRACE_TF then
Ada.Text_Io.Put (" Change both");
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "{\revised\revauth" & Format.Added_Version & ' ');
Output_Object.Char_Count := Output_Object.Char_Count + 18;
Ada.Text_IO.Put (Output_Object.Output_File, "{\deleted\revauthdel" & Format.Version & ' ');
Output_Object.Char_Count := Output_Object.Char_Count + 21;
-- Note: \revauthdelN indicates the author. Each version
-- that we'll use needs an entry in the \revtbl.
-- We could include a date with \revddtmdel??, but that's messy.
when ARM_Output.None =>
null;
end case;
Output_Object.Change := Format.Change;
Output_Object.Version := Format.Version;
Output_Object.Added_Version := Format.Added_Version;
end Make_Revision;
procedure Close_Revision is
-- Close any open revision:
begin
-- We could "improve" this by keeping similar changes together,
-- especially for changes to/from Both, but its a lot more work
-- and unnecessary.
case Output_Object.Change is
when ARM_Output.Insertion =>
if TRACE_TF then
Ada.Text_Io.Put (" Unchange insertion");
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "}");
Output_Object.Char_Count := Output_Object.Char_Count + 1;
when ARM_Output.Deletion =>
if TRACE_TF then
Ada.Text_Io.Put (" Unchange deletion");
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "}");
Output_Object.Char_Count := Output_Object.Char_Count + 1;
when ARM_Output.None =>
null;
when ARM_Output.Both =>
if TRACE_TF then
Ada.Text_Io.Put (" Unchange both");
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "}}");
Output_Object.Char_Count := Output_Object.Char_Count + 2;
end case;
end Close_Revision;
procedure Make_Location is
-- Make any needed location:
begin
case Format.Location is
when ARM_Output.Subscript =>
if TRACE_TF then
Ada.Text_Io.Put (" Change sub");
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "{\sub ");
Output_Object.Char_Count := Output_Object.Char_Count + 6;
when ARM_Output.Superscript =>
if TRACE_TF then
Ada.Text_Io.Put (" Change sup");
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "{\super ");
Output_Object.Char_Count := Output_Object.Char_Count + 8;
when ARM_Output.Normal =>
null;
end case;
Output_Object.Location := Format.Location;
end Make_Location;
procedure Close_Location is
-- Close any open location:
begin
case Output_Object.Location is
when ARM_Output.Subscript =>
if TRACE_TF then
Ada.Text_Io.Put (" Unchange sub");
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "}");
Output_Object.Char_Count := Output_Object.Char_Count + 1;
when ARM_Output.Superscript =>
if TRACE_TF then
Ada.Text_Io.Put (" Unchange sup");
end if;
Ada.Text_IO.Put (Output_Object.Output_File, "}");
Output_Object.Char_Count := Output_Object.Char_Count + 1;
when ARM_Output.Normal =>
null;
end case;
end Close_Location;
begin
if not Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not valid object");
end if;
if not Output_Object.Is_In_Paragraph then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not in paragraph");
end if;
if TRACE_TF then
Ada.Text_Io.Put ("Text format");
end if;
-- We always make changes in the order:
-- Revision;
-- Location;
-- Basic_Format (Bold, Italic, Font, Size, Color).
-- Thus, we have to unstack them in the reverse order. And, if we want
-- to change an outer one, we have to close and redo any inner
-- ones.
-- We do these in this order so that the changes are stacked properly.
if Format.Change /= Output_Object.Change or else
Format.Version /= Output_Object.Version or else
Format.Added_Version /= Output_Object.Added_Version then
Close_Basic_Format;
Close_Location;
Close_Revision;
Make_Revision;
Make_Location;
Make_Basic_Format;
elsif Format.Location /= Output_Object.Location then
-- We don't need to change the revision, leave it alone.
Close_Basic_Format;
Close_Location;
Make_Location;
Make_Basic_Format;
elsif Format.Color /= Output_Object.Color or else
Format.Size /= Output_Object.Size or else
ARM_Output."/=" (Format.Font, Output_Object.Font) or else
Format.Bold /= Output_Object.Is_Bold or else
Format.Italic /= Output_Object.Is_Italic then
Close_Basic_Format;
Make_Basic_Format;
-- else no change at all.
end if;
if TRACE_TF then
Ada.Text_Io.New_Line;
end if;
end Text_Format;
procedure Clause_Reference (Output_Object : in out RTF_Output_Type;
Text : in String;
Clause_Number : in String) is
-- Generate a reference to a clause in the standard. The text of
-- the reference is "Text", and the number of the clause is
-- Clause_Number. For hyperlinked formats, this should generate
-- a link; for other formats, the text alone is generated.
begin
Ordinary_Text (Output_Object, Text); -- Nothing special in this format.
-- Note: We could generate genuine clause references for Word,
-- but that wouldn't buy us anything for the RM.
end Clause_Reference;
procedure Index_Target (Output_Object : in out RTF_Output_Type;
Index_Key : in Natural) is
-- Generate a index target. This marks the location where an index
-- reference occurs. Index_Key names the index item involved.
-- For hyperlinked formats, this should generate a link target;
-- for other formats, nothing is generated.
begin
if not Output_Object.Is_Valid then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not valid object");
end if;
if not Output_Object.Is_In_Paragraph then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Not in paragraph");
end if;
null; -- Nothing to do for RTF. We could have let Word make the
-- index, but then we'd still have to build it for HTML, and
-- we couldn't get paragraph numbers in the index.
end Index_Target;
procedure Index_Reference (Output_Object : in out RTF_Output_Type;
Text : in String;
Index_Key : in Natural;
Clause_Number : in String) is
-- Generate a reference to an index target in the standard. The text
-- of the reference is "Text", and Index_Key and Clause_Number denotes
-- the target. For hyperlinked formats, this should generate
-- a link; for other formats, the text alone is generated.
begin
Ordinary_Text (Output_Object, Text); -- Nothing special in this format.
end Index_Reference;
procedure DR_Reference (Output_Object : in out RTF_Output_Type;
Text : in String;
DR_Number : in String) is
-- Generate a reference to an DR from the standard. The text
-- of the reference is "Text", and DR_Number denotes
-- the target. For hyperlinked formats, this should generate
-- a link; for other formats, the text alone is generated.
begin
Ordinary_Text (Output_Object, Text); -- Nothing special in this format.
end DR_Reference;
procedure AI_Reference (Output_Object : in out RTF_Output_Type;
Text : in String;
AI_Number : in String) is
-- Generate a reference to an AI from the standard. The text
-- of the reference is "Text", and AI_Number denotes
-- the target (in unfolded format). For hyperlinked formats, this should
-- generate a link; for other formats, the text alone is generated.
begin
Ordinary_Text (Output_Object, Text); -- Nothing special in this format.
end AI_Reference;
procedure Local_Target (Output_Object : in out RTF_Output_Type;
Text : in String;
Target : in String) is
-- Generate a local target. This marks the potential target of local
-- links identified by "Target". Text is the text of the target.
-- For hyperlinked formats, this should generate a link target;
-- for other formats, only the text is generated.
begin
Ordinary_Text (Output_Object, Text); -- Nothing special in this format.
end Local_Target;
procedure Local_Link (Output_Object : in out RTF_Output_Type;
Text : in String;
Target : in String;
Clause_Number : in String) is
-- Generate a local link to the target and clause given.
-- Text is the text of the link.
-- For hyperlinked formats, this should generate a link;
-- for other formats, only the text is generated.
begin
Ordinary_Text (Output_Object, Text); -- Nothing special in this format.
end Local_Link;
procedure Local_Link_Start (Output_Object : in out RTF_Output_Type;
Target : in String;
Clause_Number : in String) is
-- Generate a local link to the target and clause given.
-- The link will surround text until Local_Link_End is called.
-- Local_Link_End must be called before this routine can be used again.
-- For hyperlinked formats, this should generate a link;
-- for other formats, only the text is generated.
begin
null; -- No link, nothing to do.
end Local_Link_Start;
procedure Local_Link_End (Output_Object : in out RTF_Output_Type;
Target : in String;
Clause_Number : in String) is
-- End a local link for the target and clause given.
-- This must be in the same paragraph as the Local_Link_Start.
-- For hyperlinked formats, this should generate a link;
-- for other formats, only the text is generated.
begin
null; -- No link, nothing to do.
end Local_Link_End;
procedure URL_Link (Output_Object : in out RTF_Output_Type;
Text : in String;
URL : in String) is
-- Generate a link to the URL given.
-- Text is the text of the link.
-- For hyperlinked formats, this should generate a link;
-- for other formats, only the text is generated.
begin
Ordinary_Text (Output_Object, Text); -- Nothing special in this format.
end URL_Link;
procedure Picture (Output_Object : in out RTF_Output_Type;
Name : in String;
Descr : in String;
Alignment : in ARM_Output.Picture_Alignment;
Height, Width : in Natural;
Border : in ARM_Output.Border_Kind) is
-- Generate a picture.
-- Name is the (simple) file name of the picture; Descr is a
-- descriptive name for the picture (it will appear in some web
-- browsers).
-- We assume that it is a .PNG or .JPG and that it will be present
-- in the same directory as the output files.
-- Alignment specifies the picture alignment.
-- Height and Width specify the picture size in pixels.
-- Border specifies the kind of border.
use type ARM_Output.Picture_Alignment;
use type ARM_Output.Border_Kind;
HORIZONTAL_TWIPS_PER_PIXEL : constant := 16; -- By experiment.
VERTICAL_TWIPS_PER_PIXEL : constant := 16; -- By experiment.
-- These values give us Pixels/90 = box size in inches.
-- For reasons that I don't understand, the supposed "raw" picture
-- size is Pixels/120. So a scaling of 75% gives exact pixels.
type Kind is (PNG, JPEG, Unknown);
type DWord is mod 2**32;
Picture_Width : DWord;
Picture_Height : DWord;
Picture_Kind : Kind := Unknown;
Picture_Scaling : Natural;
procedure Get_Picture_Dimensions is
-- Get the picture dimensions from the graphic file.
use type Ada.Streams.Stream_Element_Offset;
Fyle : Ada.Streams.Stream_IO.File_Type;
type PNG_Header is record
Signature_1 : DWord; -- Fixed value
Signature_2 : DWord; -- Fixed value
Header_Len : DWord; -- Fixed value (13)
Header_Type : DWord; -- Fixed value ("IHDR")
Width : DWord; -- In pixels.
Height : DWord; -- In pixels.
-- Other stuff is not important here.
end record;
subtype PNG_Stream is Ada.Streams.Stream_Element_Array(1..6*4);
function Convert is new Ada.Unchecked_Conversion (Source => PNG_Stream,
Target => PNG_Header);
Buffer : PNG_Stream;
Last : Ada.Streams.Stream_Element_Offset;
Temp : Ada.Streams.Stream_Element;
begin
begin
Ada.Streams.Stream_IO.Open (Fyle,
Mode => Ada.Streams.Stream_IO.In_File,
Name => Ada.Strings.Unbounded.To_String (Output_Object.Output_Path) &
Name);
exception
when Oops:others =>
Ada.Text_IO.Put_Line ("** Unable to open picture file: " &
Ada.Exceptions.Exception_Message(Oops));
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Unable to open picture file");
end;
-- Read a PNG header, to see if it is a PNG:
Ada.Streams.Stream_IO.Read (Fyle, Buffer, Last);
if Last /= 24 then
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Picture file too short");
end if;
if Convert(Buffer).Signature_1 = 16#89_50_4e_47# and then
Convert(Buffer).Signature_2 = 16#0d_0a_1a_0a# then
-- This is a PNG file:
Picture_Kind := PNG;
Picture_Width := Convert(Buffer).Width;
Picture_Height := Convert(Buffer).Height;
Ada.Text_IO.Put_Line ("Forward PNG: Width=" &
DWord'Image(Picture_Width) & " Height=" &
DWord'Image(Picture_Height));
elsif Convert(Buffer).Signature_1 = 16#47_4e_50_89# and then
Convert(Buffer).Signature_2 = 16#0a_1a_0a_0d# then
-- This is a byte-swapped PNG file.
-- Swap the bytes in the buffer, then get the width and height:
Temp := Buffer(17);
Buffer(17) := Buffer(20);
Buffer(20) := Temp;
Temp := Buffer(18);
Buffer(18) := Buffer(19);
Buffer(19) := Temp;
Temp := Buffer(21);
Buffer(21) := Buffer(24);
Buffer(24) := Temp;
Temp := Buffer(22);
Buffer(22) := Buffer(23);
Buffer(23) := Temp;
Picture_Kind := PNG;
Picture_Width := Convert(Buffer).Width;
Picture_Height := Convert(Buffer).Height;
Ada.Text_IO.Put_Line ("Reversed PNG: Width=" &
DWord'Image(Picture_Width) & " Height=" &
DWord'Image(Picture_Height));
-- elsif Name'Length > 5 and then
-- (Name(Name'Last-3..Name'Last) = ".JPG" or else
-- Name(Name'Last-3..Name'Last) = ".jpg" or else
-- Name(Name'Last-4..Name'Last) = ".JPEG" or else
-- Name(Name'Last-4..Name'Last) = ".Jpeg" or else
-- Name(Name'Last-4..Name'Last) = ".jpeg") then
-- Picture_Kind := JPEG;
else
Ada.Text_IO.Put_Line ("** Unimplemented picture formatting: File type");
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Do not recognize picture file");
end if;
end Get_Picture_Dimensions;
function Format_Twips (Twips : in Natural) return String is
Flab : constant String := Natural'Image(Twips);
begin
return Flab(2..Flab'Last);
end Format_Twips;
procedure Dump_File_in_Hex is
-- Read and output the graphics file to the output file
-- in Hexadecimal.
Fyle : Ada.Streams.Stream_IO.File_Type;
Buffer : Ada.Streams.Stream_Element_Array(1..32);
Last : Ada.Streams.Stream_Element_Offset;
use type Ada.Streams.Stream_Element;
use type Ada.Streams.Stream_Element_Offset;
Temp : Ada.Streams.Stream_Element;
begin
begin
Ada.Streams.Stream_IO.Open (Fyle,
Mode => Ada.Streams.Stream_IO.In_File,
Name => Ada.Strings.Unbounded.To_String (Output_Object.Output_Path) &
Name);
exception
when Oops:others =>
Ada.Text_IO.Put_Line ("** Unable to open picture file: " &
Ada.Exceptions.Exception_Message(Oops));
Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
"Unable to open picture file");
end;
loop
Ada.Streams.Stream_IO.Read (Fyle, Buffer, Last);
exit when Last = 0; -- Nothing read equals end of file.
for I in 1 .. Last loop
Temp := Buffer(I) / 16;
if Temp > 9 then
Ada.Text_IO.Put (Output_Object.Output_File,
Character'Val(Character'Pos('A') + (Temp - 10)));
else
Ada.Text_IO.Put (Output_Object.Output_File,
Character'Val(Character'Pos('0') + Temp));
end if;
Temp := Buffer(I) mod 16;
if Temp > 9 then
Ada.Text_IO.Put (Output_Object.Output_File,
Character'Val(Character'Pos('A') + (Temp - 10)));
else
Ada.Text_IO.Put (Output_Object.Output_File,
Character'Val(Character'Pos('0') + Temp));
end if;
end loop;
Ada.Text_IO.New_Line (Output_Object.Output_File);
end loop;
Ada.Streams.Stream_IO.Close (Fyle);
end Dump_File_in_Hex;
begin
Get_Picture_Dimensions;
-- Calculate scaling needed:
declare
Width_Scale, Height_Scale : Float;
Word_Scaling : constant Float := 6.0;
-- Scaling so that the HTML pixel and Word pixel
-- have the same approximate size. Word's pixels
-- seem to be about 6 times smaller than HTML's.
-- Word's box size is
begin
Width_Scale := Float(Width) / Float(Picture_Width) * 100.0 * Word_Scaling;
Height_Scale := Float(Height) / Float(Picture_Height) * 100.0 * Word_Scaling;
-- Then, use the smaller scale:
if Width_Scale < Height_Scale then
Picture_Scaling := Natural(Width_Scale);
else
Picture_Scaling := Natural(Height_Scale);
end if;
Ada.Text_IO.Put_Line ("Picture scaling (%):" & Natural'Image(Picture_Scaling));
Ada.Text_IO.Put_Line ("Box width=" &
Natural'Image(Width) & " Height=" &
Natural'Image(Height));
-- Note: Word 2000/2003 seems to ignore this scaling; it seems to
-- use the "picwgoal" and "pichgoal" exclusively.
-- As noted above, that naturally gives a 75% scaling when the
-- picture size and box size are the same. We remove that for this
-- information. (Note: The smaller the scaling the better.)
Ada.Text_IO.Put_Line ("Word 2003 scaling: Width=" &
Natural'Image(Natural(Float(Width) / Float(Picture_Width) * 100.0 / 0.75)) & " Height=" &
Natural'Image(Natural(Float(Height) / Float(Picture_Height) * 100.0 / 0.75)));
end;
-- Wrap the picture in a shape, so we can set the properties:
Ada.Text_IO.Put (Output_Object.Output_File,
"{\shp{\*\shpinst"); -- Start a shape.
Ada.Text_IO.Put (Output_Object.Output_File,
"\shpleft0\shptop0"); -- Left and top are the origin.
Ada.Text_IO.Put (Output_Object.Output_File,
"\shpright" & Format_Twips(Width * HORIZONTAL_TWIPS_PER_PIXEL)); -- Right edge in twips.
Ada.Text_IO.Put_Line (Output_Object.Output_File,
"\shpbottom" & Format_Twips(Height * VERTICAL_TWIPS_PER_PIXEL)); -- Bottom edge in twips.
Ada.Text_IO.Put (Output_Object.Output_File,
"\shpfhdr0"); -- Shape is in the main document.
Ada.Text_IO.Put (Output_Object.Output_File,
"\shpbxcolumn"); -- Shape is positioned relative to the column.
Ada.Text_IO.Put (Output_Object.Output_File,
"\shpbxignore"); -- But use posrelh instead (column is the default).
Ada.Text_IO.Put (Output_Object.Output_File,
"\shpbypara"); -- Shape is positioned relative to the paragraph.
Ada.Text_IO.Put (Output_Object.Output_File,
"\shpbyignore"); -- But use posrelv instead (paragraph is the default).
case Alignment is
when ARM_Output.Inline =>
Ada.Text_IO.Put (Output_Object.Output_File,
"\shpwr2\shpwrk0"); -- Wrap text around shape (rectangle), on both sides.
when ARM_Output.Float_Left =>
Ada.Text_IO.Put (Output_Object.Output_File,
"\shpwr2\shpwrk2"); -- Wrap text around shape (rectangle), on right only.
when ARM_Output.Float_Right =>
Ada.Text_IO.Put (Output_Object.Output_File,
"\shpwr2\shpwrk1"); -- Wrap text around shape (rectangle), on left only.
when ARM_Output.Alone_Left | ARM_Output.Alone_Center |
ARM_Output.Alone_Right =>
Ada.Text_IO.Put (Output_Object.Output_File,
"\shpwr1"); -- Don't allow text alongside shape.
end case;
Ada.Text_IO.Put (Output_Object.Output_File,
"\shpfblwtxt0"); -- Text is below shape.
Ada.Text_IO.Put (Output_Object.Output_File,
"\shpz0"); -- Z-order for shape (these don't overlap, I hope).
Output_Object.Last_Shape_Id := Output_Object.Last_Shape_Id + 1;
-- These need to be unique, but the value doesn't matter much.
Ada.Text_IO.Put (Output_Object.Output_File,
"\shplid" & Format_Twips(Output_Object.Last_Shape_Id));
Ada.Text_IO.Put (Output_Object.Output_File,
"{\sp{\sn shapeType}{\sv 75}}"); -- "Picture frame" type.
Ada.Text_IO.Put_Line (Output_Object.Output_File,
"{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}"); -- No flipping.
Ada.Text_IO.Put_Line (Output_Object.Output_File,
"{\sp{\sn pib}{\sv {\pict"); -- Start the picture data
Ada.Text_IO.Put (Output_Object.Output_File,
"\picscalex" & Format_Twips(Picture_Scaling)); -- X scaling (%).
Ada.Text_IO.Put (Output_Object.Output_File,
"\picscaley" & Format_Twips(Picture_Scaling)); -- Y scaling (%).
Ada.Text_IO.Put (Output_Object.Output_File,
"\piccropl0"); -- Left crop (twips) [Should be zero].
Ada.Text_IO.Put (Output_Object.Output_File,
"\piccropr0"); -- Right crop (twips) [Should be zero].
Ada.Text_IO.Put (Output_Object.Output_File,
"\piccropt0"); -- Top crop (twips) [Should be zero].
Ada.Text_IO.Put_Line (Output_Object.Output_File,
"\piccropb0"); -- Bottom crop (twips) [Should be zero].
Ada.Text_IO.Put (Output_Object.Output_File,
"\picw" & Format_Twips(Natural(Picture_Width) * 5)); -- Raw picture width in ??? (doesn't seem to be used).
Ada.Text_IO.Put (Output_Object.Output_File,
"\pich" & Format_Twips(Natural(Picture_Height) * 5)); -- Raw picture height in ??? (doesn't seem to be used).
Ada.Text_IO.Put (Output_Object.Output_File,
"\picwgoal" & Format_Twips(Width * HORIZONTAL_TWIPS_PER_PIXEL)); -- Picture width goal in twips.
Ada.Text_IO.Put_Line (Output_Object.Output_File,
"\pichgoal" & Format_Twips(Height * VERTICAL_TWIPS_PER_PIXEL)); -- Picture height goal in twips.
-- Figure out file type, using the correct type here:
if Picture_Kind = PNG then
Ada.Text_IO.Put_Line (Output_Object.Output_File,
"\pngblip"); -- Specifies that the file is a PNG.
elsif Picture_Kind = JPEG then
Ada.Text_IO.Put_Line (Output_Object.Output_File,
"\jpegblip"); -- Specifies that the file is a JPEG.
else
null; -- We should have already bombed.
end if;
-- Should use:
-- \bliptagnnn - Picture ID.
-- \blipuid XXXX - Picture Unique ID.
-- How these are calculated is unclear (it appears to be a hash of
-- some kind). So I left these out.
Dump_File_in_Hex;
Ada.Text_IO.Put (Output_Object.Output_File,
"}}}"); -- End the picture data.
Ada.Text_IO.Put (Output_Object.Output_File,
"{\sp{\sn pibName}{\sv " & Name & "}}"); -- Picture file name
Ada.Text_IO.Put (Output_Object.Output_File,
"{\sp{\sn pibFlags}{\sv 2}}"); -- No idea, a flag of "2" is not documented.
case Border is
when ARM_Output.None =>
Ada.Text_IO.Put (Output_Object.Output_File,
"{\sp{\sn fLine}{\sv 0}}"); -- No line here.
when ARM_Output.Thin =>
-- Default lineType of 0, solid.
Ada.Text_IO.Put (Output_Object.Output_File,
"{\sp{\sn lineWidth}{\sv 9525}}"); -- Line size (single - 0.75pt).
Ada.Text_IO.Put (Output_Object.Output_File,
"{\sp{\sn fLine}{\sv 1}}"); -- Show line here.
when ARM_Output.Thick =>
Ada.Text_IO.Put (Output_Object.Output_File,
"{\sp{\sn lineWidth}{\sv 19050}}"); -- Line size (double - 1.5pt).
Ada.Text_IO.Put (Output_Object.Output_File,
"{\sp{\sn fLine}{\sv 1}}"); -- Show line here.
end case;
case Alignment is
when ARM_Output.Inline =>
Ada.Text_IO.Put (Output_Object.Output_File,
"{\sp{\sn posh}{\sv 1}}"); -- Position to the left.
Ada.Text_IO.Put (Output_Object.Output_File,
"{\sp{\sn posrelh}{\sv 3}}"); -- Position to the character.
Ada.Text_IO.Put (Output_Object.Output_File,
"{\sp{\sn posh}{\sv 2}}"); -- Position to the top.
Ada.Text_IO.Put (Output_Object.Output_File,
"{\sp{\sn posrelh}{\sv 3}}"); -- Position to the line.
when ARM_Output.Float_Left =>
Ada.Text_IO.Put (Output_Object.Output_File,
"{\sp{\sn posh}{\sv 1}}"); -- Position to the left.
Ada.Text_IO.Put (Output_Object.Output_File,
"{\sp{\sn posrelh}{\sv 2}}"); -- Position to the column.
when ARM_Output.Float_Right =>
Ada.Text_IO.Put (Output_Object.Output_File,
"{\sp{\sn posh}{\sv 3}}"); -- Position to the right.
Ada.Text_IO.Put (Output_Object.Output_File,
"{\sp{\sn posrelh}{\sv 2}}"); -- Position to the column.
when ARM_Output.Alone_Left =>
Ada.Text_IO.Put (Output_Object.Output_File,
"{\sp{\sn posh}{\sv 1}}"); -- Position to the left.
when ARM_Output.Alone_Center =>
Ada.Text_IO.Put (Output_Object.Output_File,
"{\sp{\sn posh}{\sv 2}}"); -- Position to the center.
when ARM_Output.Alone_Right =>
Ada.Text_IO.Put (Output_Object.Output_File,
"{\sp{\sn posh}{\sv 3}}"); -- Position to the right.
end case;
Ada.Text_IO.Put_Line (Output_Object.Output_File,
"{\sp{\sn fLayoutInCell}{\sv 0}}"); -- No nested use.
-- Here we find {\shprslt followed by metafile junk. Not doing that.
---- Fake Word 95 output (it shouldn't be used, but...):
--Ada.Text_IO.Put_Line (Output_Object.Output_File,
-- "{\shprslt\par\pard \ql \pvpara\posxr\dxfrtext180\dfrmtxtx180\dfrmtxty0\nowrap\adjustright\ \par}");
Ada.Text_IO.Put_Line (Output_Object.Output_File,
"}}"); -- End the shape.
Output_Object.Char_Count := 0;
-- Original code:
--
-- case Alignment is
-- when ARM_Output.Inline =>
-- null;
-- when ARM_Output.Float_Left =>
-- null; --***??
-- when ARM_Output.Float_Right =>
-- Ada.Text_IO.Put_Line ("** Unimplemented picture formatting: Float Right");
-- when ARM_Output.Alone_Left =>
-- Ada.Text_IO.Put (Output_Object.Output_File,
-- "{\pard\plain\sb" & Format_Twips(Height * VERTICAL_TWIPS_PER_PIXEL) & " ");
-- -- Set up a normal left-justified paragraph that is high enough for this picture.
-- when ARM_Output.Alone_Center =>
-- Ada.Text_IO.Put (Output_Object.Output_File,
-- "{\pard\plain\qc\sb" & Format_Twips(Height * VERTICAL_TWIPS_PER_PIXEL) & " ");
-- -- Set up a normal centered paragraph that is high enough for this picture.
-- when ARM_Output.Alone_Right =>
-- Ada.Text_IO.Put (Output_Object.Output_File,
-- "{\pard\plain\qr\sb" & Format_Twips(Height * VERTICAL_TWIPS_PER_PIXEL) & " ");
-- -- Set up a normal right-justified paragraph that is high enough for this picture.
-- end case;
--
-- -- Picture setup:
-- Ada.Text_IO.Put_Line (Output_Object.Output_File,
-- "{\*\shppict {\pict "); -- Defines a picture (Word 97 and newer).
--
-- -- Shape Properties:
-- Output_Object.Last_Shape_Id := Output_Object.Last_Shape_Id + 1;
-- -- These need to be unique, but what they are doesn't matter much.
-- Ada.Text_IO.Put (Output_Object.Output_File,
-- "{\*\picprop\shplid" & Format_Twips(Output_Object.Last_Shape_Id));
-- Ada.Text_IO.Put (Output_Object.Output_File,
-- "{\sp{\sn shapeType}{\sv 75}}"); -- "Picture frame" type.
-- Ada.Text_IO.Put_Line (Output_Object.Output_File,
-- "{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}"); -- No flipping.
-- Ada.Text_IO.Put (Output_Object.Output_File,
-- "{\sp{\sn pibName}{\sv " & Name & "}}"); -- Picture file name
-- Ada.Text_IO.Put (Output_Object.Output_File,
-- "{\sp{\sn pibFlags}{\sv 2}}"); -- No idea, a flag of "2" is not documented.
-- Ada.Text_IO.Put (Output_Object.Output_File,
-- "{\sp{\sn fLine}{\sv 0}}"); -- No line here.
-- Ada.Text_IO.Put_Line (Output_Object.Output_File,
-- "{\sp{\sn fLayoutInCell}{\sv 1}}}"); -- Allow nested use..
--
--
-- Ada.Text_IO.Put (Output_Object.Output_File,
-- "\picscalex" & Format_Twips(Picture_Scaling)); -- X scaling (%).
-- Ada.Text_IO.Put (Output_Object.Output_File,
-- "\picscaley" & Format_Twips(Picture_Scaling)); -- Y scaling (%).
-- Ada.Text_IO.Put (Output_Object.Output_File,
-- "\piccropl0"); -- Left crop (twips) [Should be zero].
-- Ada.Text_IO.Put (Output_Object.Output_File,
-- "\piccropr0"); -- Right crop (twips) [Should be zero].
-- Ada.Text_IO.Put (Output_Object.Output_File,
-- "\piccropt0"); -- Top crop (twips) [Should be zero].
-- Ada.Text_IO.Put_Line (Output_Object.Output_File,
-- "\piccropb0"); -- Bottom crop (twips) [Should be zero].
-- Ada.Text_IO.Put (Output_Object.Output_File,
-- "\picw" & Format_Twips(Width * HORIZONTAL_TWIPS_PER_PIXEL)); -- Raw picture width in twips.
-- Ada.Text_IO.Put (Output_Object.Output_File,
-- "\pich" & Format_Twips(Height * VERTICAL_TWIPS_PER_PIXEL)); -- Raw picture height in twips.
-- Ada.Text_IO.Put (Output_Object.Output_File,
-- "\picwgoal" & Format_Twips(Width * HORIZONTAL_TWIPS_PER_PIXEL)); -- Picture width goal in twips.
-- Ada.Text_IO.Put_Line (Output_Object.Output_File,
-- "\pichgoal" & Format_Twips(Height * VERTICAL_TWIPS_PER_PIXEL)); -- Picture height goal in twips.
--
-- case Border is
-- when ARM_Output.None =>
-- null;
-- when ARM_Output.Thin =>
-- Ada.Text_IO.Put (Output_Object.Output_File,
-- "\brdrs\brdrw15 "); -- Single thickness border (value is in twips).
-- when ARM_Output.Thick =>
-- Ada.Text_IO.Put (Output_Object.Output_File,
-- "\brdrs\brdrw30 "); -- Double thickness border (value is in twips).
-- end case;
--
-- -- Figure out file type, using the correct type here:
-- if Picture_Kind = PNG then
-- Ada.Text_IO.Put (Output_Object.Output_File,
-- "\pngblip "); -- Specifies that the file is a PNG.
-- elsif Picture_Kind = JPEG then
-- Ada.Text_IO.Put (Output_Object.Output_File,
-- "\jpegblip "); -- Specifies that the file is a JPEG.
-- else
-- null; -- We should have already bombed.
-- end if;
--
-- -- Should use:
-- -- \bliptagnnn - Picture ID.
-- -- \blipuid XXXX - Picture Unique ID.
-- -- How these are calculated is unclear (it appears to be a hash of
-- -- some kind). So I left these out.
--
-- Dump_File_in_Hex;
--
-- Ada.Text_IO.Put_Line (Output_Object.Output_File,
-- "}}"); -- End the picture.
-- Output_Object.Char_Count := 0;
--
-- -- This should be followed by:
-- -- {\*\nonshppict {\pict - Defines an old format picture. This has
-- -- the graphic in metafile format. I have no idea how to convert that;
-- -- forget it.
--
-- -- An easy but incredibly crappy implementation follows. But this
-- -- needs height information in a dedicated paragraph to work at all
-- -- (without it, it ends up one line high). If we have the height
-- -- information, why bother with this; just generate it correctly.
-- -- Then we can be sure that the height and width are specified.
-- --Ada.Text_IO.Put_Line (Output_Object.Output_File,
-- -- "{\field\fldedit{\*\fldinst { INCLUDEPICTURE "".\" & Name & """ \\* MERGEFORMAT \\d }}{\fldrslt {}}}");
-- --Output_Object.Char_Count := 0;
--
-- -- Close anything opened for alignment:
-- case Alignment is
-- when ARM_Output.Inline =>
-- null;
-- when ARM_Output.Float_Left =>
-- null;
-- when ARM_Output.Float_Right =>
-- null;
-- when ARM_Output.Alone_Left =>
-- Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par}");
-- when ARM_Output.Alone_Center =>
-- Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par}");
-- when ARM_Output.Alone_Right =>
-- Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par}");
-- end case;
end Picture;
-- Notes:
-- "\_" is a non-breaking hyphen.
end ARM_RTF;
|