Daniel@0: /BOX { Daniel@0: /boxy1 exch def /boxx1 exch def /boxy0 exch def /boxx0 exch def Daniel@0: boxx0 boxy0 moveto boxx1 boxy0 lineto Daniel@0: boxx1 boxy1 lineto boxx0 boxy1 lineto Daniel@0: closepath Daniel@0: } def Daniel@0: /SCP { stroke initclip newpath BOX clip newpath } def Daniel@0: /CL { stroke setrgbcolor } def Daniel@0: /DO { stroke } def Daniel@0: /NP { newpath } def Daniel@0: /FI { fill } def Daniel@0: /LI { moveto lineto } def Daniel@0: /CT { curveto } def Daniel@0: /AR { Daniel@0: /ang2 exch def /ang1 exch def Daniel@0: /radius exch def /y2x exch def /cy exch def /cx exch def Daniel@0: gsave Daniel@0: cx cy translate 1 y2x scale 0 0 radius ang1 ang2 arc stroke Daniel@0: grestore Daniel@0: } def Daniel@0: /ARF { Daniel@0: /ang2 exch def /ang1 exch def Daniel@0: /radius exch def /y2x exch def /cy exch def /cx exch def Daniel@0: gsave Daniel@0: cx cy translate 1 y2x scale 0 0 radius ang1 ang2 arc fill Daniel@0: grestore Daniel@0: } def Daniel@0: /TXT { Daniel@0: /texth exch def Daniel@0: /textf exch def Daniel@0: /textn exch def Daniel@0: /texts exch def Daniel@0: /textyj exch def /texty exch def Daniel@0: /textxj exch def /textx exch def Daniel@0: textf findfont texth scalefont dup setfont Daniel@0: /FontBBox get 1 get 1000 div texth mul /textbl exch def Daniel@0: /textth texth textn mul def /texttw 0 def Daniel@0: 0 1 textn 1 sub { Daniel@0: texts exch get 0 get stringwidth pop Daniel@0: dup texttw gt { /texttw exch def } { pop } ifelse Daniel@0: } for Daniel@0: textyj (b) eq { /ty texty textth add textbl add def } if Daniel@0: textyj (d) eq { /ty texty textth add def } if Daniel@0: textyj (c) eq { /ty texty textth 2 div add def } if Daniel@0: textyj (u) eq { /ty texty def } if Daniel@0: /ty ty textbl sub def Daniel@0: textxj (l) eq { /tx textx def } if Daniel@0: textxj (c) eq { /tx textx texttw 2 div sub def } if Daniel@0: textxj (r) eq { /tx textx texttw sub def } if Daniel@0: 0 1 textn 1 sub { Daniel@0: /ty ty texth sub def Daniel@0: texts exch get dup 0 get /ts exch def 1 get /tj exch def Daniel@0: tj (l) eq { tx ty moveto ts show } if Daniel@0: tj (n) eq { Daniel@0: tx texttw ts stringwidth pop sub 2 div add ty moveto ts show Daniel@0: } if Daniel@0: tj (r) eq { Daniel@0: tx texttw ts stringwidth pop sub add ty moveto ts show Daniel@0: } if Daniel@0: } for Daniel@0: } def Daniel@0: Daniel@0: /colorimage where { Daniel@0: pop Daniel@0: } { Daniel@0: /bwproc { Daniel@0: rgbproc dup length 3 idiv string 0 3 0 5 -1 roll { Daniel@0: add 2 1 roll 1 sub dup 0 eq { Daniel@0: pop 3 idiv 3 -1 roll dup 4 -1 roll Daniel@0: dup 3 1 roll 5 -1 roll put 1 add 3 0 Daniel@0: } { Daniel@0: 2 1 roll Daniel@0: } ifelse Daniel@0: } forall Daniel@0: pop pop pop Daniel@0: } def Daniel@0: /colorimage { Daniel@0: pop pop /rgbproc exch def {bwproc} image Daniel@0: } bind def Daniel@0: } ifelse