2 b855148c 2004-05-16 devnull % Color and reverse video support for dpost. A call made to setcolor with two
3 b855148c 2004-05-16 devnull % arguments implies reverse video printing.
6 b855148c 2004-05-16 devnull /rgb {setrgbcolor} bind def
7 b855148c 2004-05-16 devnull /hsb {sethsbcolor} bind def
9 b855148c 2004-05-16 devnull /colordict 50 dict dup begin
10 b855148c 2004-05-16 devnull /red { 1 0 0 } def
11 b855148c 2004-05-16 devnull /green { 0 1 0 } def
12 b855148c 2004-05-16 devnull /blue { 0 0 1 } def
13 b855148c 2004-05-16 devnull /cyan { 0 1 1 } def
14 b855148c 2004-05-16 devnull /magenta { 1 0 1 } def
15 b855148c 2004-05-16 devnull /yellow { 1 1 0 } def
16 b855148c 2004-05-16 devnull /white { 1 1 1 } def
17 b855148c 2004-05-16 devnull /black { 0 0 0 } def
20 b855148c 2004-05-16 devnull /setcolor {
21 b855148c 2004-05-16 devnull counttomark 1 eq {
22 b855148c 2004-05-16 devnull dup colordict exch known not {pop /black} if
23 b855148c 2004-05-16 devnull colordict exch get exec setrgbcolor
25 b855148c 2004-05-16 devnull counttomark 2 eq {
26 b855148c 2004-05-16 devnull /backcolor exch def
27 b855148c 2004-05-16 devnull /textcolor exch def
28 b855148c 2004-05-16 devnull colordict backcolor known not colordict textcolor known not or {
29 b855148c 2004-05-16 devnull /backcolor colordict /black get def
30 b855148c 2004-05-16 devnull /textcolor colordict /white get def
32 b855148c 2004-05-16 devnull /backcolor colordict backcolor get def
33 b855148c 2004-05-16 devnull /textcolor colordict textcolor get def
34 b855148c 2004-05-16 devnull /dY1 0 def
35 b855148c 2004-05-16 devnull /dY2 0 def
36 b855148c 2004-05-16 devnull textcolor exec setrgbcolor
38 b855148c 2004-05-16 devnull } bind def
40 b855148c 2004-05-16 devnull /drawrvbox {
41 b855148c 2004-05-16 devnull /x2 exch def
42 b855148c 2004-05-16 devnull /x1 exch def
44 b855148c 2004-05-16 devnull currentpoint dup
45 b855148c 2004-05-16 devnull /y1 exch def
46 b855148c 2004-05-16 devnull /y2 exch def pop
48 b855148c 2004-05-16 devnull dY1 0 eq dY2 0 eq and {
49 b855148c 2004-05-16 devnull currentfont /FontBBox get aload pop
50 b855148c 2004-05-16 devnull currentfont /FontMatrix get dtransform /dY2 exch def pop
51 b855148c 2004-05-16 devnull currentfont /FontMatrix get dtransform /dY1 exch def pop
54 b855148c 2004-05-16 devnull /y1 y1 dY1 add def
55 b855148c 2004-05-16 devnull /y2 y2 dY2 add def
57 b855148c 2004-05-16 devnull backcolor exec setrgbcolor
59 b855148c 2004-05-16 devnull x1 y1 moveto
60 b855148c 2004-05-16 devnull x2 y1 lineto
61 b855148c 2004-05-16 devnull x2 y2 lineto
62 b855148c 2004-05-16 devnull x1 y2 lineto
63 b855148c 2004-05-16 devnull closepath fill
64 b855148c 2004-05-16 devnull textcolor exec setrgbcolor
65 b855148c 2004-05-16 devnull } bind def