home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / regular / ActivePerl-5.8.4.810-MSWin32-x86.msi / _6da74fb2ab882fcfc6d9ec5c2160ad5c < prev    next >
Encoding:
Text File  |  2004-06-01  |  29.6 KB  |  1,437 lines

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