1# mkpsenc.tcl -- 2# 3# Creates Postscript encoding vector for given encoding 4# 5 6proc ::tk::CreatePostscriptEncoding {encoding} { 7 # now check for known. Even if it is known, it can be other 8 # than we need. GhostScript seems to be happy with such approach 9 set result "/CurrentEncoding \[\n" 10 for {set i 0} {$i<256} {incr i 8} { 11 for {set j 0} {$j<8} {incr j} { 12 set enc [encoding convertfrom $encoding [format %c [expr {$i+$j}]]] 13 if {[catch {format %04X [scan $enc %c]} hexcode]} {set hexcode {}} 14 if [info exists ::tk::psglyphs($hexcode)] { 15 append result "/$::tk::psglyphs($hexcode)" 16 } else { 17 append result "/space" 18 } 19 } 20 append result "\n" 21 } 22 append result "\] def\n" 23 return $result 24} 25 26# List of adobe glyph names. Converted from glyphlist.txt, downloaded 27# from Adobe 28 29namespace eval ::tk { 30array set psglyphs { 31 0020 space 32 0021 exclam 33 0022 quotedbl 34 0023 numbersign 35 0024 dollar 36 0025 percent 37 0026 ampersand 38 0027 quotesingle 39 0028 parenleft 40 0029 parenright 41 002A asterisk 42 002B plus 43 002C comma 44 002D hyphen 45 002E period 46 002F slash 47 0030 zero 48 0031 one 49 0032 two 50 0033 three 51 0034 four 52 0035 five 53 0036 six 54 0037 seven 55 0038 eight 56 0039 nine 57 003A colon 58 003B semicolon 59 003C less 60 003D equal 61 003E greater 62 003F question 63 0040 at 64 0041 A 65 0042 B 66 0043 C 67 0044 D 68 0045 E 69 0046 F 70 0047 G 71 0048 H 72 0049 I 73 004A J 74 004B K 75 004C L 76 004D M 77 004E N 78 004F O 79 0050 P 80 0051 Q 81 0052 R 82 0053 S 83 0054 T 84 0055 U 85 0056 V 86 0057 W 87 0058 X 88 0059 Y 89 005A Z 90 005B bracketleft 91 005C backslash 92 005D bracketright 93 005E asciicircum 94 005F underscore 95 0060 grave 96 0061 a 97 0062 b 98 0063 c 99 0064 d 100 0065 e 101 0066 f 102 0067 g 103 0068 h 104 0069 i 105 006A j 106 006B k 107 006C l 108 006D m 109 006E n 110 006F o 111 0070 p 112 0071 q 113 0072 r 114 0073 s 115 0074 t 116 0075 u 117 0076 v 118 0077 w 119 0078 x 120 0079 y 121 007A z 122 007B braceleft 123 007C bar 124 007D braceright 125 007E asciitilde 126 00A0 space 127 00A1 exclamdown 128 00A2 cent 129 00A3 sterling 130 00A4 currency 131 00A5 yen 132 00A6 brokenbar 133 00A7 section 134 00A8 dieresis 135 00A9 copyright 136 00AA ordfeminine 137 00AB guillemotleft 138 00AC logicalnot 139 00AD hyphen 140 00AE registered 141 00AF macron 142 00B0 degree 143 00B1 plusminus 144 00B2 twosuperior 145 00B3 threesuperior 146 00B4 acute 147 00B5 mu 148 00B6 paragraph 149 00B7 periodcentered 150 00B8 cedilla 151 00B9 onesuperior 152 00BA ordmasculine 153 00BB guillemotright 154 00BC onequarter 155 00BD onehalf 156 00BE threequarters 157 00BF questiondown 158 00C0 Agrave 159 00C1 Aacute 160 00C2 Acircumflex 161 00C3 Atilde 162 00C4 Adieresis 163 00C5 Aring 164 00C6 AE 165 00C7 Ccedilla 166 00C8 Egrave 167 00C9 Eacute 168 00CA Ecircumflex 169 00CB Edieresis 170 00CC Igrave 171 00CD Iacute 172 00CE Icircumflex 173 00CF Idieresis 174 00D0 Eth 175 00D1 Ntilde 176 00D2 Ograve 177 00D3 Oacute 178 00D4 Ocircumflex 179 00D5 Otilde 180 00D6 Odieresis 181 00D7 multiply 182 00D8 Oslash 183 00D9 Ugrave 184 00DA Uacute 185 00DB Ucircumflex 186 00DC Udieresis 187 00DD Yacute 188 00DE Thorn 189 00DF germandbls 190 00E0 agrave 191 00E1 aacute 192 00E2 acircumflex 193 00E3 atilde 194 00E4 adieresis 195 00E5 aring 196 00E6 ae 197 00E7 ccedilla 198 00E8 egrave 199 00E9 eacute 200 00EA ecircumflex 201 00EB edieresis 202 00EC igrave 203 00ED iacute 204 00EE icircumflex 205 00EF idieresis 206 00F0 eth 207 00F1 ntilde 208 00F2 ograve 209 00F3 oacute 210 00F4 ocircumflex 211 00F5 otilde 212 00F6 odieresis 213 00F7 divide 214 00F8 oslash 215 00F9 ugrave 216 00FA uacute 217 00FB ucircumflex 218 00FC udieresis 219 00FD yacute 220 00FE thorn 221 00FF ydieresis 222 0100 Amacron 223 0101 amacron 224 0102 Abreve 225 0103 abreve 226 0104 Aogonek 227 0105 aogonek 228 0106 Cacute 229 0107 cacute 230 0108 Ccircumflex 231 0109 ccircumflex 232 010A Cdotaccent 233 010B cdotaccent 234 010C Ccaron 235 010D ccaron 236 010E Dcaron 237 010F dcaron 238 0110 Dcroat 239 0111 dcroat 240 0112 Emacron 241 0113 emacron 242 0114 Ebreve 243 0115 ebreve 244 0116 Edotaccent 245 0117 edotaccent 246 0118 Eogonek 247 0119 eogonek 248 011A Ecaron 249 011B ecaron 250 011C Gcircumflex 251 011D gcircumflex 252 011E Gbreve 253 011F gbreve 254 0120 Gdotaccent 255 0121 gdotaccent 256 0122 Gcommaaccent 257 0123 gcommaaccent 258 0124 Hcircumflex 259 0125 hcircumflex 260 0126 Hbar 261 0127 hbar 262 0128 Itilde 263 0129 itilde 264 012A Imacron 265 012B imacron 266 012C Ibreve 267 012D ibreve 268 012E Iogonek 269 012F iogonek 270 0130 Idotaccent 271 0131 dotlessi 272 0132 IJ 273 0133 ij 274 0134 Jcircumflex 275 0135 jcircumflex 276 0136 Kcommaaccent 277 0137 kcommaaccent 278 0138 kgreenlandic 279 0139 Lacute 280 013A lacute 281 013B Lcommaaccent 282 013C lcommaaccent 283 013D Lcaron 284 013E lcaron 285 013F Ldot 286 0140 ldot 287 0141 Lslash 288 0142 lslash 289 0143 Nacute 290 0144 nacute 291 0145 Ncommaaccent 292 0146 ncommaaccent 293 0147 Ncaron 294 0148 ncaron 295 0149 napostrophe 296 014A Eng 297 014B eng 298 014C Omacron 299 014D omacron 300 014E Obreve 301 014F obreve 302 0150 Ohungarumlaut 303 0151 ohungarumlaut 304 0152 OE 305 0153 oe 306 0154 Racute 307 0155 racute 308 0156 Rcommaaccent 309 0157 rcommaaccent 310 0158 Rcaron 311 0159 rcaron 312 015A Sacute 313 015B sacute 314 015C Scircumflex 315 015D scircumflex 316 015E Scedilla 317 015F scedilla 318 0160 Scaron 319 0161 scaron 320 0162 Tcommaaccent 321 0163 tcommaaccent 322 0164 Tcaron 323 0165 tcaron 324 0166 Tbar 325 0167 tbar 326 0168 Utilde 327 0169 utilde 328 016A Umacron 329 016B umacron 330 016C Ubreve 331 016D ubreve 332 016E Uring 333 016F uring 334 0170 Uhungarumlaut 335 0171 uhungarumlaut 336 0172 Uogonek 337 0173 uogonek 338 0174 Wcircumflex 339 0175 wcircumflex 340 0176 Ycircumflex 341 0177 ycircumflex 342 0178 Ydieresis 343 0179 Zacute 344 017A zacute 345 017B Zdotaccent 346 017C zdotaccent 347 017D Zcaron 348 017E zcaron 349 017F longs 350 0192 florin 351 01A0 Ohorn 352 01A1 ohorn 353 01AF Uhorn 354 01B0 uhorn 355 01E6 Gcaron 356 01E7 gcaron 357 01FA Aringacute 358 01FB aringacute 359 01FC AEacute 360 01FD aeacute 361 01FE Oslashacute 362 01FF oslashacute 363 0218 Scommaaccent 364 0219 scommaaccent 365 021A Tcommaaccent 366 021B tcommaaccent 367 02BC afii57929 368 02BD afii64937 369 02C6 circumflex 370 02C7 caron 371 02C9 macron 372 02D8 breve 373 02D9 dotaccent 374 02DA ring 375 02DB ogonek 376 02DC tilde 377 02DD hungarumlaut 378 0300 gravecomb 379 0301 acutecomb 380 0303 tildecomb 381 0309 hookabovecomb 382 0323 dotbelowcomb 383 0384 tonos 384 0385 dieresistonos 385 0386 Alphatonos 386 0387 anoteleia 387 0388 Epsilontonos 388 0389 Etatonos 389 038A Iotatonos 390 038C Omicrontonos 391 038E Upsilontonos 392 038F Omegatonos 393 0390 iotadieresistonos 394 0391 Alpha 395 0392 Beta 396 0393 Gamma 397 0394 Delta 398 0395 Epsilon 399 0396 Zeta 400 0397 Eta 401 0398 Theta 402 0399 Iota 403 039A Kappa 404 039B Lambda 405 039C Mu 406 039D Nu 407 039E Xi 408 039F Omicron 409 03A0 Pi 410 03A1 Rho 411 03A3 Sigma 412 03A4 Tau 413 03A5 Upsilon 414 03A6 Phi 415 03A7 Chi 416 03A8 Psi 417 03A9 Omega 418 03AA Iotadieresis 419 03AB Upsilondieresis 420 03AC alphatonos 421 03AD epsilontonos 422 03AE etatonos 423 03AF iotatonos 424 03B0 upsilondieresistonos 425 03B1 alpha 426 03B2 beta 427 03B3 gamma 428 03B4 delta 429 03B5 epsilon 430 03B6 zeta 431 03B7 eta 432 03B8 theta 433 03B9 iota 434 03BA kappa 435 03BB lambda 436 03BC mu 437 03BD nu 438 03BE xi 439 03BF omicron 440 03C0 pi 441 03C1 rho 442 03C2 sigma1 443 03C3 sigma 444 03C4 tau 445 03C5 upsilon 446 03C6 phi 447 03C7 chi 448 03C8 psi 449 03C9 omega 450 03CA iotadieresis 451 03CB upsilondieresis 452 03CC omicrontonos 453 03CD upsilontonos 454 03CE omegatonos 455 03D1 theta1 456 03D2 Upsilon1 457 03D5 phi1 458 03D6 omega1 459 0401 afii10023 460 0402 afii10051 461 0403 afii10052 462 0404 afii10053 463 0405 afii10054 464 0406 afii10055 465 0407 afii10056 466 0408 afii10057 467 0409 afii10058 468 040A afii10059 469 040B afii10060 470 040C afii10061 471 040E afii10062 472 040F afii10145 473 0410 afii10017 474 0411 afii10018 475 0412 afii10019 476 0413 afii10020 477 0414 afii10021 478 0415 afii10022 479 0416 afii10024 480 0417 afii10025 481 0418 afii10026 482 0419 afii10027 483 041A afii10028 484 041B afii10029 485 041C afii10030 486 041D afii10031 487 041E afii10032 488 041F afii10033 489 0420 afii10034 490 0421 afii10035 491 0422 afii10036 492 0423 afii10037 493 0424 afii10038 494 0425 afii10039 495 0426 afii10040 496 0427 afii10041 497 0428 afii10042 498 0429 afii10043 499 042A afii10044 500 042B afii10045 501 042C afii10046 502 042D afii10047 503 042E afii10048 504 042F afii10049 505 0430 afii10065 506 0431 afii10066 507 0432 afii10067 508 0433 afii10068 509 0434 afii10069 510 0435 afii10070 511 0436 afii10072 512 0437 afii10073 513 0438 afii10074 514 0439 afii10075 515 043A afii10076 516 043B afii10077 517 043C afii10078 518 043D afii10079 519 043E afii10080 520 043F afii10081 521 0440 afii10082 522 0441 afii10083 523 0442 afii10084 524 0443 afii10085 525 0444 afii10086 526 0445 afii10087 527 0446 afii10088 528 0447 afii10089 529 0448 afii10090 530 0449 afii10091 531 044A afii10092 532 044B afii10093 533 044C afii10094 534 044D afii10095 535 044E afii10096 536 044F afii10097 537 0451 afii10071 538 0452 afii10099 539 0453 afii10100 540 0454 afii10101 541 0455 afii10102 542 0456 afii10103 543 0457 afii10104 544 0458 afii10105 545 0459 afii10106 546 045A afii10107 547 045B afii10108 548 045C afii10109 549 045E afii10110 550 045F afii10193 551 0462 afii10146 552 0463 afii10194 553 0472 afii10147 554 0473 afii10195 555 0474 afii10148 556 0475 afii10196 557 0490 afii10050 558 0491 afii10098 559 04D9 afii10846 560 05B0 afii57799 561 05B1 afii57801 562 05B2 afii57800 563 05B3 afii57802 564 05B4 afii57793 565 05B5 afii57794 566 05B6 afii57795 567 05B7 afii57798 568 05B8 afii57797 569 05B9 afii57806 570 05BB afii57796 571 05BC afii57807 572 05BD afii57839 573 05BE afii57645 574 05BF afii57841 575 05C0 afii57842 576 05C1 afii57804 577 05C2 afii57803 578 05C3 afii57658 579 05D0 afii57664 580 05D1 afii57665 581 05D2 afii57666 582 05D3 afii57667 583 05D4 afii57668 584 05D5 afii57669 585 05D6 afii57670 586 05D7 afii57671 587 05D8 afii57672 588 05D9 afii57673 589 05DA afii57674 590 05DB afii57675 591 05DC afii57676 592 05DD afii57677 593 05DE afii57678 594 05DF afii57679 595 05E0 afii57680 596 05E1 afii57681 597 05E2 afii57682 598 05E3 afii57683 599 05E4 afii57684 600 05E5 afii57685 601 05E6 afii57686 602 05E7 afii57687 603 05E8 afii57688 604 05E9 afii57689 605 05EA afii57690 606 05F0 afii57716 607 05F1 afii57717 608 05F2 afii57718 609 060C afii57388 610 061B afii57403 611 061F afii57407 612 0621 afii57409 613 0622 afii57410 614 0623 afii57411 615 0624 afii57412 616 0625 afii57413 617 0626 afii57414 618 0627 afii57415 619 0628 afii57416 620 0629 afii57417 621 062A afii57418 622 062B afii57419 623 062C afii57420 624 062D afii57421 625 062E afii57422 626 062F afii57423 627 0630 afii57424 628 0631 afii57425 629 0632 afii57426 630 0633 afii57427 631 0634 afii57428 632 0635 afii57429 633 0636 afii57430 634 0637 afii57431 635 0638 afii57432 636 0639 afii57433 637 063A afii57434 638 0640 afii57440 639 0641 afii57441 640 0642 afii57442 641 0643 afii57443 642 0644 afii57444 643 0645 afii57445 644 0646 afii57446 645 0647 afii57470 646 0648 afii57448 647 0649 afii57449 648 064A afii57450 649 064B afii57451 650 064C afii57452 651 064D afii57453 652 064E afii57454 653 064F afii57455 654 0650 afii57456 655 0651 afii57457 656 0652 afii57458 657 0660 afii57392 658 0661 afii57393 659 0662 afii57394 660 0663 afii57395 661 0664 afii57396 662 0665 afii57397 663 0666 afii57398 664 0667 afii57399 665 0668 afii57400 666 0669 afii57401 667 066A afii57381 668 066D afii63167 669 0679 afii57511 670 067E afii57506 671 0686 afii57507 672 0688 afii57512 673 0691 afii57513 674 0698 afii57508 675 06A4 afii57505 676 06AF afii57509 677 06BA afii57514 678 06D2 afii57519 679 06D5 afii57534 680 1E80 Wgrave 681 1E81 wgrave 682 1E82 Wacute 683 1E83 wacute 684 1E84 Wdieresis 685 1E85 wdieresis 686 1EF2 Ygrave 687 1EF3 ygrave 688 200C afii61664 689 200D afii301 690 200E afii299 691 200F afii300 692 2012 figuredash 693 2013 endash 694 2014 emdash 695 2015 afii00208 696 2017 underscoredbl 697 2018 quoteleft 698 2019 quoteright 699 201A quotesinglbase 700 201B quotereversed 701 201C quotedblleft 702 201D quotedblright 703 201E quotedblbase 704 2020 dagger 705 2021 daggerdbl 706 2022 bullet 707 2024 onedotenleader 708 2025 twodotenleader 709 2026 ellipsis 710 202C afii61573 711 202D afii61574 712 202E afii61575 713 2030 perthousand 714 2032 minute 715 2033 second 716 2039 guilsinglleft 717 203A guilsinglright 718 203C exclamdbl 719 2044 fraction 720 2070 zerosuperior 721 2074 foursuperior 722 2075 fivesuperior 723 2076 sixsuperior 724 2077 sevensuperior 725 2078 eightsuperior 726 2079 ninesuperior 727 207D parenleftsuperior 728 207E parenrightsuperior 729 207F nsuperior 730 2080 zeroinferior 731 2081 oneinferior 732 2082 twoinferior 733 2083 threeinferior 734 2084 fourinferior 735 2085 fiveinferior 736 2086 sixinferior 737 2087 seveninferior 738 2088 eightinferior 739 2089 nineinferior 740 208D parenleftinferior 741 208E parenrightinferior 742 20A1 colonmonetary 743 20A3 franc 744 20A4 lira 745 20A7 peseta 746 20AA afii57636 747 20AB dong 748 20AC Euro 749 2105 afii61248 750 2111 Ifraktur 751 2113 afii61289 752 2116 afii61352 753 2118 weierstrass 754 211C Rfraktur 755 211E prescription 756 2122 trademark 757 2126 Omega 758 212E estimated 759 2135 aleph 760 2153 onethird 761 2154 twothirds 762 215B oneeighth 763 215C threeeighths 764 215D fiveeighths 765 215E seveneighths 766 2190 arrowleft 767 2191 arrowup 768 2192 arrowright 769 2193 arrowdown 770 2194 arrowboth 771 2195 arrowupdn 772 21A8 arrowupdnbse 773 21B5 carriagereturn 774 21D0 arrowdblleft 775 21D1 arrowdblup 776 21D2 arrowdblright 777 21D3 arrowdbldown 778 21D4 arrowdblboth 779 2200 universal 780 2202 partialdiff 781 2203 existential 782 2205 emptyset 783 2206 Delta 784 2207 gradient 785 2208 element 786 2209 notelement 787 220B suchthat 788 220F product 789 2211 summation 790 2212 minus 791 2215 fraction 792 2217 asteriskmath 793 2219 periodcentered 794 221A radical 795 221D proportional 796 221E infinity 797 221F orthogonal 798 2220 angle 799 2227 logicaland 800 2228 logicalor 801 2229 intersection 802 222A union 803 222B integral 804 2234 therefore 805 223C similar 806 2245 congruent 807 2248 approxequal 808 2260 notequal 809 2261 equivalence 810 2264 lessequal 811 2265 greaterequal 812 2282 propersubset 813 2283 propersuperset 814 2284 notsubset 815 2286 reflexsubset 816 2287 reflexsuperset 817 2295 circleplus 818 2297 circlemultiply 819 22A5 perpendicular 820 22C5 dotmath 821 2302 house 822 2310 revlogicalnot 823 2320 integraltp 824 2321 integralbt 825 2329 angleleft 826 232A angleright 827 2500 SF100000 828 2502 SF110000 829 250C SF010000 830 2510 SF030000 831 2514 SF020000 832 2518 SF040000 833 251C SF080000 834 2524 SF090000 835 252C SF060000 836 2534 SF070000 837 253C SF050000 838 2550 SF430000 839 2551 SF240000 840 2552 SF510000 841 2553 SF520000 842 2554 SF390000 843 2555 SF220000 844 2556 SF210000 845 2557 SF250000 846 2558 SF500000 847 2559 SF490000 848 255A SF380000 849 255B SF280000 850 255C SF270000 851 255D SF260000 852 255E SF360000 853 255F SF370000 854 2560 SF420000 855 2561 SF190000 856 2562 SF200000 857 2563 SF230000 858 2564 SF470000 859 2565 SF480000 860 2566 SF410000 861 2567 SF450000 862 2568 SF460000 863 2569 SF400000 864 256A SF540000 865 256B SF530000 866 256C SF440000 867 2580 upblock 868 2584 dnblock 869 2588 block 870 258C lfblock 871 2590 rtblock 872 2591 ltshade 873 2592 shade 874 2593 dkshade 875 25A0 filledbox 876 25A1 H22073 877 25AA H18543 878 25AB H18551 879 25AC filledrect 880 25B2 triagup 881 25BA triagrt 882 25BC triagdn 883 25C4 triaglf 884 25CA lozenge 885 25CB circle 886 25CF H18533 887 25D8 invbullet 888 25D9 invcircle 889 25E6 openbullet 890 263A smileface 891 263B invsmileface 892 263C sun 893 2640 female 894 2642 male 895 2660 spade 896 2663 club 897 2665 heart 898 2666 diamond 899 266A musicalnote 900 266B musicalnotedbl 901 F6BE dotlessj 902 F6BF LL 903 F6C0 ll 904 F6C1 Scedilla 905 F6C2 scedilla 906 F6C3 commaaccent 907 F6C4 afii10063 908 F6C5 afii10064 909 F6C6 afii10192 910 F6C7 afii10831 911 F6C8 afii10832 912 F6C9 Acute 913 F6CA Caron 914 F6CB Dieresis 915 F6CC DieresisAcute 916 F6CD DieresisGrave 917 F6CE Grave 918 F6CF Hungarumlaut 919 F6D0 Macron 920 F6D1 cyrBreve 921 F6D2 cyrFlex 922 F6D3 dblGrave 923 F6D4 cyrbreve 924 F6D5 cyrflex 925 F6D6 dblgrave 926 F6D7 dieresisacute 927 F6D8 dieresisgrave 928 F6D9 copyrightserif 929 F6DA registerserif 930 F6DB trademarkserif 931 F6DC onefitted 932 F6DD rupiah 933 F6DE threequartersemdash 934 F6DF centinferior 935 F6E0 centsuperior 936 F6E1 commainferior 937 F6E2 commasuperior 938 F6E3 dollarinferior 939 F6E4 dollarsuperior 940 F6E5 hypheninferior 941 F6E6 hyphensuperior 942 F6E7 periodinferior 943 F6E8 periodsuperior 944 F6E9 asuperior 945 F6EA bsuperior 946 F6EB dsuperior 947 F6EC esuperior 948 F6ED isuperior 949 F6EE lsuperior 950 F6EF msuperior 951 F6F0 osuperior 952 F6F1 rsuperior 953 F6F2 ssuperior 954 F6F3 tsuperior 955 F6F4 Brevesmall 956 F6F5 Caronsmall 957 F6F6 Circumflexsmall 958 F6F7 Dotaccentsmall 959 F6F8 Hungarumlautsmall 960 F6F9 Lslashsmall 961 F6FA OEsmall 962 F6FB Ogoneksmall 963 F6FC Ringsmall 964 F6FD Scaronsmall 965 F6FE Tildesmall 966 F6FF Zcaronsmall 967 F721 exclamsmall 968 F724 dollaroldstyle 969 F726 ampersandsmall 970 F730 zerooldstyle 971 F731 oneoldstyle 972 F732 twooldstyle 973 F733 threeoldstyle 974 F734 fouroldstyle 975 F735 fiveoldstyle 976 F736 sixoldstyle 977 F737 sevenoldstyle 978 F738 eightoldstyle 979 F739 nineoldstyle 980 F73F questionsmall 981 F760 Gravesmall 982 F761 Asmall 983 F762 Bsmall 984 F763 Csmall 985 F764 Dsmall 986 F765 Esmall 987 F766 Fsmall 988 F767 Gsmall 989 F768 Hsmall 990 F769 Ismall 991 F76A Jsmall 992 F76B Ksmall 993 F76C Lsmall 994 F76D Msmall 995 F76E Nsmall 996 F76F Osmall 997 F770 Psmall 998 F771 Qsmall 999 F772 Rsmall 1000 F773 Ssmall 1001 F774 Tsmall 1002 F775 Usmall 1003 F776 Vsmall 1004 F777 Wsmall 1005 F778 Xsmall 1006 F779 Ysmall 1007 F77A Zsmall 1008 F7A1 exclamdownsmall 1009 F7A2 centoldstyle 1010 F7A8 Dieresissmall 1011 F7AF Macronsmall 1012 F7B4 Acutesmall 1013 F7B8 Cedillasmall 1014 F7BF questiondownsmall 1015 F7E0 Agravesmall 1016 F7E1 Aacutesmall 1017 F7E2 Acircumflexsmall 1018 F7E3 Atildesmall 1019 F7E4 Adieresissmall 1020 F7E5 Aringsmall 1021 F7E6 AEsmall 1022 F7E7 Ccedillasmall 1023 F7E8 Egravesmall 1024 F7E9 Eacutesmall 1025 F7EA Ecircumflexsmall 1026 F7EB Edieresissmall 1027 F7EC Igravesmall 1028 F7ED Iacutesmall 1029 F7EE Icircumflexsmall 1030 F7EF Idieresissmall 1031 F7F0 Ethsmall 1032 F7F1 Ntildesmall 1033 F7F2 Ogravesmall 1034 F7F3 Oacutesmall 1035 F7F4 Ocircumflexsmall 1036 F7F5 Otildesmall 1037 F7F6 Odieresissmall 1038 F7F8 Oslashsmall 1039 F7F9 Ugravesmall 1040 F7FA Uacutesmall 1041 F7FB Ucircumflexsmall 1042 F7FC Udieresissmall 1043 F7FD Yacutesmall 1044 F7FE Thornsmall 1045 F7FF Ydieresissmall 1046 F8E5 radicalex 1047 F8E6 arrowvertex 1048 F8E7 arrowhorizex 1049 F8E8 registersans 1050 F8E9 copyrightsans 1051 F8EA trademarksans 1052 F8EB parenlefttp 1053 F8EC parenleftex 1054 F8ED parenleftbt 1055 F8EE bracketlefttp 1056 F8EF bracketleftex 1057 F8F0 bracketleftbt 1058 F8F1 bracelefttp 1059 F8F2 braceleftmid 1060 F8F3 braceleftbt 1061 F8F4 braceex 1062 F8F5 integralex 1063 F8F6 parenrighttp 1064 F8F7 parenrightex 1065 F8F8 parenrightbt 1066 F8F9 bracketrighttp 1067 F8FA bracketrightex 1068 F8FB bracketrightbt 1069 F8FC bracerighttp 1070 F8FD bracerightmid 1071 F8FE bracerightbt 1072 FB00 ff 1073 FB01 fi 1074 FB02 fl 1075 FB03 ffi 1076 FB04 ffl 1077 FB1F afii57705 1078 FB2A afii57694 1079 FB2B afii57695 1080 FB35 afii57723 1081 FB4B afii57700 1082} 1083 1084# precalculate entire prolog when this file is loaded 1085# (to speed things up) 1086set ps_preamable "%%BeginProlog\n" 1087append ps_preamable [CreatePostscriptEncoding [encoding system]] 1088append ps_preamable { 108950 dict begin 1090% This is a standard prolog for Postscript generated by Tk's canvas 1091% widget. 1092% RCS: @(#) $Id$ 1093 1094% The definitions below just define all of the variables used in 1095% any of the procedures here. This is needed for obscure reasons 1096% explained on p. 716 of the Postscript manual (Section H.2.7, 1097% "Initializing Variables," in the section on Encapsulated Postscript). 1098 1099/baseline 0 def 1100/stipimage 0 def 1101/height 0 def 1102/justify 0 def 1103/lineLength 0 def 1104/spacing 0 def 1105/stipple 0 def 1106/strings 0 def 1107/xoffset 0 def 1108/yoffset 0 def 1109/tmpstip null def 1110 1111 1112/cstringshow { 1113 { 1114 dup type /stringtype eq 1115 { show } { glyphshow } 1116 ifelse 1117 } 1118 forall 1119} bind def 1120 1121 1122 1123/cstringwidth { 1124 0 exch 0 exch 1125 { 1126 dup type /stringtype eq 1127 { stringwidth } { 1128 currentfont /Encoding get exch 1 exch put (\001) stringwidth 1129 } 1130 ifelse 1131 exch 3 1 roll add 3 1 roll add exch 1132 } 1133 forall 1134} bind def 1135 1136% font ISOEncode font 1137% This procedure changes the encoding of a font from the default 1138% Postscript encoding to current system encoding. It's typically invoked just 1139% before invoking "setfont". The body of this procedure comes from 1140% Section 5.6.1 of the Postscript book. 1141 1142/ISOEncode { 1143 dup length dict begin 1144 {1 index /FID ne {def} {pop pop} ifelse} forall 1145 /Encoding CurrentEncoding def 1146 currentdict 1147 end 1148 1149 % I'm not sure why it's necessary to use "definefont" on this new 1150 % font, but it seems to be important; just use the name "Temporary" 1151 % for the font. 1152 1153 /Temporary exch definefont 1154} bind def 1155 1156% StrokeClip 1157% 1158% This procedure converts the current path into a clip area under 1159% the assumption of stroking. It's a bit tricky because some Postscript 1160% interpreters get errors during strokepath for dashed lines. If 1161% this happens then turn off dashes and try again. 1162 1163/StrokeClip { 1164 {strokepath} stopped { 1165 (This Postscript printer gets limitcheck overflows when) = 1166 (stippling dashed lines; lines will be printed solid instead.) = 1167 [] 0 setdash strokepath} if 1168 clip 1169} bind def 1170 1171% desiredSize EvenPixels closestSize 1172% 1173% The procedure below is used for stippling. Given the optimal size 1174% of a dot in a stipple pattern in the current user coordinate system, 1175% compute the closest size that is an exact multiple of the device's 1176% pixel size. This allows stipple patterns to be displayed without 1177% aliasing effects. 1178 1179/EvenPixels { 1180 % Compute exact number of device pixels per stipple dot. 1181 dup 0 matrix currentmatrix dtransform 1182 dup mul exch dup mul add sqrt 1183 1184 % Round to an integer, make sure the number is at least 1, and compute 1185 % user coord distance corresponding to this. 1186 dup round dup 1 lt {pop 1} if 1187 exch div mul 1188} bind def 1189 1190% width height string StippleFill -- 1191% 1192% Given a path already set up and a clipping region generated from 1193% it, this procedure will fill the clipping region with a stipple 1194% pattern. "String" contains a proper image description of the 1195% stipple pattern and "width" and "height" give its dimensions. Each 1196% stipple dot is assumed to be about one unit across in the current 1197% user coordinate system. This procedure trashes the graphics state. 1198 1199/StippleFill { 1200 % The following code is needed to work around a NeWSprint bug. 1201 1202 /tmpstip 1 index def 1203 1204 % Change the scaling so that one user unit in user coordinates 1205 % corresponds to the size of one stipple dot. 1206 1 EvenPixels dup scale 1207 1208 % Compute the bounding box occupied by the path (which is now 1209 % the clipping region), and round the lower coordinates down 1210 % to the nearest starting point for the stipple pattern. Be 1211 % careful about negative numbers, since the rounding works 1212 % differently on them. 1213 1214 pathbbox 1215 4 2 roll 1216 5 index div dup 0 lt {1 sub} if cvi 5 index mul 4 1 roll 1217 6 index div dup 0 lt {1 sub} if cvi 6 index mul 3 2 roll 1218 1219 % Stack now: width height string y1 y2 x1 x2 1220 % Below is a doubly-nested for loop to iterate across this area 1221 % in units of the stipple pattern size, going up columns then 1222 % across rows, blasting out a stipple-pattern-sized rectangle at 1223 % each position 1224 1225 6 index exch { 1226 2 index 5 index 3 index { 1227 % Stack now: width height string y1 y2 x y 1228 1229 gsave 1230 1 index exch translate 1231 5 index 5 index true matrix tmpstip imagemask 1232 grestore 1233 } for 1234 pop 1235 } for 1236 pop pop pop pop pop 1237} bind def 1238 1239% -- AdjustColor -- 1240% Given a color value already set for output by the caller, adjusts 1241% that value to a grayscale or mono value if requested by the CL 1242% variable. 1243 1244/AdjustColor { 1245 CL 2 lt { 1246 currentgray 1247 CL 0 eq { 1248 .5 lt {0} {1} ifelse 1249 } if 1250 setgray 1251 } if 1252} bind def 1253 1254% x y strings spacing xoffset yoffset justify stipple DrawText -- 1255% This procedure does all of the real work of drawing text. The 1256% color and font must already have been set by the caller, and the 1257% following arguments must be on the stack: 1258% 1259% x, y - Coordinates at which to draw text. 1260% strings - An array of strings, one for each line of the text item, 1261% in order from top to bottom. 1262% spacing - Spacing between lines. 1263% xoffset - Horizontal offset for text bbox relative to x and y: 0 for 1264% nw/w/sw anchor, -0.5 for n/center/s, and -1.0 for ne/e/se. 1265% yoffset - Vertical offset for text bbox relative to x and y: 0 for 1266% nw/n/ne anchor, +0.5 for w/center/e, and +1.0 for sw/s/se. 1267% justify - 0 for left justification, 0.5 for center, 1 for right justify. 1268% stipple - Boolean value indicating whether or not text is to be 1269% drawn in stippled fashion. If text is stippled, 1270% procedure StippleText must have been defined to call 1271% StippleFill in the right way. 1272% 1273% Also, when this procedure is invoked, the color and font must already 1274% have been set for the text. 1275 1276/DrawText { 1277 /stipple exch def 1278 /justify exch def 1279 /yoffset exch def 1280 /xoffset exch def 1281 /spacing exch def 1282 /strings exch def 1283 1284 % First scan through all of the text to find the widest line. 1285 1286 /lineLength 0 def 1287 strings { 1288 cstringwidth pop 1289 dup lineLength gt {/lineLength exch def} {pop} ifelse 1290 newpath 1291 } forall 1292 1293 % Compute the baseline offset and the actual font height. 1294 1295 0 0 moveto (TXygqPZ) false charpath 1296 pathbbox dup /baseline exch def 1297 exch pop exch sub /height exch def pop 1298 newpath 1299 1300 % Translate coordinates first so that the origin is at the upper-left 1301 % corner of the text's bounding box. Remember that x and y for 1302 % positioning are still on the stack. 1303 1304 translate 1305 lineLength xoffset mul 1306 strings length 1 sub spacing mul height add yoffset mul translate 1307 1308 % Now use the baseline and justification information to translate so 1309 % that the origin is at the baseline and positioning point for the 1310 % first line of text. 1311 1312 justify lineLength mul baseline neg translate 1313 1314 % Iterate over each of the lines to output it. For each line, 1315 % compute its width again so it can be properly justified, then 1316 % display it. 1317 1318 strings { 1319 dup cstringwidth pop 1320 justify neg mul 0 moveto 1321 stipple { 1322 1323 1324 % The text is stippled, so turn it into a path and print 1325 % by calling StippledText, which in turn calls StippleFill. 1326 % Unfortunately, many Postscript interpreters will get 1327 % overflow errors if we try to do the whole string at 1328 % once, so do it a character at a time. 1329 1330 gsave 1331 /char (X) def 1332 { 1333 dup type /stringtype eq { 1334 % This segment is a string. 1335 { 1336 char 0 3 -1 roll put 1337 currentpoint 1338 gsave 1339 char true charpath clip StippleText 1340 grestore 1341 char stringwidth translate 1342 moveto 1343 } forall 1344 } { 1345 % This segment is glyph name 1346 % Temporary override 1347 currentfont /Encoding get exch 1 exch put 1348 currentpoint 1349 gsave (\001) true charpath clip StippleText 1350 grestore 1351 (\001) stringwidth translate 1352 moveto 1353 } ifelse 1354 } forall 1355 grestore 1356 } {cstringshow} ifelse 1357 0 spacing neg translate 1358 } forall 1359} bind def 1360 1361%%EndProlog 1362} 1363 1364} 1365 1366proc tk::ensure_psenc_is_loaded {} { 1367} 1368