home *** CD-ROM | disk | FTP | other *** search
/ OneVision 3.03 / OneVision3.03.iso / Apps / OneVision.app / TMSSep.1Vmod / TMSOverFillProcset.ps < prev    next >
Encoding:
Text File  |  1996-11-12  |  5.3 KB  |  229 lines

  1. %!
  2. %%Title: (1VISION (R) OverFill Operators)
  3. %%Version: 1.0 
  4. %%Copyright: ((C) OneVision GmbH, Regensburg All Rights Reserved)
  5.  
  6. currentpacking true setpacking
  7. /overfill where {pop userdict /undoSaveToken save put} {} ifelse
  8.  
  9. /_TMSOverFillGstate 3 dict def
  10. _TMSOverFillGstate begin
  11. /gsavelevel 0 def
  12. /stack 10 array def
  13. end
  14. /currentoverfill
  15. {    _TMSOverFillGstate /stack get _TMSOverFillGstate /gsavelevel get get
  16. } hardbind def
  17. /setoverfill
  18. {    _TMSOverFillGstate /stack get _TMSOverFillGstate /gsavelevel get 3 -1 roll put
  19. } hardbind def
  20. 0 setoverfill
  21. /gsave
  22. {    gsave
  23.     currentoverfill
  24.     _TMSOverFillGstate /gsavelevel _TMSOverFillGstate /gsavelevel get 1 add put
  25.     _TMSOverFillGstate /stack get length _TMSOverFillGstate /gsavelevel get le
  26.     {    _TMSOverFillGstate /stack get dup length 10 add array
  27.         _TMSOverFillGstate /stack 2 index put copy pop
  28.         _TMSOverFillGstate /stack get dup length 10 sub
  29.         10 {2 copy 0 put 1 add} repeat pop pop
  30.     } if
  31.     setoverfill
  32. } hardbind def
  33. /grestore
  34. {    _TMSOverFillGstate /gsavelevel _TMSOverFillGstate /gsavelevel get 1 sub put
  35.     grestore
  36. } hardbind def
  37.  
  38. /shouldoverfill
  39. {    currentoverfill 0 gt
  40.     {    gsave mark {{} settransfer} stopped
  41.         {cleartomark false} {cleartomark true} ifelse grestore
  42.         {    gsave separate mark currentcolor dup type /dicttype eq {pop} if
  43.             counttomark 1 eq
  44.             {exch pop 1 exch sub currenttransfer exec 1 lt}
  45.             {cleartomark false}
  46.             ifelse
  47.             grestore
  48.         }
  49.         {false}
  50.         ifelse
  51.     }
  52.     {false}
  53.     ifelse
  54. } hardbind def
  55. /overfill
  56. {    gsave initmatrix 0 setlinejoin 1 setlinecap [] 0 setdash currentoverfill 2 mul setlinewidth
  57.     stroke grestore
  58. } hardbind def
  59.  
  60. /defIfKnown {1 index where {pop hardbind def} {pop pop} ifelse} hardbind def
  61.  
  62. /closeallsubpaths
  63. {    true {3 -1 roll {newpath} {closepath} ifelse moveto false} {lineto} {curveto} {closepath}
  64.     pathforall pop closepath
  65. } bind def
  66. /fill
  67. {    shouldoverfill {gsave fill grestore closeallsubpaths overfill newpath} {fill} ifelse
  68. } hardbind def
  69. /eofill
  70. {    shouldoverfill {gsave eofill grestore closeallsubpaths overfill newpath} {eofill} ifelse
  71. } hardbind def
  72. /stroke
  73. {    shouldoverfill
  74.     {    1 0 dtransform dup mul exch dup mul add
  75.         0 1 dtransform dup mul exch dup mul add
  76.         sub abs 0.0001 lt
  77.         1 0 dtransform dup mul exch dup mul add
  78.         1 0 dtransform 0 1 dtransform 4 -1 roll mul 3 1 roll mul sub abs
  79.         sub abs 0.0001 lt
  80.         and
  81.         gsave
  82.         {    currentoverfill 2 mul
  83.             1 0 dtransform dup mul exch dup mul add sqrt div currentlinewidth add
  84.         }
  85.         {    stroke grestore gsave strokepath
  86.             initmatrix 1 setlinejoin 1 setlinecap [] 0 setdash currentoverfill 2 mul
  87.         }
  88.         ifelse
  89.         setlinewidth stroke
  90.         grestore
  91.         newpath
  92.     }
  93.     {stroke}
  94.     ifelse
  95. } hardbind def
  96. /ufill {gsave newpath uappend fill grestore} defIfKnown
  97. /ueofill {gsave newpath uappend eofill grestore} defIfKnown
  98. /ustroke
  99. {    gsave newpath dup length 6 eq
  100.     {exch uappend concat} {uappend} ifelse
  101.     stroke
  102.     grestore
  103. } defIfKnown
  104. /__RectPath
  105. {    4 2 roll moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath
  106. } bind def
  107. /__ProcessRectArgs
  108. {    1 index type /arraytype eq
  109.     {    exch 0 4 2 index length 1 sub
  110.         {dup 3 add 1 exch{1 index exch get exch}for
  111.             5 1 roll 5 index exec
  112.         }for pop pop
  113.     }
  114.     {exec}
  115.     ifelse
  116. } bind def
  117. /rectfill
  118. {    gsave newpath {__RectPath fill} __ProcessRectArgs grestore
  119. } defIfKnown
  120. /rectstroke
  121. {    gsave
  122.     newpath dup type /arraytype eq
  123.     {dup length 6 eq} {false} ifelse
  124.     {{gsave __RectPath null concat stroke grestore}
  125.         dup length array cvx copy dup 2 4 -1 roll put __ProcessRectArgs
  126.     }
  127.     {{__RectPath stroke} __ProcessRectArgs}
  128.     ifelse
  129.     grestore
  130. } defIfKnown
  131.  
  132. /overfillshow
  133. {    currentpoint 2 index show
  134.     gsave newpath moveto true charpath overfill grestore
  135. } hardbind def
  136. /show
  137. {    shouldoverfill {overfillshow} {show} ifelse
  138. } hardbind def
  139. userdict /_TMSTmpString ( ) put
  140. /ashow
  141. {    shouldoverfill
  142.     {    {    _TMSTmpString exch 0 exch put _TMSTmpString overfillshow
  143.             2 copy rmoveto
  144.         } forall
  145.         2 {pop} repeat
  146.     }
  147.     {ashow}
  148.     ifelse
  149. } hardbind def
  150. /widthshow
  151. {    shouldoverfill
  152.     {    {    dup _TMSTmpString exch 0 exch put _TMSTmpString overfillshow
  153.             1 index eq {2 {2 index} repeat rmoveto} if
  154.         } forall
  155.         3 {pop} repeat
  156.     }
  157.     {widthshow}
  158.     ifelse
  159. } hardbind def
  160. /awidthshow
  161. {    shouldoverfill
  162.     {    {    _TMSTmpString exch 0 exch put _TMSTmpString overfillshow
  163.             2 copy rmoveto
  164.             2 index _TMSTmpString 0 get eq {2 {4 index} repeat rmoveto} if
  165.         } forall
  166.         5 {pop} repeat
  167.     }
  168.     {awidthshow}
  169.     ifelse
  170. } hardbind def
  171. /kshow
  172. {    shouldoverfill
  173.     {    dup 0 get
  174.         _TMSTmpString exch 0 exch put
  175.         _TMSTmpString overfillshow
  176.         dup length 1 gt
  177.         {    1 1 index length 1 sub getintervall
  178.             {    _TMSTmpString 0 get exch
  179.                 dup _TMSTmpString exch 0 exch put
  180.                 {3 index exec}
  181.                 _TMSTmpString overfillshow
  182.             } forall
  183.         }
  184.         {pop}
  185.         ifelse
  186.         pop
  187.     }
  188.     {kshow}
  189.     ifelse
  190. } hardbind def
  191. /glyphshow {pop} defIfKnown
  192. /xshow
  193. {    shouldoverfill
  194.     {    0 1 3 index length 1 sub
  195.         {    currentpoint 4 index 3 index 1 getinterval overfillshow
  196.             exch 3 index 3 index get add exch moveto pop
  197.         } for
  198.         pop pop
  199.     }
  200.     {xshow}
  201.     ifelse
  202. } defIfKnown
  203. /yshow
  204. {    shouldoverfill
  205.     {    0 1 3 index length 1 sub
  206.         {    currentpoint 4 index 3 index 1 getinterval overfillshow
  207.             3 index 3 index get add moveto pop
  208.         } for
  209.         pop pop
  210.     }
  211.     {yshow}
  212.     ifelse
  213. } defIfKnown
  214. /xyshow
  215. {    shouldoverfill
  216.     {    0 1 3 index length 1 sub
  217.         {    currentpoint 4 index 3 index 1 getinterval overfillshow
  218.             3 index 3 index 2 mul 1 add get add exch
  219.             3 index    3 index 2 mul get add exch moveto pop
  220.         } for
  221.         pop pop
  222.     }
  223.     {xyshow}
  224.     ifelse
  225. } defIfKnown
  226.  
  227. userdict /undoSaveToken known {userdict /undoSaveToken get restore} if
  228. setpacking
  229.