home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 2 / crawlyvol2.bin / apps / dtp / printers / pscript.hdr < prev    next >
Text File  |  1993-05-13  |  18KB  |  947 lines

  1. %%BeginProlog
  2. % $VER: 2.2.11 06/15/92
  3. %Copyright 1991-1992 Soft-Logik Publishing Corp.
  4.  
  5. /AsphaltDict dup 153 dict def load begin
  6.  
  7. %
  8. % some definitions & variables
  9. %
  10. /bdef {bind def} bind def
  11. /xdef {exch def} bdef
  12. /ldef {load def} bdef
  13. /SG /setgray ldef
  14. /dmatrix matrix def
  15. /cmatrix matrix def
  16. /omatrix matrix def
  17.  
  18. /deltax 0 def
  19. /deltay 0 def
  20. /slant 0 def
  21. /twist 0 def
  22. /xscl 0 def
  23. /yscl 0 def
  24. /eang 0 def
  25. /bang 0 def
  26. /NwScrn false def
  27.  
  28. %
  29. % drawing definitions
  30. %
  31.  
  32. /sclm [0 0 0 0 0 0] def
  33. /setscl {
  34.   /deltay exch neg def
  35.   /deltax exch neg def
  36.   100 div /twist xdef
  37.   100 div /slant xdef
  38.   cmatrix setmatrix deltax neg deltay neg translate
  39.   sclm 0 twist cos put
  40.   sclm 1 twist sin put
  41.   sclm 2 slant sin neg put
  42.   sclm 3 slant cos put
  43.   sclm concat
  44.   /omatrix omatrix currentmatrix def
  45. } bdef
  46.  
  47. /scl {
  48.  deltay add exch
  49.  deltax add exch
  50.  transform round .2 add exch round .2 add exch itransform
  51. } bdef
  52.  
  53. /NW {newpath} bdef
  54. /MT {scl moveto} bdef
  55. /LT {scl lineto} bdef
  56. /CRV {scl 6 2 roll scl 6 2 roll scl 6 2 roll curveto} bdef
  57.  
  58. /AT {
  59.   100 div /eang xdef 100 div /bang xdef
  60.   /yscl xdef /xscl xdef scl translate
  61.   xscl yscl scale 0 0 1 bang eang
  62.   arc omatrix setmatrix
  63. } bdef
  64.  
  65. /AN {
  66.   100 div /eang xdef 100 div /bang xdef
  67.   /yscl xdef /xscl xdef scl translate
  68.   xscl yscl scale 0 0 1 bang eang
  69.   arcn omatrix setmatrix
  70. } bdef
  71.  
  72. /CP {closepath} bdef
  73.  
  74. /LTYPE {0 setdash setlinewidth} bdef
  75.  
  76. %
  77. % - BeginDoc -
  78. %
  79. /BeginDoc {
  80.   7 dict begin
  81.     /FontDict 12 dict def
  82.     FontDict begin
  83.       /cache true def
  84.       /key /mypatternfont def
  85.       /patterns 256 array def
  86.       /patterncount 1 def
  87.       /char 1 def
  88.       /mtx [300 72 div 0 0 300 72 div 0 0] matrix invertmatrix def
  89.       /height 30 def
  90.       /width 30 def
  91.       /ctm matrix currentmatrix def
  92.       /ptm matrix identmatrix def
  93.       /str ( ) def
  94.     end
  95.     /FontBBox [0 0 FontDict /width get FontDict /height get] def
  96.     /FontMatrix FontDict /mtx get def
  97.     /Encoding 256 array 0 1 255 {1 index exch dup put} for def
  98.     /FontType 3 def
  99.     /BuildChar { %def
  100.       exch begin
  101.       FontDict begin
  102.       /char xdef
  103.       cache
  104.         {width 0 0 0 width height setcachedevice}
  105.         {width 0 setcharwidth}
  106.       ifelse
  107.       width height scale 16 16 true [16 0 0 -16 0 16] {patterns char get} imagemask
  108.       end end
  109.     } def
  110.     FontDict /key get currentdict definefont pop
  111.   end
  112.  
  113. }bdef
  114.  
  115. %
  116. % angle cx cy cropmark -
  117. %
  118. /cropmark {
  119.   gsave translate rotate
  120.   newpath
  121.   bh 6 add 0 moveto 20 0 rlineto
  122.   0 bv 6 add moveto 0 20 rlineto
  123.   stroke grestore
  124. } bdef
  125.  
  126. %
  127. % cx cy regmark -
  128. %
  129. /regmark {
  130.   gsave translate
  131.   newpath
  132.   10 0 moveto 0 0 10 0 360 arc
  133.   1 SG fill
  134.   8 0 moveto 0 0 8 0 360 arc
  135.   -10 0 moveto 10 0 lineto 0 -10 moveto 0 10 lineto
  136.   0 SG stroke
  137.   4 0 moveto 0 0 4 0 360 arc
  138.   fill
  139.   -4 0 moveto 4 0 lineto 0 -4 moveto 0 4 lineto
  140.   1 SG stroke
  141.   grestore
  142. } bdef
  143.  
  144. %
  145. % cx cy slurgauge -
  146. %
  147. /slurgauge {
  148.   gsave translate
  149.   newpath
  150.   0 0 10 0 360 arc
  151.   1 SG fill
  152.   0 0 10 0 360 arc
  153.   0 SG stroke
  154.   36 { 1 0 moveto 0 0 10 -2.5 2.5 arc fill 10 rotate} repeat
  155.   grestore
  156. } bdef
  157.  
  158. %
  159. % string cx cy label -
  160. %
  161. /label {
  162.   gsave translate 90 rotate
  163.   /Courier findfont 8 scalefont setfont
  164.   0 0 moveto show
  165.   0 -8 moveto
  166.   currentscreen pop exch 20 string cvs show ( lpi  ) show
  167.   20 string cvs show (\312   ) show
  168.   docscale 20 string cvs show (%) show
  169.   grestore
  170. } bdef
  171.  
  172. %
  173. % angle cx cy colorstrip -
  174. %
  175. /boxit {newpath moveto 14 0 rlineto 0 -14 rlineto -14 0 rlineto closepath} def
  176.  
  177. /colorstrip {
  178.   gsave translate rotate
  179.   /Courier findfont 6 scalefont setfont
  180.  
  181.   psepmode 0 eq {
  182.     0 8 translate
  183.     0 1 9 {dup 15 mul 0 boxit 10 div SG fill} for
  184.    }if
  185.  
  186.   psepmode 1 eq {
  187.     gsave 320 15 translate
  188.     0 0 boxit .5 .41 .41 0 setcmykcolor fill
  189.     15 0 boxit 0 0 0 .5 setcmykcolor fill
  190.     30 0 boxit 1 1 0 0 setcmykcolor fill
  191.     45 0 boxit 1 0 1 0 setcmykcolor fill
  192.     60 0 boxit 0 1 1 0 setcmykcolor fill
  193.     75 0 boxit 1 1 1 0 setcmykcolor fill
  194.     1 SG
  195.     33 -6 moveto (CM) show
  196.     48 -6 moveto (CY) show
  197.     63 -6 moveto (MY) show
  198.     77 -6 moveto (CMY) show
  199.     grestore
  200.  
  201.  
  202.     pblack 0 ne {0 15 translate (K)} if
  203.     pcyan 0 ne {0 0 translate (C)} if
  204.     pmagenta 0 ne {160 15 translate (M)} if
  205.     pyellow 0 ne {160 0 translate (Y)} if
  206.     -6 -6 moveto 0 SG show
  207.  
  208.     0 1 9 {dup 15 mul 0 boxit 10 div SG fill} for
  209.    }if
  210.  
  211.   psepmode 2 eq {
  212.     320 0 translate
  213.     0 1 9 {dup 15 mul 0 boxit 10 div SG fill} for
  214.    }if
  215.  
  216.   grestore
  217. } def
  218.  
  219. %
  220. % tilestring sepmode cyan magenta yellow black
  221. % negative mirror cropmarks manualfeed landscape scale
  222. % documentwidth documentheight paperw paperh tilex tiley tilew tileh
  223. % bh bv frequency angle copies iseps BEGINTILE
  224. %
  225. /begintile {
  226.   /iseps xdef
  227.   /#copies xdef
  228.   /cangle xdef
  229.   /cfreq xdef
  230.   /bv xdef
  231.   /bh xdef
  232.   /tileh xdef
  233.   /tilew xdef
  234.   /tiley xdef
  235.   /tilex xdef
  236.   /paperh xdef
  237.   /paperw xdef
  238.   /doch xdef
  239.   /docw xdef
  240.   /docscale xdef
  241.   /landscape xdef
  242.   /manual xdef
  243.   /cropmarks xdef
  244.   /mirror xdef
  245.   /negative xdef
  246.   /pblack xdef
  247.   /pyellow xdef
  248.   /pmagenta xdef
  249.   /pcyan xdef
  250.   /psepmode xdef
  251.   /tilename xdef
  252.  
  253.   /dmatrix dmatrix currentmatrix def
  254.  
  255.   bh 0 ge {/bleed true def}{/bleed false def /bh 0 def /bv 0 def}ifelse
  256.  
  257.   iseps {
  258.    /cropmarks false def
  259.    /bleed false def /bh 0 def bv 0 def
  260.    /mirror false def
  261.    /negative false def
  262.    /manual false def
  263.   }
  264.   {
  265.    statusdict /setpageparams known
  266.     {
  267.      mirror {statusdict /mirrorprint known {statusdict /mirrorprint true put /mirror false def}if }if
  268.      negative {statusdict /negativeprint known {statusdict /negativeprint true put /negative false def}if }if
  269.      statusdict begin tileh tilew cropmarks {72 add exch 72 add exch}if 0 0 setpageparams end
  270.     }
  271.     {
  272.      paperw 612 eq paperh 1008 eq and {/legal where{pop legal}if} if
  273.      paperw 612 eq paperh 792 eq and {/letter where{pop letter}if} if
  274.     } ifelse
  275.   } ifelse
  276.  
  277.   /leftclip paperw tilew cropmarks {72 add bh 2 mul add}if sub 2 div def
  278.   /topclip paperh tileh cropmarks {72 add bv 2 mul add}if sub 2 div def
  279.   leftclip topclip translate
  280.  
  281.   mirror {docw 0 translate -1 1 scale} if
  282.   negative {{1 exch sub} settransfer newpath clippath 1 SG fill} if
  283.   manual {statusdict /manualfeed known {statusdict /manualfeed true put}if }if
  284.   tilex neg tiley neg translate
  285.  
  286.   currentscreen /dproc xdef /dangle xdef /dfreq xdef
  287.   /dtrans currenttransfer def
  288.  
  289.   cangle 10000 gt {/cangle dangle def} if
  290.   cfreq 10000 gt {/cfreq dfreq def} if
  291.   cfreq cangle /dproc load setscreen
  292.  
  293.  
  294.  psepmode 0 eq {systemdict /setcmykcolor known not
  295.    {/setcmykcolor
  296.     {1 sub 4 1 roll 3 {3 index add neg dup 0 lt{pop 0}if 3 1 roll}
  297.      repeat setrgbcolor pop} bdef}if
  298.    /setgray /SG load def
  299.  } if
  300.  psepmode 1 eq {
  301.   pcyan 0 ne {/setcmykcolor {pop pop pop 1 exch sub SG}bdef /setgray {pop 1 SG}bdef } if
  302.   pmagenta 0 ne {/setcmykcolor {pop pop 1 exch sub SG pop}bdef /setgray {pop 1 SG}bdef } if
  303.   pyellow 0 ne {/setcmykcolor {pop 1 exch sub SG pop pop}bdef /setgray {pop 1 SG}bdef } if
  304.   pblack 0 ne {/setcmykcolor {1 exch sub SG pop pop pop}bdef /setgray /SG load def } if
  305.  } if
  306.  psepmode 2 eq {/setcmykcolor {
  307.   pblack 10000 div eq exch
  308.   pyellow 10000 div eq and exch
  309.   pmagenta 10000 div eq and exch
  310.   pcyan 10000 div eq and {0 SG}{1 SG}ifelse}bdef
  311.   pblack 10000 eq pyellow 0 eq and pmagenta 0 eq and pcyan 0 eq and
  312.    {/setgray /SG load def}{/setgray {pop 1 SG} bdef} ifelse
  313.  } if
  314.  
  315.  
  316.   cropmarks {
  317.     mirror {bh 36 add neg bv 36 add translate}{bh 36 add bv 36 add translate}ifelse
  318.     gsave
  319.     0 SG [] 0 setdash .3 setlinewidth 0 setlinejoin 0 setlinecap
  320.  
  321.     180 tilex tiley cropmark
  322.     270 tilex tilew add tiley cropmark
  323.     0 tilex tilew add tiley tileh add cropmark
  324.     90 tilex tiley tileh add cropmark
  325.  
  326.     tilew 2 div tilex add 18 tiley add tileh add bv add regmark
  327.     tilew 2 div tilex add -18 tiley add bv sub regmark
  328.  
  329.     tilex bh sub 18 sub tiley bv sub 18 sub slurgauge
  330.     tilex tilew add bh add 18 add tiley tileh add bv add 18 add slurgauge
  331.  
  332.     tilename tilex bh sub 18 sub tiley 18 add label
  333.  
  334.     90 tilex tilew add bh add 18 add tiley 18 add colorstrip
  335.  
  336.     grestore
  337.   } if
  338.  
  339.   bleed {
  340.     tilex bh sub tiley bv sub moveto
  341.     tilex tilew add bh add tiley bv sub lineto
  342.     tilex tilew add bh add tiley tileh add bv add lineto
  343.     tilex bh sub tiley tileh add bv add lineto
  344.     clip
  345.   } if
  346.  
  347.   landscape {-90 rotate doch neg 0 translate} if
  348.   docscale 10000.0 div dup scale
  349.  
  350.   /cmatrix cmatrix currentmatrix def
  351.   /NwScrn false def
  352.  
  353. } bdef
  354.  
  355. %
  356. %
  357. %
  358. /endtile {
  359.   manual {statusdict /manualfeed known {statusdict /manualfeed false put}if } if
  360.   dmatrix setmatrix
  361. } bdef
  362.  
  363.  
  364. %
  365. % - patternpath -
  366. %
  367. /patternpath { %def
  368.   /mypatternfont findfont begin FontDict /ctm get setmatrix
  369.   currentdict setfont
  370.  
  371.   FontDict begin
  372.     FontMatrix concat
  373.     width 0 dtransform
  374.     round width div exch round width div exch
  375.     0 height dtransform
  376.     round height div exch
  377.     round height div exch
  378.     0 0 transform round exch round exch
  379.     ptm astore setmatrix
  380.     pathbbox
  381.     height div ceiling height mul 4 1 roll
  382.     width div ceiling width mul 4 1 roll
  383.     height div floor height mul 4 1 roll
  384.     width div floor width mul 4 1 roll
  385.     2 index sub height div ceiling cvi exch
  386.     3 index sub width div ceiling cvi exch
  387.     4 2 roll moveto
  388.     FontMatrix ptm invertmatrix pop
  389.     { %repeat
  390.       gsave
  391.       ptm concat
  392.       dup {str show} repeat
  393.       grestore
  394.       0 height rmoveto
  395.     } repeat
  396.     pop
  397.   end end
  398. } bdef
  399.  
  400. %
  401. % - patternfill -
  402. %
  403. /patternfill { %def
  404.  
  405.   gsave
  406.   1 setgray
  407.   fill
  408.   grestore
  409.  
  410.   gsave
  411.   clip patternpath
  412.   grestore
  413.   newpath
  414. } bdef
  415.  
  416. %
  417. % - patternfill -
  418. %
  419. /patterneofill { %def
  420.  
  421.   gsave
  422.   1 setgray
  423.   fill
  424.   grestore
  425.  
  426.   gsave
  427.   eoclip patternpath
  428.   grestore
  429.   newpath
  430. } bdef
  431.  
  432. /patternstroke {
  433.     strokepath patternfill
  434. } bdef
  435.  
  436.  
  437. %
  438. % ax ay string patternashow -
  439. %
  440. /patternashow {
  441.   (0) exch
  442.   { %forall
  443.     2 copy 0 exch put pop dup
  444.     false charpath
  445.     currentpoint
  446.     patternfill
  447.     moveto
  448.     3 copy pop rmoveto
  449.   } forall
  450.   pop pop pop
  451. } bdef
  452.  
  453. %
  454. % string patternshow -
  455. %
  456. /patternshow {
  457.   (0) exch
  458.   { %forall
  459.     2 copy 0 exch put pop dup
  460.     false charpath
  461.     currentpoint
  462.     patternfill
  463.     moveto
  464.   } forall
  465.   pop
  466. } bind def
  467.  
  468.  
  469. %
  470. % <pattern> shade PTRN -
  471. %
  472. /PTRN {
  473.   /shade xdef
  474.   /pattern xdef
  475.   /mypatternfont findfont begin
  476.   FontDict begin
  477.   true
  478.   1 1 patterncount {
  479.     dup patterns exch get pattern eq
  480.       {str exch 0 exch put pop false exit}
  481.     if
  482.     pop
  483.   }for
  484.   {
  485.     patterns patterncount pattern put
  486.     str 0 patterncount put
  487.     /patterncount patterncount 1 add def
  488.   }if
  489.   end
  490.   end
  491.  
  492.   /MF {gsave patterneofill grestore} bdef
  493.   /MS {gsave patternstroke grestore} bdef
  494.   /SW {patternshow} bdef
  495.  
  496.   1 shade 10000 div sub SG
  497. } bdef
  498.  
  499.  
  500.  
  501. %
  502. % shade SHADE -
  503. %
  504. /SHADE {
  505.   /shade xdef
  506.   NwScrn {
  507.     cfreq cangle /dproc load setscreen
  508.     /NwScrn false def
  509.   }if
  510.  
  511.   /MF {gsave eofill grestore} bdef
  512.   /MS {gsave stroke grestore} bdef
  513.   /SW /show ldef
  514.  
  515.   1 shade 10000 div sub SG
  516. } bdef
  517.  
  518.  
  519. %
  520. % <pattern> c m y k CMYKPTRN -
  521. %
  522. /CMYKPTRN {
  523.   /k xdef
  524.   /y xdef
  525.   /m xdef
  526.   /c xdef
  527.   /pattern xdef
  528.  
  529.   /mypatternfont findfont begin
  530.   FontDict begin
  531.   true
  532.   1 1 patterncount {
  533.     dup patterns exch get pattern eq
  534.       {str exch 0 exch put pop false exit}
  535.     if
  536.     pop
  537.   }for
  538.   {
  539.     patterns patterncount pattern put
  540.     str 0 patterncount put
  541.     /patterncount patterncount 1 add def
  542.   }if
  543.   end
  544.   end
  545.  
  546.   /MF {gsave patterneofill grestore} bdef
  547.   /MS {gsave patternstroke grestore} bdef
  548.   /SW {patternshow} bdef
  549.  
  550.   c 10000 div m 10000 div y 10000 div k 10000 div setcmykcolor
  551. } bdef
  552.  
  553.  
  554.  
  555. %
  556. % c m y k CMYK -
  557. %
  558. /CMYK {
  559.   /k xdef
  560.   /y xdef
  561.   /m xdef
  562.   /c xdef
  563.  
  564.   /MF {gsave eofill grestore} bdef
  565.   /MS {gsave stroke grestore} bdef
  566.   /SW /show ldef
  567.  
  568.   c 10000 div m 10000 div y 10000 div k 10000 div setcmykcolor
  569. } bdef
  570.  
  571.  
  572.  
  573. %
  574. %
  575. %
  576.  
  577. %
  578. % - beginspreadfill -
  579. %
  580. /beginspreadfill { %bdef
  581.   gsave
  582.   clip
  583.   newpath
  584. } bdef
  585.  
  586. %
  587. % - beginspreadeofill -
  588. %
  589. /beginspreadeofill { %bdef
  590.   gsave
  591.   eoclip
  592.   newpath
  593. } bdef
  594.  
  595. /beginspreadstroke { %bdef
  596.     strokepath beginspreadfill
  597. } bdef
  598.  
  599.  
  600. %
  601. % ax ay string beginspreadashow -
  602. %
  603. /beginspreadashow {
  604.   (0) exch
  605.   { %forall
  606.     2 copy 0 exch put pop dup
  607.     false charpath
  608.     currentpoint
  609.     moveto
  610.     3 copy pop rmoveto
  611.   } forall
  612.   pop pop pop
  613.   beginspreadfill
  614. } bdef
  615.  
  616. %
  617. % string beginspreadshow -
  618. %
  619. /beginspreadshow { %bdef
  620.   (0) exch
  621.   { %forall
  622.     2 copy 0 exch put pop dup
  623.     false charpath
  624.     currentpoint
  625.     moveto
  626.   } forall
  627.   pop
  628.   beginspreadfill
  629. } bdef
  630.  
  631. /endspread { %bdef
  632.   grestore
  633.   newpath
  634. } bdef
  635.  
  636. %
  637. % spreadamount spreadfill -
  638. %
  639. /spreadfill { %bdef
  640.   2 mul setlinewidth
  641.   [] 0 setdash
  642.   stroke
  643. } bdef
  644.  
  645. %
  646. % spreadamount spreadstroke -
  647. %
  648. /spreadstroke { %bdef
  649.   strokepath
  650.   2 mul setlinewidth
  651.   [] 0 setdash
  652.   stroke
  653. } bdef
  654.  
  655.  
  656. %
  657. % string spreadamount spreadshow -
  658. %
  659. /beginspreadshow { %bdef
  660.   2 mul setlinewidth
  661.   [] 0 setdash
  662.  
  663.   (0) exch
  664.   { %forall
  665.     2 copy 0 exch put pop dup
  666.     true charpath
  667.     currentpoint
  668.     stroke
  669.     moveto
  670.   } forall
  671.   pop
  672. } bdef
  673.  
  674.  
  675. %
  676. % pixelw pixelh bitsperpixel picx picy pfreq pangle PUTPIC savestate
  677. %
  678. /putpic {
  679.   /pangle xdef
  680.   /pfreq xdef
  681.   /ysize xdef
  682.   /xsize xdef
  683.   /bpp xdef
  684.   /h xdef
  685.   /w xdef
  686.  
  687.   pfreq 10000 lt {pfreq}{cfreq} ifelse
  688.   pangle 10000 lt {pangle}{cangle} ifelse
  689.   /dproc load setscreen
  690.   xsize 2 div neg ysize 2 div neg translate
  691.   xsize ysize scale
  692.   /NwScrn true def
  693.  
  694.   save
  695.   /picstr 8 bpp idiv dup w add 1 sub exch idiv string def
  696.   w h bpp [w 0 0 h neg 0 h] {currentfile picstr readhexstring pop}bind image
  697. } bdef
  698.  
  699. %
  700. % pixelw pixelh bitsperpixel picx picy pfreq pangle PUTRGBPIC savestate
  701. %
  702. /putrgbpic {
  703.   /pangle xdef
  704.   /pfreq xdef
  705.   /ysize xdef
  706.   /xsize xdef
  707.   /bpp xdef
  708.   /h xdef
  709.   /w xdef
  710.  
  711.   pfreq 10000 lt {pfreq}{cfreq} ifelse
  712.   pangle 10000 lt {pangle}{cangle} ifelse
  713.   /dproc load setscreen
  714.   xsize 2 div neg ysize 2 div neg translate
  715.   xsize ysize scale
  716.   /NwScrn true def
  717.  
  718.   save
  719.   /picstr 8 bpp idiv dup w add 1 sub exch idiv string def
  720.   w h bpp [w 0 0 h neg 0 h]  {currentfile picstr readhexstring pop}bind false 3 colorimage
  721. } bdef
  722.  
  723. %
  724. % savestate ENDPIC -
  725. %
  726. /endpic {
  727.   restore
  728. } bdef
  729.  
  730. %
  731. % newx newy origx origy llx lly urx ury BGNEPS -
  732. %
  733. /bgneps {
  734.   /ury xdef
  735.   /urx xdef
  736.   /lly xdef
  737.   /llx xdef
  738.   /origy xdef
  739.   /origx xdef
  740.   /newy xdef
  741.   /newx xdef
  742.   100 newx origx div mul 100 newy origy div mul scale
  743.   urx llx add -2 div ury lly add -2 div translate
  744.   /PgsEpsSave save def /showpage {} bdef
  745.   llx lly moveto llx ury lineto urx ury lineto urx lly lineto clip
  746.   newpath [] 0 setdash 1 setlinewidth 0 SG
  747. } bdef
  748.  
  749. %
  750. % - ENDEPS -
  751. %
  752. /endeps {PgsEpsSave restore} bdef
  753.  
  754.  
  755. %
  756. %
  757. %
  758. /doendstyle {
  759.   scl /taily exch def /tailx exch def
  760.   scl /tipy exch def /tipx exch def
  761.   gsave newpath 1 eq
  762.   {
  763.     /halfhead currentlinewidth dup 125 gt {1.5}{2} ifelse mul def
  764.     /headlength halfhead 5 mul def
  765.     /dx tipx tailx sub def
  766.     /dy tipy taily sub def
  767.     /arrowlength dx dx mul dy dy mul add sqrt def
  768.     /angle dy dx atan def
  769.     /base arrowlength headlength sub def
  770.     tailx taily translate
  771.     angle rotate
  772.     base halfhead neg moveto
  773.     arrowlength 0 lineto
  774.     base halfhead lineto
  775.     closepath fill
  776.     base 0 transform
  777.   }
  778.   {
  779.     tipx tipy currentlinewidth 2 div 0 360 arc fill
  780.     tipx tipy transform
  781.   } ifelse
  782.   grestore itransform} bdef
  783.   /BS {doendstyle moveto} bdef
  784.   /ES {doendstyle lineto MS} bdef
  785.  
  786.  
  787. %
  788. % font xpoint ypoint attribute SETFP
  789. %
  790. /sfpm [0 0 0 0 0 0] def
  791. /setfp {
  792.   /curattr xdef /curypoint xdef /curxpoint xdef /curfont xdef
  793.  
  794.   sfpm 0 curxpoint put
  795.   sfpm 3 curypoint put
  796.   curfont findfont sfpm
  797.   dup 2 0 put
  798.   2 curattr and 0 ne {dup 2 curypoint 3 div put} if
  799.   16 curattr and 0 ne {dup 2 curypoint 3 div neg put} if
  800.   128 curattr and 0 ne {dup 0 curxpoint neg put} if
  801.   256 curattr and 0 ne {dup 3 curypoint neg put} if
  802.   makefont setfont
  803. } bdef
  804.  
  805. %
  806. % - FONTSAVE -
  807. %
  808. /fontsave {
  809.   /PgsFontSave save def
  810. } bdef
  811.  
  812. %
  813. % - FONTRESTORE -
  814. %
  815. /fontrestore {
  816.   currentgray slant 100 mul twist 100 mul deltax neg deltay neg
  817.   PgsFontSave restore
  818.   setscl setgray
  819. } bdef
  820.  
  821. %
  822. % - PAGESAVE -
  823. %
  824. /pagesave {
  825.   /PgsPageSave save def
  826. } bdef
  827.  
  828. %
  829. % - PAGERESTORE -
  830. %
  831. /pagerestore {
  832.   PgsPageSave restore
  833. } bdef
  834.  
  835. %
  836. % cwidth A -
  837. %
  838. /a {/cwidth xdef
  839.  
  840. % reverse
  841.  64 curattr and 0 ne
  842.   {gsave 0 curypoint .75 mul rmoveto cwidth 0 rlineto
  843.    0 curypoint neg rlineto cwidth neg 0 rlineto closepath fill grestore
  844.    gsave 1 SG } if
  845.  
  846. % underline
  847.  512 curattr and 0 ne
  848.   {curypoint 40 div setlinewidth [] 0 setdash
  849.    gsave 0 curypoint .05 mul neg rmoveto
  850.    cwidth 0 rlineto stroke grestore} if
  851.  
  852. % double underline
  853.  4096 curattr and 0 ne
  854.   {curypoint 40 div setlinewidth [] 0 setdash
  855.    gsave 0 curypoint .05 mul neg rmoveto
  856.    cwidth 0 rlineto stroke grestore
  857.    gsave 0 curypoint .15 mul neg rmoveto
  858.    cwidth 0 rlineto stroke grestore} if
  859.  
  860. % strike through
  861.  8192 curattr and 0 ne
  862.   {curypoint 40 div setlinewidth [] 0 setdash
  863.    gsave 0 curypoint .3 mul rmoveto
  864.    cwidth 0 rlineto stroke grestore} if
  865. %
  866.  64 curattr and 0 ne
  867.    {grestore} if
  868.  
  869.  } bdef
  870.  
  871. %
  872. % cwidth newx newy B -
  873. %
  874. /b {newpath scl moveto a} bdef
  875.  
  876. %
  877. % cchar cwidth R -
  878. %
  879. /r {/cwidth xdef /cchar xdef
  880.  
  881. gsave
  882.  
  883. curattr 0 eq {cchar SW}
  884. {
  885. % reverse
  886.  64 curattr and 0 ne
  887.    {1 SG} if
  888.  
  889. % shadow
  890.  4 curattr and 0 ne
  891.   {curypoint 160 div setlinewidth [] 0 setdash
  892.    32 curattr and 0 ne
  893.   {64 curattr and 0 ne
  894.    {gsave .5 SG curxpoint 12 div curypoint 12 div neg rmoveto cchar SW grestore
  895.     gsave cchar SW grestore}
  896.    {gsave currentgray 1 add .5 mul SG curxpoint 12 div curypoint 12 div neg rmoveto cchar SW grestore
  897.     gsave cchar SW grestore} ifelse
  898.    }
  899.  
  900.   {64 curattr and 0 ne
  901.    {gsave curxpoint 12 div curypoint 12 div neg rmoveto cchar SW grestore
  902.     gsave 0 SG cchar SW grestore
  903.     gsave cchar true charpath stroke grestore}
  904.    {gsave curxpoint 12 div curypoint 12 div neg rmoveto cchar SW grestore
  905.     gsave 1 SG cchar SW grestore
  906.     gsave cchar true charpath stroke grestore} ifelse
  907.    } ifelse
  908.   } if
  909.  
  910. % outline
  911.  8 curattr and 0 ne
  912.   {curypoint 160 div setlinewidth [] 0 setdash
  913.    64 curattr and 0 eq {gsave 1 SG cchar SW grestore} if
  914.    gsave cchar true charpath stroke grestore} if
  915.  
  916. % light
  917.  32 curattr and 0 ne
  918.   {64 curattr and 0 ne {.5} {currentgray 1 add .5 mul} ifelse SG} if
  919.  
  920. % mirror
  921.  128 curattr and 0 ne
  922.   {cchar stringwidth pop neg 0 rmoveto} if
  923.  
  924. % upside down
  925.  256 curattr and 0 ne
  926.   {0 curypoint .6 mul rmoveto} if
  927.  
  928. %
  929.  curattr 12 and 0 eq
  930.   { curattr 1 and 0 ne
  931.     {curxpoint 48 div dup neg -10 exch
  932.       {gsave 0 rmoveto cchar SW grestore} for}
  933.     {cchar SW}ifelse
  934.   }if
  935. } ifelse
  936.  
  937.  grestore cwidth 0 rmoveto} bdef
  938.  
  939. %
  940. % cchar cwidth newx newy P -
  941. %
  942. /p {newpath scl moveto r} bdef
  943.  
  944.  
  945. end
  946. %%EndProlog
  947.