home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 128.img / WS6#06.LZH / WSPROL.PS < prev    next >
Text File  |  1990-02-18  |  5KB  |  279 lines

  1. %!PS-Adobe-2.0
  2. %%Creator: WordStar Release 6.0
  3. %%Pages: (atend)
  4. %%EndComments
  5.  
  6. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  7. %
  8. % Here you can define a routine "cleanup" that will be called
  9. % at the end of printing the document.
  10.  
  11.  
  12. %
  13. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  14.  
  15. /Ulgap 2 def                % underline gap
  16.  
  17. /inch {72 mul} bind def
  18. /inches {72 mul} bind def
  19.  
  20. /endpage where not
  21.     { /endpage { restore } bind def } { pop } ifelse
  22.  
  23. /cleanup where not
  24.     { /cleanup { } def } { pop } ifelse
  25.  
  26. /resetvars
  27. {
  28.     /bw 4 inch def            % box width
  29.     /bh 4 inch def            % box height
  30.     /bt 1.5 def            % box edge thickness
  31.     /bg 3 def            % nested box gap
  32.     /Ulgap 2 def            % underline gap
  33.     /pgsize 11 inch def        % for page orientation
  34. } bind def
  35.  
  36. % awidthshow a segment
  37. %
  38. /S    % Cx 0 32 Ax 0 Str Xs Ys
  39. {
  40.     moveto
  41.     awidthshow
  42. } bind def
  43.  
  44. % awidthshow a segment with underline
  45. %
  46. /SU    % Thik -Drop Cx 0 32 Ax 0 Str Xs Ys -Trim
  47. {
  48.     10 1 roll
  49.     2 copy
  50.     13 2 roll
  51.     moveto
  52.     awidthshow
  53.     dup
  54.     4 1 roll
  55.     rmoveto
  56.     setlinewidth
  57.     add
  58.     gsave
  59.        lineto
  60.        stroke
  61.     grestore
  62. } bind def
  63.  
  64. % underline whitespace
  65. %
  66. /WU    % Xe Ye Xs Ys Thik
  67. {
  68.     setlinewidth
  69.     moveto
  70.     lineto
  71.     currentpoint
  72.     stroke
  73.     moveto
  74. } bind def
  75.  
  76. % double underline whitespace
  77. %
  78. /WDU    % Xe Ye Xs Ys Thik
  79. {
  80.     5 copy
  81.     WU            % draw the first line 
  82.     gsave
  83.        0 1 index
  84.        Ulgap add
  85.        neg translate    % translate: 0 -(Thik+Ulgap) 
  86.                    % Xe Ye Xs Ys Thik
  87.        WU            % draw the second line
  88.     grestore
  89. } bind def
  90.  
  91.  
  92. % awidthshow a segment with double underline
  93. %
  94. /SDU    % Thik -Drop Cx 0 32 Ax 0 Str Xs Ys -Trim
  95. {
  96.     10 1 roll
  97.     2 copy
  98.     13 2 roll
  99.     moveto
  100.     awidthshow
  101.     dup
  102.     3 1 roll
  103.     rmoveto           % move to ul position
  104.     currentpoint
  105.     4 -1 roll
  106.     dup
  107.     setlinewidth
  108.     dup
  109.     7 1 roll
  110.     sub
  111.     Ulgap sub
  112.     6 2 roll
  113.     add
  114.     gsave           % cp saved before ul
  115.        lineto       % draw upper ul
  116.        Ulgap add
  117.        neg
  118.        0 exch rmoveto
  119.        lineto       % draw lower ul
  120.        stroke       % show lines
  121.     grestore       % restore cp
  122. } bind def
  123.  
  124. % move with underline
  125. %
  126. /MU    % Xdest
  127. {
  128.     currentpoint
  129.     exch
  130.     pop
  131.     lineto
  132.     currentpoint
  133.     stroke
  134.     moveto
  135. } bind def
  136.  
  137. % move with double underline
  138. %
  139. /MDU    % Xdest Thik
  140. {
  141.     currentpoint
  142.     3 -1 roll
  143.     dup
  144.     5 1 roll
  145.     sub
  146.     Ulgap sub
  147.     4 2 roll
  148.     currentpoint
  149.     exch
  150.     pop
  151.     lineto
  152.     currentpoint
  153.     stroke
  154.     moveto
  155.     neg
  156.     Ulgap sub
  157.     0 exch
  158.     gsave
  159.        rmoveto
  160.        lineto
  161.        stroke
  162.     grestore
  163. } bind def
  164.  
  165. % strikeout a char
  166. %
  167. /Strike            % (-) Ax Ci Ci+1
  168. {
  169.     pop pop
  170.     dup
  171.     2 index exch
  172.     currentpoint
  173.     pop
  174.     add
  175.     exch
  176.     Xs Ys moveto
  177.     show
  178.     dup
  179.     Ys moveto
  180.     /Xs exch def
  181. } bind def
  182.  
  183. % kshow with strikeout
  184. %
  185. /SX            % (-) Ax Str Xs Ys
  186. {
  187.     moveto
  188.     currentpoint
  189.     /Ys exch def
  190.     /Xs exch def
  191.     {Strike} exch
  192.     kshow
  193.     currentpoint    % for SXU
  194.     pop        % for SXU
  195.     /Xe exch def    % for SXU
  196.     pop
  197.     Xs Ys moveto
  198.     show
  199. } bind def
  200.  
  201. % kshow with strikeout and underline
  202. %
  203. /SXU            % Thik -Drop (-) Ax Str Xs Ys
  204. {
  205.     2 copy
  206.     7 1 roll
  207.     9 1 roll
  208.     SX
  209.     add
  210.     Xe exch
  211.     dup
  212.     4 1 roll
  213.     5 2 roll
  214.     WU
  215. } bind def    
  216.  
  217. % Reencode font encoding vector for a standard font
  218. %
  219. % do so only for fonts which have StandardEncoding
  220. /RV    % FontName
  221. {
  222.     dup findfont begin
  223.     currentdict dup length dict begin
  224.         { %forall
  225.             1 index /FID ne {def} {pop pop} ifelse
  226.         } forall
  227.         /FontName exch def
  228.         Encoding StandardEncoding eq
  229.         {%if    % only reencode if the current encoding IS StandardEncoding
  230.             /Encoding IBMenc def
  231.         }if
  232.         currentdict dup end end
  233.     /FontName get exch definefont pop
  234. } bind def
  235.  
  236. /IBMenc StandardEncoding 256 array copy def
  237.  
  238. %%EndProlog
  239.  
  240. %%BeginSetup
  241.  
  242. % initialize the IBMenc reencoding vector
  243. %
  244. 0 [  7    /bullet
  245.     20    /paragraph /section
  246.    128    /Ccedilla /udieresis /eacute /acircumflex /adieresis /agrave
  247.     /aring /ccedilla /ecircumflex /edieresis /egrave /idieresis 
  248.     /icircumflex /igrave /Adieresis /Aring /Eacute /ae /AE 
  249.     /ocircumflex /odieresis /ograve /ucircumflex /ugrave /ydieresis
  250.     /Odieresis /Udieresis /oslash /sterling /Oslash 
  251.    159    /florin /aacute /iacute /oacute /uacute /ntilde /Ntilde /ordfeminine
  252.     /ordmasculine /questiondown /registered /logicalnot 
  253.    173    /exclamdown /guillemotleft /guillemotright 
  254.    181    /Aacute /Acircumflex /Agrave /copyright   
  255.    189    /cent /yen
  256.    198    /atilde /Atilde
  257.    207    /currency
  258.    210    /Ecircumflex /Edieresis /Egrave /dotlessi /Iacute /Icircumflex
  259.     /Idieresis
  260.    222    /Igrave
  261.    224    /Oacute /germandbls /Ocircumflex /Ograve /otilde /Otilde
  262.    233    /Uacute /Ucircumflex /Ugrave
  263.    238    /macron /acute
  264.    247    /cedilla /ring /dieresis /dotaccent ]
  265.      { %forall
  266.         dup type /nametype eq 
  267.         { %ifelse
  268.             IBMenc 2 index 2 index put
  269.             pop 1 add
  270.         }{ %else
  271.             exch pop
  272.         } ifelse
  273.       } forall
  274. pop
  275.  
  276. %%EndSetup
  277. 
  278.