home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 272.img / VP30-06.ZIP / PS2.PRE < prev    next >
Text File  |  1989-09-29  |  13KB  |  305 lines

  1. % Copyright (C) Digital Research, Inc. 1986-1988. All rights reserved.
  2. systemdict /setpacking known
  3. {/svp currentpacking def true setpacking}if
  4. /gemdict 250 dict def
  5. gemdict begin
  6.  
  7. /bd{bind def}bind def
  8. /ed{exch def}bind def
  9.  
  10. % User defined Start of Page procedure:  this operator will be
  11. % executed at the beginning of each page output through GEM
  12. % and is provided to allow user-defined page initialization.
  13. /UserSoP{}bd
  14.  
  15. % Halftone screen spot function procedure array: this array is indexed
  16. % into as follows: 0 = dot screen, 1 = line screen, 2 = ellipse screen,
  17. % 3 = custom (user-definable) screen.
  18. /ScreenProc[
  19.     { % Dot screen
  20.         abs exch abs 2 copy add 1 gt{
  21.             1 sub dup mul exch 1 sub dup mul add 1 sub}{
  22.             dup mul exch dup mul add 1 exch sub}ifelse}bind
  23.     { % Line screen
  24.         pop}bind
  25.     { % Ellipse screen
  26.         dup 5 mul 8 div mul exch dup mul exch add sqrt 1 exch sub}bind
  27.     { % Custom screen
  28.         dup mul exch dup mul add sqrt 1 exch sub}bind
  29.     ]def
  30.  
  31. /GEMINISUB{pop pop pop pop pop}bd
  32. /GEMINIDOC{3 -1 roll settray
  33.     dup userdict exch known{cvx exec}{pop}ifelse
  34.     /#copies ed
  35.     statusdict /setpageparams known
  36.     {statusdict begin 0 1 setpageparams end}{pop pop}ifelse}bd
  37. /geminit{np 1 setlinejoin /mpf true def
  38.     /cmat matrix def /smat matrix def /rmat matrix def
  39.     /encstr 80 string def /patname null def /patbits null def gs}bd
  40. /GEMMATSUB{pop pop pop pop gr 72 300 div exch div dup scale gs}bd
  41. /GEMMATINI{/landscape ed /p3 ed /p2 ed /p1 ed
  42.     gr 72 300 div exch div dup scale clippath pathbbox
  43.     exch /prx ed exch dup /ply ed sub 1 add p3 sub 2 div ply
  44.     add /ty ed dup prx exch sub 1 add p2 sub 2 div add
  45.     landscape{p1 add}if ty translate landscape{90 rotate}if gs}bd
  46. /gr /grestore load def
  47. /np /newpath load def
  48. /cp /currentpoint load def
  49. /gi /getinterval load def
  50. /lto /lineto load def
  51. /mto /moveto load def
  52. /cto /curveto load def
  53. /clw /currentlinewidth load def
  54. /gs /gsave load def 
  55. /greset{gr gs}bd
  56. /settray{dup 0 lt mf dup 0 ge{tray}{pop}ifelse}bd
  57. /mf{statusdict /manualfeed known
  58.     {statusdict begin /manualfeed ed end}{pop}ifelse}bd
  59. /tray{statusdict begin true
  60.     product(Dataproducts LZR 1260)eq{not exch dup 2 gt{pop 0}if
  61.         dup 0 eq{pop defaultpapertray}if setpapertray}if
  62.     product(QMS-PS 1200)eq product(Silentwriter)eq or{not exch dup 1 gt
  63.         {pop 0}if defaultpapertray exch 0 ne{3 exch sub}if
  64.         setpapertray}if
  65.     product(IBM Personal Page Printer II)eq{
  66.         statusdict /defaultpapertray known
  67.         statusdict /setpapertray known and
  68.             {not exch dup 2 gt{pop 0}if
  69.             dup 0 eq{pop defaultpapertray}
  70.             {dup defaultpapertray ge{1 add}if}ifelse
  71.             setpapertray}if}if
  72.     product dup(PrintServer 40)eq exch(QMS-PS 2400)eq or{
  73.         not exch dup 2 gt{pop 0}if
  74.         dup 0 eq{pop defaultpapertray}
  75.         {dup defaultpapertray ge{1 add}if}ifelse setpapertray}if
  76.     {statusdict /defaultpapertray known statusdict /setpapertray known and
  77.         {defaultpapertray exch 0 ne{1 exch sub}if setpapertray}
  78.         {pop}ifelse}if end}bd
  79. /R{findfont begin currentdict dup maxlength dict begin
  80.     {1 index /FID ne{def}{pop pop}ifelse}forall
  81.     /FontName ed dup length 0 ne{
  82.         /Encoding Encoding 256 array copy def 0 exch
  83.         {dup type /nametype eq{
  84.             Encoding 2 index 2 index put pop 1 add}
  85.             {exch pop}ifelse}forall}if pop
  86.     currentdict dup end end /FontName get exch definefont pop}bd
  87. /gemenvec[8#200 /Ccedilla 8#201 /udieresis 8#202 /eacute 8#203 /acircumflex
  88.     8#204 /adieresis 8#205 /agrave 8#206 /aring 8#207 /ccedilla
  89.     8#210 /ecircumflex 8#211 /edieresis 8#212 /egrave 8#213 /idieresis
  90.     8#214 /icircumflex  8#215 /igrave 8#216 /Adieresis 8#217 /Aring
  91.     8#220 /Eacute 8#221 /ae 8#222 /AE 8#223 /ocircumflex 8#224 /odieresis
  92.     8#225 /ograve 8#226 /ucircumflex 8#227 /ugrave 8#230 /ydieresis
  93.     8#231 /Odieresis 8#232 /Udieresis 8#233 /cent 8#234 /sterling
  94.     8#235 /yen 8#236 /currency 8#237 /florin 8#240 /aacute 8#241 /iacute
  95.     8#242 /oacute 8#243 /uacute 8#244 /ntilde 8#245 /Ntilde
  96.     8#246 /ordfeminine 8#247 /ordmasculine 8#250 /questiondown
  97.     8#251 /quotedblleft 8#252 /quotedblright 8#253 /guilsinglleft
  98.     8#254 /guilsinglright 8#255 /exclamdown 8#256 /guillemotleft
  99.     8#257 /guillemotright 8#260 /atilde 8#261 /otilde 8#262 /Oslash
  100.     8#263 /oslash 8#264 /oe 8#265 /OE 8#266 /Agrave 8#267 /Atilde
  101.     8#270 /Otilde 8#271 /section 8#272 /daggerdbl 8#273 /dagger
  102.     8#274 /paragraph
  103.     8#300 /quotedblbase 8#301 /ellipsis 8#302 /perthousand 8#303 /bullet
  104.     8#304 /endash 8#305 /emdash 8#306 /ring 8#307 /Aacute
  105.     8#310 /Acircumflex 8#311 /Egrave 8#312 /Ecircumflex 8#313 /Edieresis
  106.     8#314 /Igrave 8#315 /Iacute 8#316 /Icircumflex 8#317 /Idieresis
  107.     8#320 /Ograve 8#321 /Oacute 8#322 /Ocircumflex 8#323 /Scaron
  108.     8#324 /scaron 8#325 /Ugrave 8#326 /Uacute 8#327 /Ucircumflex
  109.     8#330 /Ydieresis 8#331 /germandbls 8#332 /Zcaron 8#333 /zcaron
  110.     8#334 /fraction 8#335 /space 8#336 /space 8#337 /space 8#340 /grave
  111.     8#341 /acute 8#342 /circumflex 8#343 /tilde 8#344 /dieresis
  112.     8#345 /ring 8#346 /cedilla 8#347 /caron
  113.     version(23.0)eq{8#275 /space 8#276 /space 8#277 /space}
  114.     {8#275 /copyright 8#276 /registered 8#277 /trademark}ifelse]def
  115. /addfont{fonts exch fpt exch put /fpt fpt 1 add def}bd
  116. /encfont{gemenvec exch fonts exch get dup encstr cvs length 1 sub encstr
  117.     exch 1 exch getinterval cvn R}bd
  118. /dpath{mto{lto}repeat}bd
  119. /path{np dpath}bd
  120. /addpath{lto{lto}repeat}bd
  121. /rxy{.25 sub round .25 add}bd
  122. /rpt{transform rxy exch rxy exch itransform}bd
  123. /fa{np rpt mto 3{rpt lto}repeat}bd
  124. /circle{np 0 0 1 0 360 arc}bd
  125. /deflin{0 0 0 setrgbcolor []0 setdash 1 setlinewidth}bd
  126. /dot{gs np 2 copy mto lto 1 setlinecap stroke gr}bd
  127. /rend{gs 1 setlinecap np mto cp 0.1 add lto stroke gr}bd
  128. /rl{gs 1 setlinecap stroke gr}bd
  129. /vl{dup /st ed dup apath exch get tx sub dup mul
  130.     exch 1 add apath exch get ty sub dup mul add sqrt}bd
  131. /doarrow{/rot ed /ty ed /tx ed 6 array currentmatrix
  132.     tx ty translate clw 4 lt{4}{clw}ifelse dup scale rot rotate np
  133.     0 0 mto -3 1.5 lto -3 -1.5 lto fill setmatrix}bd
  134. /arpath{np apath 0 get apath 1 get mto 2 2 points 1 sub
  135.     {dup apath exch get exch 1 add apath exch get lto}for}bd
  136. /arrowline{/apath ed /lend ed /lbeg ed /len clw 3 mul def
  137.     /points apath length def lbeg
  138.     {apath 0 get dup /tx ed /x1 ed apath 1 get dup
  139.         /ty ed /y1 ed true 2 2 points 1 sub
  140.         {vl len ge{pop false exit}if}for
  141.         {/lbeg false def /lend false def}
  142.         {apath 2 apath st points st sub gi putinterval /r1 y1
  143.             apath 3 get sub x1 apath 2 get sub atan def apath 0
  144.             x1 r1 cos len mul sub put apath 1 y1 r1 sin len mul
  145.             sub put /points points st 2 sub sub def}ifelse}if
  146.     lend{apath points 2 sub get dup /tx ed /x2 ed
  147.         apath points 1 sub get dup /ty ed /y2 ed
  148.         true points 4 sub -2 0
  149.         {vl len ge{pop false exit}if}for
  150.         {/lbeg false def /lend false def}
  151.         {/r2 y2 apath st 1 add get sub x2 apath st get sub
  152.             atan def /st st 2 add def apath st x2 r2 cos len mul
  153.             sub put apath st 1 add y2 r2 sin len mul sub put
  154.             /points st 2 add def}ifelse}if
  155.     lbeg{x1 y1 r1 doarrow}if lend{x2 y2 r2 doarrow}if arpath}bd
  156. /ac{6 array currentmatrix xt yt translate xs ys scale}bd
  157. /shorten{dup mul exch dup mul add sqrt clw 150 mul exch div}bd
  158. /xang{dup 360 ge{360}{0}ifelse exch dup sin xs mul exch cos ys mul atan
  159.     dup 360 lt{add}{exch pop}ifelse}bd
  160. /arrowarc{/eang ed /bang ed /ys ed /xs ed /yt ed
  161.     /xt ed /lend ed /lbeg ed ac np 0 0 1 bang xang
  162.     eang xang arc setmatrix cp /y2 ed /x2 ed ac np 0 0 1 bang
  163.     xang dup arc setmatrix cp /y1 ed /x1 ed lbeg
  164.     {/bang bang xs ys shorten add def}if
  165.     lend{/eang eang xs ys shorten sub def}if ac np 0 0 1 bang xang eang
  166.     xang arc setmatrix gs stroke gr
  167.     lend{x2 y2 cp y2 exch sub exch x2 exch sub atan doarrow}if
  168.     lbeg{ac np 0 0 1 bang xang dup arc setmatrix x1 y1 cp y1 exch sub
  169.         exch x1 exch sub atan doarrow}if}bd
  170. /rbox{/ury ed /urx ed /lly ed /llx ed urx llx sub
  171.     4 div dup 50 gt{pop 50}if /radius ed ury lly sub 4 div dup
  172.     radius gt{pop radius}if /radius ed np urx radius sub ury mto llx
  173.     ury llx lly radius arcto 4{pop}repeat llx lly urx lly radius arcto
  174.     4{pop}repeat urx lly urx ury radius arcto 4{pop}repeat urx ury llx ury
  175.     radius arcto 4{pop}repeat}bd
  176. /marker{1 sub mdef exch get /mproc ed 32 div /msize ed
  177.     {gs np translate msize dup scale mproc stroke gr}repeat}bd
  178. /mdef[{0 0 0.5 0 360 arc}bind
  179.     {-16 0 mto 16 0 lto 0 -16 mto 0 16 lto}bind
  180.     {0 -16 mto 0 16 lto 13.9 8 mto -13.9 -8 lto 13.9 -8 mto
  181.         -13.9 8 lto}bind
  182.     {16 16 mto -16 16 lto -16 -16 lto 16 -16 lto closepath}bind
  183.     {16 16 mto -16 -16 lto -16 16 mto 16 -16 lto}bind
  184.     {16 0 mto 0 16 lto -16 0 lto 0 -16 lto closepath}bind
  185.     {0 0 16 0 360 arc}bind
  186.     {0 13.86 mto -16 -13.86 lto 16 -13.86 lto closepath}bind]def
  187. /bon{2 mul exch dup 3 1 roll 8 idiv add pstr exch get
  188.     exch 8 mod 7 exch sub 1 exch bitshift and 0 ne}bd
  189. /bpsf{1 add 8 mul cvi exch 1 add 8 mul cvi exch bon
  190.     {/onb onb 1 add def 1}{/ofb ofb 1 add def 0}ifelse}bd
  191. /frs{72 0 rmat defaultmatrix dtransform dup mul exch dup mul add sqrt}bd
  192. /sus{/m cmat currentmatrix def /sm 32 dup smat scale def sm m m concatmatrix
  193.     pop 1 0 m dtransform dup abs 0.1 gt{exch 90}{0}ifelse exch pop exch
  194.     dup 0 lt{exch 180 add exch neg}if frs exch div exch /bpsf load
  195.     setscreen}bd
  196. /setpat{/onb 0 def /ofb 0 def sus{}settransfer ofb ofb onb add div setgray}bd
  197. /ellpie{/pie ed /eang ed /bang ed /ys ed /xs ed
  198.     /yt ed /xt ed 6 array currentmatrix xt yt translate xs ys
  199.     scale np pie{0 0 mto}if 0 0 1 bang xang eang xang arc setmatrix}bd
  200. /roundarc{gs 1 setlinecap cp np mto cp lto stroke gr}bd
  201. /ss{currentscreen /scp ed /sca ed /scf ed
  202.     dup 0 lt{pop}{ScreenProc exch get /scp ed}ifelse
  203.     dup 0 lt{pop}{/sca ed}ifelse
  204.     dup 0 le{pop}{/scf ed}ifelse
  205.     scf sca /scp load setscreen}bd
  206. /grayimg{{vrep 0.1 gt{/vrep vrep 1 sub def}{
  207.             {currentfile token pop 0 eq
  208.                 {currentfile scan readhexstring pop pop exit}
  209.                 {/vrep currentfile token pop def}ifelse
  210.             }loop}ifelse scan}image}bd
  211. /fstimg{{vrep 0.1 gt{/vrep vrep 1 sub def}{
  212.             {currentfile token pop 0 eq
  213.                 {currentfile scan readhexstring pop pop exit}
  214.                 {/vrep currentfile token pop def}ifelse
  215.             }loop}ifelse scan}imagemask}bd
  216. /decode{/patstring patlen string def /bonestr 1 string def
  217.     {vrep 0.1 gt{/vrep vrep 1 sub def scan}
  218.         {/spos 0 def
  219.             {currentfile token pop currentfile token pop
  220.                 exch imop exch get exec spos smax ge
  221.                 {scan exit}if}loop}ifelse}imagemask}bd
  222. /imop[{<ff> psc}bind
  223.     {<00> psc}bind
  224.     {currentfile patstring readhexstring pop psc}bind
  225.     {1 exch 1 exch
  226.         {pop currentfile bonestr readhexstring pop scan exch
  227.             spos exch 0 get put /spos spos 1 add def}for}bind
  228.     {1 sub /vrep ed}bind]def
  229. /psc{dup length /plen ed exch -1 1
  230.     {pop dup scan exch spos exch putinterval /spos spos plen add def}for
  231.     pop}bd
  232. /nf{/svf currentflat def 10 setflat}bd
  233. /rf{svf setflat}bd
  234. /gtext{gs /msg ed /ty ed /tx ed tx ty translate trotate
  235.     rotate nf horz halign get exec
  236.     vert valign get exec np tx ty mto rf msg show tunder
  237.     {cp cp extents pop pop 5 div dup neg setlinewidth [] 0 setdash 1.5 mul
  238.         ty add /ty ed pop np pop ty mto tx ty lto stroke np mto}if
  239.     gr}bd
  240. /etext{gs translate trotate rotate /tx 0 def /ty 0 def
  241.     {tx add dup /tx ed np ty mto show}repeat gr}bd
  242. /jtext{/msg ed /sps ed /dx ed /ty ed /tx ed
  243.     gs tx ty translate trotate rotate nf
  244.     jhorz halign get exec vert valign get exec
  245.     msg stringwidth pop dx exch sub sps 0 eq{pop 0}{sps div}ifelse
  246.     /xsp ed rf msg jo gr}bd
  247. /fet{gs translate /tx 0 def /ty 0 def
  248.     {tx add dup /tx ed np ty mto show}repeat gr}bd
  249. /fjt{/msg ed /sps ed /dx ed /ty ed
  250.     gs ty translate nf /tx 0 def /ty 0 def
  251.     msg stringwidth pop dx exch sub sps 0 eq{pop 0}{sps div}ifelse
  252.     /xsp ed rf msg jo gr}bd
  253. /tsel{tszabs{dup /FontBBox get aload pop exch pop dup 3 1 roll exch sub
  254.     exch dup 0 eq{pop pop 1.25}{div}ifelse exch pop}{1}ifelse}bd
  255. /sf{fonts tface get findfont tsel dup txscale mul exch tyscale mul
  256.     matrix scale makefont setfont}bd
  257. /jo{xsp exch 0 exch 32 exch np tx ty mto widthshow tunder
  258.     {cp cp extents pop pop 5 div dup neg setlinewidth 1.5 mul ty add
  259.     /ty ed []0 setdash pop np pop ty mto tx ty lto stroke np mto}if}bd
  260. /horz[{/tx 0 def}bind
  261.     {msg stringwidth pop -2 div /tx ed}bind
  262.     {msg stringwidth pop neg /tx ed}bind]def
  263. /extents{(_)bbox pop pop msg stringwidth pop (])bbox 3{exch pop}repeat}bd
  264. /bbox{np 0 0 mto false charpath flattenpath pathbbox np}bd
  265. /vert[{/ty 0 def}bind
  266.     {extents -2 div /ty ed pop pop pop}bind
  267.     {extents neg /ty ed pop pop pop}bind
  268.     {extents pop pop neg /ty ed pop}bind]def
  269. /jhorz[{/tx 0 def}bind
  270.     {/tx dx -2 div def}bind
  271.     {/tx dx neg def}bind]def
  272. /symindex 12 def
  273. /CR{/ah 0 def}bd
  274. /LF{0 -50 translate}bd
  275. /atext{gs np ah av mto
  276.     show tunder{cp cp (_)bbox pop pop exch pop 5 div dup neg
  277.     setlinewidth 1.5 mul add dup ah exch [] 0 setdash np mto lto
  278.     stroke np mto}if cp pop /ah ed gr}bd
  279. /colmap[
  280.     [1 1 1]
  281.     [0 0 0]
  282.     [1 0 0]
  283.     [0 1 0]
  284.     [0 0 1]
  285.     [0 1 1]
  286.     [1 1 0]
  287.     [1 0 1]
  288.     [.5 .5 .5]
  289.     [0 0 0]
  290.     [.5 0 0]
  291.     [0 .5 0]
  292.     [0 0 .5]
  293.     [0 .5 .5]
  294.     [.5 .5 0]
  295.     [.5 0 .5]
  296.     ]def
  297. /sci{colmap exch get aload pop setrgbcolor}bd
  298. /stint{/tint ed currentrgbcolor
  299.     3{dup 0 eq{pop tint}if 3 1 roll}repeat setrgbcolor}bd
  300.  
  301. end
  302. /vpdict 1 dict def
  303. systemdict /setpacking known{svp setpacking}if
  304. %%EndProlog
  305.