Blame


1 b855148c 2004-05-16 devnull %
2 b855148c 2004-05-16 devnull % Shading support - primarily for ASCII file translators.
3 b855148c 2004-05-16 devnull %
4 b855148c 2004-05-16 devnull
5 b855148c 2004-05-16 devnull /grays [0.98 0.9 0.75 0.6] def
6 b855148c 2004-05-16 devnull
7 b855148c 2004-05-16 devnull /setshade {
8 b855148c 2004-05-16 devnull /level exch def
9 b855148c 2004-05-16 devnull level 0 le {
10 b855148c 2004-05-16 devnull /textgray 0 def
11 b855148c 2004-05-16 devnull /backgray 1 def
12 b855148c 2004-05-16 devnull }{
13 b855148c 2004-05-16 devnull /backgray level grays length gt
14 b855148c 2004-05-16 devnull {/textgray 1 def 0}
15 b855148c 2004-05-16 devnull {/textgray 0 def grays level 1 sub get}
16 b855148c 2004-05-16 devnull ifelse def
17 b855148c 2004-05-16 devnull } ifelse
18 b855148c 2004-05-16 devnull textgray setgray
19 b855148c 2004-05-16 devnull /dY1 0 def
20 b855148c 2004-05-16 devnull /dY2 0 def
21 b855148c 2004-05-16 devnull } bind def
22 b855148c 2004-05-16 devnull
23 b855148c 2004-05-16 devnull /drawrvbox {
24 b855148c 2004-05-16 devnull /x2 exch charwidth mul def
25 b855148c 2004-05-16 devnull /x1 exch charwidth mul def
26 b855148c 2004-05-16 devnull
27 b855148c 2004-05-16 devnull x1 x2 lt {
28 b855148c 2004-05-16 devnull dup % expects y on top
29 b855148c 2004-05-16 devnull /y1 exch linespace mul def
30 b855148c 2004-05-16 devnull /y2 y1 def
31 b855148c 2004-05-16 devnull
32 b855148c 2004-05-16 devnull dY1 0 eq dY2 0 eq and {
33 b855148c 2004-05-16 devnull currentfont /FontBBox get aload pop
34 b855148c 2004-05-16 devnull 160 sub
35 b855148c 2004-05-16 devnull currentfont /FontMatrix get dtransform /dY2 exch def pop
36 b855148c 2004-05-16 devnull 100 add
37 b855148c 2004-05-16 devnull currentfont /FontMatrix get dtransform /dY1 exch def pop
38 b855148c 2004-05-16 devnull } if
39 b855148c 2004-05-16 devnull
40 b855148c 2004-05-16 devnull /y1 y1 dY1 add def
41 b855148c 2004-05-16 devnull /y2 y2 dY2 add def
42 b855148c 2004-05-16 devnull
43 b855148c 2004-05-16 devnull backgray setgray
44 b855148c 2004-05-16 devnull newpath
45 b855148c 2004-05-16 devnull x1 y1 moveto
46 b855148c 2004-05-16 devnull x2 y1 lineto
47 b855148c 2004-05-16 devnull x2 y2 lineto
48 b855148c 2004-05-16 devnull x1 y2 lineto
49 b855148c 2004-05-16 devnull closepath fill
50 b855148c 2004-05-16 devnull } if
51 b855148c 2004-05-16 devnull textgray setgray
52 b855148c 2004-05-16 devnull } bind def