mkpsenc.tcl 29 KB

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