home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / tsw / TSW_3.4.0.exe / Apache2 / perl / Canvas.pm < prev    next >
Encoding:
Perl POD Document  |  2003-12-29  |  27.8 KB  |  1,417 lines

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