home *** CD-ROM | disk | FTP | other *** search
/ World of Graphics / WOGRAPH.BIN / 378.EVP_PS.PS < prev    next >
Text File  |  1993-05-13  |  27KB  |  1,000 lines

  1. %%DocumentFonts: (atend)
  2. %%Creator: EnVision Publisher
  3. %%EndComments
  4.  
  5. % Copyright (C) 1989-92 M. K. Fleming. All Rights Reserved.
  6. % Portions Copyright (c) 1992 Software Vision Corporation. All Rights Reserved.
  7.  
  8. % -------------------------- VARIABLE LIST --------------------------------
  9. %
  10. % PERMANENT DEFINITIONS:
  11. % StdLine                         1-unit line width in decipoints
  12. % MonoColors                      Color definitions for 'mono' option
  13. % GrayColors                      Color definitions for 'gray' option
  14. % ColorColors                     Color definitions for 'color' option
  15. % ColorOptions                    Indexable lookup table of color choices
  16. % ColorMode                       0=mono,1=gray,2=color
  17. %
  18. %
  19. % CURRENT STATUS INFO:
  20. % CurFont                         current font
  21. % TxtDir                          text direction (0=horizontal, 1=vertical)
  22. % TxtHt                           text height
  23. % FillColor                       filling color
  24. % DrawColor                       drawing color
  25. % FillStyle                       fill pattern id
  26. % LineWidth                       line width (as multiple of StdLine)
  27. % LineStyle                       line pattern
  28. % ColorTable                      color array (set to Mono, Gray, or Color)
  29. % UserPat                         user-defined fill pattern
  30. % ptm                             pattern matrix
  31. %
  32. %
  33. % TEMPORARY, WORKING VALUES:
  34. % x1,y1,x2,y2                     rectangle coordinates
  35. % top,dep,ydep,h,w                3-D bar values
  36. % px1,py1,py2,pw,PatChar          pattern fill data
  37. % savematrix                      temporary storage
  38. %
  39. % -------------------------------------------------------------------------
  40.  
  41. /GrafDrivDict 100 dict def
  42. /ReEncodeDict 12 dict def
  43. GrafDrivDict begin
  44.  
  45. % ---------------------- PERMANENT DEFINITIONS ----------------------------
  46. /StdLine 1 def     % Normal line width, in decipoints
  47. /Thick   8 def     % Thick line width, as multiple of StdLine
  48.  
  49. /GrayColors
  50. [
  51.   0.00
  52.   0.025
  53.   0.05
  54.   0.1
  55.   0.15
  56.   0.2 
  57.   0.25
  58.   0.3
  59.   0.4
  60.   0.5
  61.   0.6
  62.   0.7
  63.   0.75
  64.   0.80
  65.   0.9
  66.   1.00 
  67. ] def
  68.  
  69. /MonoColors
  70. [ 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ] def
  71.  
  72. /ColorColors
  73. [
  74.   [1 1 1]                         % white
  75.   [0 0 1]                         % blue
  76.   [0 1 0]                         % green
  77.   [0 1 1]                         % cyan
  78.   [1 0 0]                         % red
  79.   [1 0 1]                         % magenta
  80.   [0.67  0.33  0]                 % brown
  81.   [0.75 0.75 0.75]                % lightgray
  82.   [0.2 0.2 0.2]                   % darkgray
  83.   [0.33 0.33 1]                   % lightblue
  84.   [0.33  1 0.33]                  % lightgreen
  85.   [0.33 1 1]                      % lightcyan
  86.   [1 0.33  0.33]                  % lightred
  87.   [1 0.33  1]                     % lightmagenta
  88.   [1 1 0.33]                      % yellow
  89.   [0 0 0]                         % black
  90. ] def
  91.  
  92. /Color256
  93. [
  94.  [ 1    1    1    ]     % background color-- should be white=1,1,1
  95.  [ 0.07 0.07 0.07 ]
  96.  [ 0.14 0.14 0.14 ]
  97.  [ 0.21 0.21 0.21 ]
  98.  [ 0.28 0.28 0.28 ]
  99.  [ 0.35 0.35 0.35 ]
  100.  [ 0.42 0.42 0.42 ]
  101.  [ 0.50 0.50 0.50 ]
  102.  [ 0.57 0.57 0.57 ]
  103.  [ 0.64 0.64 0.64 ]
  104.  [ 0.71 0.71 0.71 ]
  105.  [ 0.78 0.78 0.78 ]
  106.  [ 0.85 0.85 0.85 ]
  107.  [ 0.93 0.93 0.93 ]
  108.  [ 1    1    1    ]
  109.  [ 0.12 0    0    ]
  110.  [ 0.25 0    0    ]
  111.  [ 0.37 0    0    ]
  112.  [ 0.50 0    0    ]
  113.  [ 0.62 0    0    ]
  114.  [ 0.75 0    0    ]
  115.  [ 0.87 0    0    ]
  116.  [ 1    0    0    ]
  117.  [ 1    0.12 0.12 ]
  118.  [ 1    0.25 0.25 ]
  119.  [ 1    0.37 0.37 ]
  120.  [ 1    0.50 0.50 ]
  121.  [ 1    0.62 0.62 ]
  122.  [ 1    0.75 0.75 ]
  123.  [ 1    0.87 0.87 ]
  124.  [ 0.12 0.04 0    ]
  125.  [ 0.25 0.08 0    ]
  126.  [ 0.37 0.12 0    ]
  127.  [ 0.50 0.16 0    ]
  128.  [ 0.62 0.20 0    ]
  129.  [ 0.75 0.24 0    ]
  130.  [ 0.87 0.29 0    ]
  131.  [ 1    0.33 0    ]
  132.  [ 1    0.41 0.12 ]
  133.  [ 1    0.49 0.25 ]
  134.  [ 1    0.58 0.37 ]
  135.  [ 1    0.66 0.50 ]
  136.  [ 1    0.75 0.62 ]
  137.  [ 1    0.83 0.75 ]
  138.  [ 1    0.91 0.87 ]
  139.  [ 0.12 0.08 0    ]
  140.  [ 0.25 0.16 0    ]
  141.  [ 0.37 0.25 0    ]
  142.  [ 0.50 0.33 0    ]
  143.  [ 0.62 0.42 0    ]
  144.  [ 0.75 0.50 0    ]
  145.  [ 0.87 0.58 0    ]
  146.  [ 1    0.67 0    ]
  147.  [ 1    0.71 0.12 ]
  148.  [ 1    0.75 0.25 ]
  149.  [ 1    0.79 0.37 ]
  150.  [ 1    0.83 0.50 ]
  151.  [ 1    0.87 0.62 ]
  152.  [ 1    0.91 0.75 ]
  153.  [ 1    0.95 0.87 ]
  154.  [ 0.12 0.12 0    ]
  155.  [ 0.25 0.25 0    ]
  156.  [ 0.37 0.37 0    ]
  157.  [ 0.50 0.50 0    ]
  158.  [ 0.62 0.62 0    ]
  159.  [ 0.75 0.75 0    ]
  160.  [ 0.87 0.87 0    ]
  161.  [ 1    1    0    ]
  162.  [ 1    1    0.12 ]
  163.  [ 1    1    0.25 ]
  164.  [ 1    1    0.37 ]
  165.  [ 1    1    0.50 ]
  166.  [ 1    1    0.62 ]
  167.  [ 1    1    0.75 ]
  168.  [ 1    1    0.87 ]
  169.  [ 0.08 0.12 0    ]
  170.  [ 0.16 0.25 0    ]
  171.  [ 0.25 0.37 0    ]
  172.  [ 0.33 0.50 0    ]
  173.  [ 0.42 0.62 0    ]
  174.  [ 0.50 0.75 0    ]
  175.  [ 0.58 0.87 0    ]
  176.  [ 0.67 1    0    ]
  177.  [ 0.71 1    0.12 ]
  178.  [ 0.75 1    0.25 ]
  179.  [ 0.79 1    0.37 ]
  180.  [ 0.83 1    0.50 ]
  181.  [ 0.87 1    0.62 ]
  182.  [ 0.91 1    0.75 ]
  183.  [ 0.95 1    0.87 ]
  184.  [ 0.04 0.12 0    ]
  185.  [ 0.08 0.25 0    ]
  186.  [ 0.12 0.37 0    ]
  187.  [ 0.16 0.50 0    ]
  188.  [ 0.20 0.62 0    ]
  189.  [ 0.24 0.75 0    ]
  190.  [ 0.29 0.87 0    ]
  191.  [ 0.33 1    0    ]
  192.  [ 0.41 1    0.12 ]
  193.  [ 0.49 1    0.25 ]
  194.  [ 0.58 1    0.37 ]
  195.  [ 0.66 1    0.50 ]
  196.  [ 0.75 1    0.62 ]
  197.  [ 0.83 1    0.75 ]
  198.  [ 0.91 1    0.87 ]
  199.  [ 0    0.12 0    ]
  200.  [ 0    0.25 0    ]
  201.  [ 0    0.37 0    ]
  202.  [ 0    0.50 0    ]
  203.  [ 0    0.62 0    ]
  204.  [ 0    0.75 0    ]
  205.  [ 0    0.87 0    ]
  206.  [ 0    1    0    ]
  207.  [ 0.12 1    0.12 ]
  208.  [ 0.25 1    0.25 ]
  209.  [ 0.37 1    0.37 ]
  210.  [ 0.50 1    0.50 ]
  211.  [ 0.62 1    0.62 ]
  212.  [ 0.75 1    0.75 ]
  213.  [ 0.87 1    0.87 ]
  214.  [ 0    0.12 0.04 ]
  215.  [ 0    0.25 0.08 ]
  216.  [ 0    0.37 0.12 ]
  217.  [ 0    0.50 0.16 ]
  218.  [ 0    0.62 0.20 ]
  219.  [ 0    0.75 0.24 ]
  220.  [ 0    0.87 0.29 ]
  221.  [ 0    1    0.33 ]
  222.  [ 0.12 1    0.41 ]
  223.  [ 0.25 1    0.49 ]
  224.  [ 0.37 1    0.58 ]
  225.  [ 0.50 1    0.66 ]
  226.  [ 0.62 1    0.75 ]
  227.  [ 0.75 1    0.83 ]
  228.  [ 0.87 1    0.91 ]
  229.  [ 0    0.12 0.08 ]
  230.  [ 0    0.25 0.16 ]
  231.  [ 0    0.37 0.25 ]
  232.  [ 0    0.50 0.33 ]
  233.  [ 0    0.62 0.42 ]
  234.  [ 0    0.75 0.50 ]
  235.  [ 0    0.87 0.58 ]
  236.  [ 0    1    0.67 ]
  237.  [ 0.12 1    0.71 ]
  238.  [ 0.25 1    0.75 ]
  239.  [ 0.37 1    0.79 ]
  240.  [ 0.50 1    0.83 ]
  241.  [ 0.62 1    0.87 ]
  242.  [ 0.75 1    0.91 ]
  243.  [ 0.87 1    0.95 ]
  244.  [ 0    0.12 0.12 ]
  245.  [ 0    0.25 0.25 ]
  246.  [ 0    0.37 0.37 ]
  247.  [ 0    0.50 0.50 ]
  248.  [ 0    0.62 0.62 ]
  249.  [ 0    0.75 0.75 ]
  250.  [ 0    0.87 0.87 ]
  251.  [ 0    1    1    ]
  252.  [ 0.12 1    1    ]
  253.  [ 0.25 1    1    ]
  254.  [ 0.37 1    1    ]
  255.  [ 0.50 1    1    ]
  256.  [ 0.62 1    1    ]
  257.  [ 0.75 1    1    ]
  258.  [ 0.87 1    1    ]
  259.  [ 0    0.08 0.12 ]
  260.  [ 0    0.16 0.25 ]
  261.  [ 0    0.25 0.37 ]
  262.  [ 0    0.33 0.50 ]
  263.  [ 0    0.42 0.62 ]
  264.  [ 0    0.50 0.75 ]
  265.  [ 0    0.58 0.87 ]
  266.  [ 0    0.67 1    ]
  267.  [ 0.12 0.71 1    ]
  268.  [ 0.25 0.75 1    ]
  269.  [ 0.37 0.79 1    ]
  270.  [ 0.50 0.83 1    ]
  271.  [ 0.62 0.87 1    ]
  272.  [ 0.75 0.91 1    ]
  273.  [ 0.87 0.95 1    ]
  274.  [ 0    0.04 0.12 ]
  275.  [ 0    0.08 0.25 ]
  276.  [ 0    0.12 0.37 ]
  277.  [ 0    0.16 0.50 ]
  278.  [ 0    0.20 0.62 ]
  279.  [ 0    0.24 0.75 ]
  280.  [ 0    0.29 0.87 ]
  281.  [ 0    0.33 1    ]
  282.  [ 0.12 0.41 1    ]
  283.  [ 0.25 0.49 1    ]
  284.  [ 0.37 0.58 1    ]
  285.  [ 0.50 0.66 1    ]
  286.  [ 0.62 0.75 1    ]
  287.  [ 0.75 0.83 1    ]
  288.  [ 0.87 0.91 1    ]
  289.  [ 0    0    0.12 ]
  290.  [ 0    0    0.25 ]
  291.  [ 0    0    0.37 ]
  292.  [ 0    0    0.50 ]
  293.  [ 0    0    0.62 ]
  294.  [ 0    0    0.75 ]
  295.  [ 0    0    0.87 ]
  296.  [ 0    0    1    ]
  297.  [ 0.12 0.12 1    ]
  298.  [ 0.25 0.25 1    ]
  299.  [ 0.37 0.37 1    ]
  300.  [ 0.50 0.50 1    ]
  301.  [ 0.62 0.62 1    ]
  302.  [ 0.75 0.75 1    ]
  303.  [ 0.87 0.87 1    ]
  304.  [ 0.06 0    0.12 ]
  305.  [ 0.12 0    0.25 ]
  306.  [ 0.18 0    0.37 ]
  307.  [ 0.25 0    0.50 ]
  308.  [ 0.31 0    0.62 ]
  309.  [ 0.37 0    0.75 ]
  310.  [ 0.44 0    0.87 ]
  311.  [ 0.50 0    1    ]
  312.  [ 0.56 0.12 1    ]
  313.  [ 0.62 0.25 1    ]
  314.  [ 0.68 0.37 1    ]
  315.  [ 0.75 0.50 1    ]
  316.  [ 0.81 0.62 1    ]
  317.  [ 0.87 0.75 1    ]
  318.  [ 0.93 0.87 1    ]
  319.  [ 0.12 0    0.12 ]
  320.  [ 0.25 0    0.25 ]
  321.  [ 0.37 0    0.37 ]
  322.  [ 0.50 0    0.50 ]
  323.  [ 0.62 0    0.62 ]
  324.  [ 0.75 0    0.75 ]
  325.  [ 0.87 0    0.87 ]
  326.  [ 1    0    1    ]
  327.  [ 1    0.12 1    ]
  328.  [ 1    0.25 1    ]
  329.  [ 1    0.37 1    ]
  330.  [ 1    0.50 1    ]
  331.  [ 1    0.62 1    ]
  332.  [ 1    0.75 1    ]
  333.  [ 1    0.87 1    ]
  334.  [ 0.12 0    0.06 ]
  335.  [ 0.25 0    0.12 ]
  336.  [ 0.37 0    0.18 ]
  337.  [ 0.50 0    0.25 ]
  338.  [ 0.62 0    0.31 ]
  339.  [ 0.75 0    0.37 ]
  340.  [ 0.87 0    0.44 ]
  341.  [ 1    0    0.50 ]
  342.  [ 1    0.12 0.56 ]
  343.  [ 1    0.25 0.62 ]
  344.  [ 1    0.37 0.68 ]
  345.  [ 1    0.50 0.75 ]
  346.  [ 1    0.62 0.81 ]
  347.  [ 1    0.75 0.87 ]
  348.  [ 1    0.87 0.93 ]
  349.  [ 0    0    0    ]     % default color--should be black=0,0,0
  350. ] def
  351.  
  352. /ColorOptions
  353. [ MonoColors GrayColors ColorColors Color256] def
  354.  
  355. /CharSet
  356. [
  357.     10#128   /Ccedilla
  358.     10#129   /udieresis
  359.     10#130   /eacute
  360.     10#131   /acircumflex
  361.     10#132   /adieresis
  362.     10#133   /agrave
  363.     10#134   /aring
  364.     10#135   /ccedilla
  365.     10#136   /ecircumflex
  366.     10#137   /edieresis
  367.     10#138   /egrave
  368.     10#139   /idieresis
  369.     10#140   /icircumflex
  370.     10#141   /igrave
  371.     10#142   /Adieresis
  372.     10#143   /Aring
  373.     10#144   /Eacute
  374.     10#145   /ae
  375.     10#146   /AE
  376.     10#147   /ocircumflex
  377.     10#148   /odieresis
  378.     10#149   /ograve
  379.     10#150   /ucircumflex
  380.     10#151   /ugrave
  381.     10#152   /ydieresis
  382.     10#153   /Odieresis
  383.     10#154   /Udieresis
  384.     10#155   /cent
  385.     10#156   /sterling
  386.     10#157   /yen
  387.     10#158   /P
  388.     10#159   /florin
  389.     10#160   /aacute
  390.     10#161   /iacute
  391.     10#162   /oacute
  392.     10#163   /uacute
  393.     10#164   /ntilde
  394.     10#165   /Ntilde
  395.     10#166   /ordfeminine
  396.     10#167   /ordmasculine
  397.     10#168   /questiondown
  398. ] def
  399.  
  400. % --------------------------------------------------------------------
  401. % OldName NewName AF      Encode font OldName to NewName
  402. % --------------------------------------------------------------------
  403. /AF
  404. {
  405. ReEncodeDict begin
  406.     /NewName exch def  /OldName exch def
  407.     FontDirectory NewName known not
  408.     {
  409.         FontDirectory OldName known not { /OldName /Courier def } if
  410.         /BaseFontDict OldName findfont def
  411.         /NewFontDict BaseFontDict maxlength dict def
  412.         BaseFontDict
  413.         {
  414.             exch dup /FID ne
  415.             {
  416.                 dup /Encoding eq
  417.                 {
  418.                     exch dup length array copy
  419.                     NewFontDict 3 1 roll put
  420.                 }
  421.                 {
  422.                     exch NewFontDict 3 1 roll put
  423.                 }
  424.                 ifelse
  425.             }
  426.             {
  427.                 pop pop
  428.             }
  429.             ifelse
  430.         } forall
  431.  
  432.         NewFontDict /FontName NewName put
  433.  
  434.         CharSet aload
  435.         length 2 idiv
  436.         {
  437.             NewFontDict /Encoding get 3 1 roll put
  438.         }
  439.         repeat
  440.  
  441.         NewName NewFontDict definefont pop
  442.     } if
  443. end
  444. } bind def
  445.  
  446.  
  447. % ---------------------------------------------------------------------------
  448. %                           PATTERN FILLS
  449. % ---------------------------------------------------------------------------
  450. /newfont 10 dict def
  451. newfont begin
  452.  
  453. /FontType 3 def
  454. /FontMatrix [ 1 0 0 1 0 0 ] def
  455. /FontBBox [ 0 0 8 8 ] def
  456. /Encoding 256 array def
  457.   0 1 255 { Encoding exch /.notdef put } for
  458.   Encoding  99 /linefill  put      % c=2
  459.   Encoding 100 /ltslash   put      % d=3
  460.   Encoding 101 /slash     put      % e=4
  461.   Encoding 102 /bkslash   put      % f=5
  462.   Encoding 103 /ltbkslash put      % g=6
  463.   Encoding 104 /hatch     put      % h=7
  464.   Encoding 105 /xhatch    put      % i=8
  465.   Encoding 106 /interleav put      % j=9
  466.   Encoding 107 /widedot   put      % k=10
  467.   Encoding 108 /closedot  put      % l=11
  468.   Encoding 122 /userfill  put      % z=12
  469.  
  470.  
  471. /CharProcs 16 dict def
  472. CharProcs begin
  473. /.notdef {} bind def
  474. /linefill  { 8 8 true [1 0 0 -1 0 8] { <ffff0000ffff0000> } imagemask } bind def
  475. /ltslash   { 8 8 true [1 0 0 -1 0 8] { <0102040810204080> } imagemask } bind def
  476. /slash     { 8 8 true [1 0 0 -1 0 8] { <e0c183070e1c3870> } imagemask } bind def
  477. /bkslash   { 8 8 true [1 0 0 -1 0 8] { <f0783c1e0f87c3e1> } imagemask } bind def
  478. /ltbkslash { 8 8 true [1 0 0 -1 0 8] { <a5d269b45a2d964b> } imagemask } bind def
  479. /hatch     { 8 8 true [1 0 0 -1 0 8] { <ff888888ff888888> } imagemask } bind def
  480. /xhatch    { 8 8 true [1 0 0 -1 0 8] { <8142241818244281> } imagemask } bind def
  481. /interleav { 8 8 true [1 0 0 -1 0 8] { <cc33cc33cc33cc33> } imagemask } bind def
  482. /widedot   { 8 8 true [1 0 0 -1 0 8] { <8000080080000800> } imagemask } bind def
  483. /closedot  { 8 8 true [1 0 0 -1 0 8] { <8800220088002200> } imagemask } bind def
  484. /userfill  { 8 8 true [1 0 0 -1 0 8] { UserPat            } imagemask } bind def
  485. end
  486.  
  487. /BuildChar       % fontdic charcode BuildChar
  488. {
  489.     exch begin
  490.         dup  122 eq
  491.         {
  492.             8 0 setcharwidth
  493.         }{
  494.             8 0   0 0 8 8  setcachedevice
  495.         } ifelse
  496.         Encoding exch get
  497.         CharProcs exch get
  498.     end
  499.     exec
  500. } bind def
  501. end % of newfont
  502. /PatFont newfont definefont pop
  503.  
  504. /UserPat <0001020400402010>  def
  505. /PatChar (a) def
  506.  
  507. /patfill
  508. {
  509.     gsave
  510.     eoclip
  511. %   gsave 1 setgray fill grestore
  512.     gsave 0 CS      fill grestore
  513.     ptm setmatrix /PatFont findfont 1 scalefont setfont
  514.     PatChar 0 FillStyle 97 add put
  515.  
  516.     pathbbox newpath
  517.     4 2 roll
  518.     cvi 3 not and /py1 exch def
  519.     cvi 3 not and /px1 exch def
  520.     /py2 exch def
  521.     px1 sub 8 div ceiling cvi /pw exch def
  522.  
  523.     py1 8 py2
  524.     {
  525.         px1 exch moveto
  526.         pw { PatChar show } repeat
  527.     } for
  528.  
  529.     grestore
  530. } bind def
  531.  
  532. % ---------------------------------------------------------------------------
  533.  
  534.  
  535.  
  536. /xround
  537. {
  538.     dup round dup 0 eq
  539.     {
  540.         2 -1 roll 0 lt { -1 } { 1 } ifelse
  541.     }if
  542.     2 -1 roll pop
  543. } bind def
  544.  
  545. /roundup
  546. {
  547.     dup 0 lt {floor} {ceiling} ifelse
  548. } bind def
  549.  
  550. /N { newpath } bind def
  551. /M { moveto } bind def
  552. /L { lineto } bind def
  553. /C { closepath } bind def
  554.  
  555.  
  556. % ----------------------------------------------------------------------
  557. % x1 y1 x2 y2       REC    draw rectangle (x1,y1)-(x2,y2)
  558. % ----------------------------------------------------------------------
  559. /REC
  560. {
  561.     transform round exch round exch itransform 4 2 roll
  562.     transform round exch round exch itransform 4 2 roll
  563.     /y2 exch def  /x2 exch def  /y1 exch def  /x1 exch def
  564.     newpath
  565.     x1 y1 moveto
  566.     x2 y1 lineto
  567.     x2 y2 lineto
  568.     x1 y2 lineto
  569.     closepath
  570. } bind def
  571.  
  572. % ----------------------------------------------------------------------
  573. %                   SK     stroke the current path
  574. % ----------------------------------------------------------------------
  575. /SK
  576. {
  577.     gsave DrawColor CS stroke grestore newpath
  578. } bind def
  579.  
  580. % ----------------------------------------------------------------------
  581. %                   FILL   fill the current path
  582. % ----------------------------------------------------------------------
  583. /FILL
  584. {
  585.     gsave
  586.     FillStyle 0 eq { 1 setgray }{ FillColor CS } ifelse
  587.     FillStyle 1 le ColorMode 1 eq or
  588.     { eoclip fill } { patfill } ifelse
  589.     grestore
  590. } bind def
  591.  
  592. % ----------------------------------------------------------------------
  593. % x1 y1 x2 y2       VEC    draw line from (x1,y1) to (x2,y2)
  594. % ----------------------------------------------------------------------
  595. /VEC
  596. {
  597.     transform round exch round exch itransform 4 2 roll
  598.     transform round exch round exch itransform 4 2 roll
  599.     newpath moveto lineto SK
  600. } bind def
  601.  
  602. % ----------------------------------------------------------------------
  603. % x1 y1             VS     start path
  604. % ----------------------------------------------------------------------
  605. /VS
  606. {
  607.     transform round exch round exch itransform
  608.     newpath moveto
  609. } bind def
  610.  
  611. % ----------------------------------------------------------------------
  612. % x  y              VR     close/continue path
  613. % ----------------------------------------------------------------------
  614. /VR
  615. {
  616.     transform round exch round exch itransform
  617.     closepath moveto
  618. } bind def
  619.  
  620. % ----------------------------------------------------------------------
  621. % x  y              VC     continue path
  622. % ----------------------------------------------------------------------
  623. /VC
  624. {
  625.     transform round exch round exch itransform
  626.     lineto
  627. } bind def
  628.  
  629. % ----------------------------------------------------------------------
  630. % x  y  c           PX     simulated putpixel
  631. % ----------------------------------------------------------------------
  632. /PX
  633. {
  634.     gsave
  635.     newpath CS 1 setlinewidth [] 0 setdash
  636.     transform round exch round exch itransform
  637.     moveto 0 0 rlineto stroke
  638. %   1 0 360 arc fill
  639.     grestore
  640. } bind def
  641.  
  642. % ----------------------------------------------------------------------
  643. % x1 y1 x2 y2 d t   BAR    fill and outline rectangle (x1,y1)-(x2,y2)
  644. % ----------------------------------------------------------------------
  645. /BAR
  646. {
  647.     /top exch def /dep exch def
  648.     REC FILL
  649.     newpath
  650.     x2 y1 moveto
  651.     x1 y1 lineto
  652.     x1 y2 lineto
  653.     x2 y2 lineto
  654.     x2 y1 lineto
  655.     dep 0 ne { BARDEP } if
  656.     SK
  657. } bind def
  658.  
  659. /BARDEP
  660. {
  661.     dep .6 mul /ydep exch def
  662.     y2 y1 sub /h exch def
  663.     x2 x1 sub /w exch def
  664.     dep ydep rlineto
  665.     0 h rlineto
  666.     top 0 ne { BARTOP } if
  667. } bind def
  668.  
  669. /BARTOP
  670. {
  671.     w neg 0 rlineto
  672.     dep neg ydep neg rlineto
  673.     w 0 rlineto
  674.     dep ydep rlineto
  675.     0 h neg rlineto
  676.     closepath
  677. } bind def
  678.  
  679. % ----------------------------------------------------------------------
  680. % x1 y1 x2 y2       PBR    fill rectangle (x1,y1)-(x2,y2)
  681. % ----------------------------------------------------------------------
  682. /PBR
  683. {
  684.     REC FILL
  685. } bind def
  686.  
  687. % ----------------------------------------------------------------------
  688. % xc yc th1 th2 a b EPATH  elliptical path
  689. % ----------------------------------------------------------------------
  690. /EPATH
  691. {
  692.     /savematrix matrix currentmatrix def
  693.     6 -2 roll translate scale
  694.     0 0 1 5 -2 roll arc
  695.     savematrix setmatrix
  696. } bind def
  697.  
  698. % ----------------------------------------------------------------------
  699. % xc yc th1 th2 a b ARC    draw an elliptical arc
  700. % ----------------------------------------------------------------------
  701. /ARC
  702. {
  703.     gsave
  704.     newpath EPATH [] 0 setdash SK
  705.     grestore
  706. } bind def
  707.  
  708. % ----------------------------------------------------------------------
  709. % xc yc th1 th2 a b PIE    draw and fill an elliptical pieslice
  710. % ----------------------------------------------------------------------
  711. /PIE
  712. {
  713.     gsave
  714.     newpath
  715.     6 -2 roll 2 copy moveto 6 2 roll
  716.     EPATH closepath FILL SK
  717.     grestore
  718. } bind def
  719.  
  720. % ----------------------------------------------------------------------
  721. % xc yc a b         ELI    draw and fill an ellipse
  722. % ----------------------------------------------------------------------
  723. /ELI
  724. {
  725.     4 2 roll 0 360 6 -2 roll
  726.     gsave
  727.     newpath EPATH FILL SK
  728.     grestore
  729. } bind def
  730.  
  731. % ----------------------------------------------------------------------
  732. % x y dx dy (text)  TXT    draw text at x,y
  733. % ----------------------------------------------------------------------
  734. /TXT
  735. {
  736.     gsave
  737.     DrawColor CS
  738.     5 -2 roll translate TxtDir 0 ne { 90 rotate } if
  739.     3 1 roll MoveChar mul 2 div
  740.     exch 2 index stringwidth pop mul 2 div
  741.     exch moveto show
  742.     grestore
  743. } bind def
  744.  
  745. % ----------------------------------------------------------------------
  746. % size dir font   TXS     sets text size
  747. % ----------------------------------------------------------------------
  748. /TXS
  749. {
  750.     /CurFont exch def /TxtDir exch def  /TxtHt exch def
  751.     CurFont findfont TxtHt scalefont setfont
  752.     /MoveChar TxtHt def
  753. %   newpath 0 0 moveto
  754. %   (0|h) false charpath flattenpath pathbbox newpath
  755. %   /MoveChar exch def 3 { pop } repeat
  756. } bind def
  757.  
  758. % ----------------------------------------------------------------------
  759. % array             LD      defines line style
  760. % ----------------------------------------------------------------------
  761. /LD
  762. {
  763.     dup /LineStyle exch def 0 setdash
  764. } bind def
  765.  
  766. % ----------------------------------------------------------------------
  767. % draw fill         CD      defines colors
  768. % ----------------------------------------------------------------------
  769. /CD
  770. {
  771.     /FillColor exch def  /DrawColor exch def
  772. } bind def
  773.  
  774. % ----------------------------------------------------------------------
  775. % pat#              FD      defines fill pattern
  776. % ----------------------------------------------------------------------
  777. /FD
  778. {
  779.     /FillStyle exch def
  780. } bind def
  781.  
  782. % ----------------------------------------------------------------------
  783. % patstr            FPD     defines user fill
  784. % ----------------------------------------------------------------------
  785. /FPD
  786. {
  787.     /UserPat exch def  /FillStyle 25 def
  788. } bind def
  789.  
  790. % ----------------------------------------------------------------------
  791. % color             CS      select  color
  792. % ----------------------------------------------------------------------
  793. /CS
  794. {
  795.     ColorTable exch get
  796.     dup type /arraytype ne { setgray }{ {} forall setrgbcolor } ifelse
  797. } bind def
  798.  
  799. % ----------------------------------------------------------------------
  800. % x1 y1 x2 y2       CLIP   set clipping region
  801. % ----------------------------------------------------------------------
  802. /CLIP
  803. {
  804.     transform round exch round exch itransform 4 2 roll
  805.     transform round exch round exch itransform 4 2 roll
  806.     grestore gsave   % reset to INXX state
  807.     0 setlinewidth REC eoclip newpath
  808.     % restore current graphics state
  809.     TxtHt TxtDir CurFont TXS
  810.     LineWidth setlinewidth
  811.     LineStyle 0 setdash
  812. } bind def
  813.  
  814.  
  815. % ----------------------------------------------------------------------
  816. % no                LW      set line width
  817. % ----------------------------------------------------------------------
  818. /LW
  819. {
  820.     StdLine mul dup /LineWidth exch def setlinewidth
  821. } bind def
  822.  
  823. % ----------------------------------------------------------------------
  824. % Width Height Orient Left Top Cmode      INXX    Initialize Page
  825. % Orient: 0=portrait, 1=landscape
  826. % ----------------------------------------------------------------------
  827. /INXX
  828. {
  829.     /PGstate save def
  830.     dup 3 gt { pop 0 } if /ColorMode exch def
  831.     ColorOptions ColorMode get /ColorTable exch def
  832.  
  833.     /ptm
  834.     [
  835.         1 1 matrix defaultmatrix dtransform xround exch xround exch
  836.         0 exch 0 exch 0 0
  837.     ] def
  838.     2 index 0 ne   % if landscape
  839.     {
  840.         /ptm
  841.         [
  842.             ptm aload pop 6 2 roll 4 2 roll neg exch neg exch 6 -2 roll
  843.         ] def
  844.     }
  845.     if
  846.  
  847.     0.1 0.1 scale translate
  848.  
  849.     0 eq
  850.     { neg 0 exch translate pop }                % portrait
  851.     { 90 rotate neg exch neg exch translate }   % landscape
  852.     ifelse
  853.  
  854.     /StdLine
  855.     StdLine dup dtransform roundup exch roundup exch idtransform pop
  856.     def
  857.  
  858.     /Courier /CourierGD AF
  859.     120 0 /CourierGD TXS
  860.     15 15 CD
  861.     1  FD
  862.     1  LW
  863.     [] LD
  864.     1.415 setmiterlimit
  865.     gsave
  866. } bind def
  867.  
  868. % ----------------------------------------------------------------------
  869. %                   TERM    Display Page
  870. % ----------------------------------------------------------------------
  871. /TERM
  872. {
  873. %xx PGstate restore
  874.     showpage
  875.     PGstate restore
  876. } bind def
  877.  
  878.  
  879. % ----------------------------------------------------------------------
  880. % ulx uly width height imagecols imagerows CI  hexdata      ;Color Image
  881. % ----------------------------------------------------------------------
  882. /CI
  883. {
  884.     gsave
  885.     /rows exch def /cols exch def
  886.     4 2 roll translate scale
  887.     /picstr cols string def
  888.  
  889.     cols rows 8
  890.     [ cols 0 0 rows neg 0 0 ]
  891.     { currentfile picstr readhexstring pop }
  892.     false 3 colorimage
  893.     grestore
  894. } bind def
  895.  
  896.  
  897. % ----------------------------------------------------------------------
  898. % ulx uly width height imagecols imagerows bits GI  hexdata ;GrayScale Image
  899. % ----------------------------------------------------------------------
  900. /GI
  901. {
  902.     gsave
  903.     /bits exch def /rows exch def /cols exch def
  904.     4 2 roll translate scale
  905. %   /picstr rows string def
  906.     /picstr cols 8 idiv bits mul string def
  907.  
  908.     cols rows bits
  909.     [ cols 0 0 rows neg 0 0 ]
  910.     { currentfile picstr readhexstring pop }
  911.     image
  912.     grestore
  913. } bind def
  914.  
  915.  
  916. % ...........................................................................
  917. %  Always use gsave/grestore around user proc code
  918.  
  919. % ----------------------------------------------------------------------
  920. % print multiple copies
  921. % ----------------------------------------------------------------------
  922. /copies
  923. {
  924.   /#copies exch def pop pop
  925. } bind def
  926.  
  927.  
  928. % ----------------------------------------------------------------------
  929. % display text rotated to any angle.
  930. % ----------------------------------------------------------------------
  931. /ROT                      %    x y (text) angle ROT
  932. {
  933.     gsave
  934.     DrawColor CS          % select the drawing color
  935.     4 -2 roll translate   % move the origin to (x,y)
  936.     rotate                % rotate to angle
  937.                           % compute coords to center vertically
  938.     0 0 moveto (X) false charpath flattenpath pathbbox newpath
  939.     2 index add -2 div 0 exch moveto pop pop pop
  940.     show
  941.     grestore
  942. } bind def
  943.  
  944.  
  945. % ----------------------------------------------------------------------
  946. % x y dx dy (text)  TXT90    draw text at x,y rotated 90 degrees clockwise
  947. %   Note: we are setting PostScript rotation to 270 (counterclockwise) to
  948. %         get our internal 90 (clockwise)
  949. % ----------------------------------------------------------------------
  950. /TXT90
  951. {
  952.     gsave
  953.     DrawColor CS
  954.     5 -2 roll translate TxtDir 0 ne { 33 rotate } if
  955.     3 1 roll MoveChar mul 2 div
  956.     exch 2 index stringwidth pop mul 2 div
  957.     270 rotate
  958.     exch moveto show
  959.     grestore
  960. } bind def
  961.  
  962.  
  963. % ----------------------------------------------------------------------
  964. % x y dx dy (text)  TXT180    draw text at x,y rotated 180 degrees clockwise
  965. % ----------------------------------------------------------------------
  966. /TXT180
  967. {
  968.     gsave
  969.     DrawColor CS
  970.     5 -2 roll translate TxtDir 0 ne { 33 rotate } if
  971.     3 1 roll MoveChar mul 2 div
  972.     exch 2 index stringwidth pop mul 2 div
  973.     180 rotate
  974.     exch moveto show
  975.     grestore
  976. } bind def
  977.  
  978.  
  979. % ----------------------------------------------------------------------
  980. % x y dx dy (text)  TXT270    draw text at x,y rotated 270 degrees clockwise
  981. %   Note: we are setting PostScript rotation to 90 (counterclockwise) to
  982. %         get our internal 270 (clockwise)
  983. % ----------------------------------------------------------------------
  984. /TXT270
  985. {
  986.     gsave
  987.     DrawColor CS
  988.     5 -2 roll translate TxtDir 0 ne { 33 rotate } if
  989.     3 1 roll MoveChar mul 2 div
  990.     exch 2 index stringwidth pop mul 2 div
  991.     90 rotate
  992.     exch moveto show
  993.     grestore
  994. } bind def
  995.  
  996. % ....................................................................
  997.  
  998. %%EndProlog
  999.  
  1000.