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

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