Update to groff 1.19.2.
[dragonfly.git] / contrib / groff-1.19 / font / devps / prologue.ps
1 %!PS-Adobe-3.0 Resource-ProcSet
2
3 /setpacking where {
4         pop
5         currentpacking
6         true setpacking
7 } if
8
9 /grops 120 dict dup begin 
10
11 % The ASCII code of the space character.
12 /SC 32 def
13
14 /A /show load def
15 /B { 0 SC 3 -1 roll widthshow } bind def
16 /C { 0 exch ashow } bind def
17 /D { 0 exch 0 SC 5 2 roll awidthshow } bind def
18 /E { 0 rmoveto show } bind def
19 /F { 0 rmoveto 0 SC 3 -1 roll widthshow } bind def
20 /G { 0 rmoveto 0 exch ashow } bind def
21 /H { 0 rmoveto 0 exch 0 SC 5 2 roll awidthshow } bind def
22 /I { 0 exch rmoveto show } bind def
23 /J { 0 exch rmoveto 0 SC 3 -1 roll widthshow } bind def
24 /K { 0 exch rmoveto 0 exch ashow } bind def
25 /L { 0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow } bind def
26 /M { rmoveto show } bind def
27 /N { rmoveto 0 SC 3 -1 roll widthshow } bind def
28 /O { rmoveto 0 exch ashow } bind def
29 /P { rmoveto 0 exch 0 SC 5 2 roll awidthshow } bind def
30 /Q { moveto show } bind def 
31 /R { moveto 0 SC 3 -1 roll widthshow } bind def
32 /S { moveto 0 exch ashow } bind def
33 /T { moveto 0 exch 0 SC 5 2 roll awidthshow } bind def
34
35 % name size font SF -
36
37 /SF {
38         findfont exch
39         [ exch dup 0 exch 0 exch neg 0 0 ] makefont
40         dup setfont
41         [ exch /setfont cvx ] cvx bind def
42 } bind def
43
44 % name a c d font MF -
45
46 /MF {
47         findfont
48         [ 5 2 roll
49         0 3 1 roll % b
50         neg 0 0 ] makefont
51         dup setfont
52         [ exch /setfont cvx ] cvx bind def
53 } bind def
54
55 /level0 0 def
56 /RES 0 def
57 /PL 0 def
58 /LS 0 def
59
60 % Enable manual feed.
61 % MANUAL -
62
63 /MANUAL {
64         statusdict begin /manualfeed true store end
65 } bind def
66
67 % Guess the page length.
68 % This assumes that the imageable area is vertically centered on the page.
69 % PLG - length
70
71 /PLG {
72         gsave newpath clippath pathbbox grestore
73         exch pop add exch pop
74 } bind def
75
76 % BP -
77
78 /BP {
79         /level0 save def
80         1 setlinecap
81         1 setlinejoin
82         72 RES div dup scale
83         LS {
84                 90 rotate
85         } {
86                 0 PL translate
87         } ifelse
88         1 -1 scale
89 } bind def
90
91 /EP {
92         level0 restore
93         showpage
94 } def
95
96
97 % centerx centery radius startangle endangle DA -
98
99 /DA {
100         newpath arcn stroke
101 } bind def
102
103 % x y SN - x' y'
104 % round a position to nearest (pixel + (.25,.25))
105
106 /SN {
107         transform 
108         .25 sub exch .25 sub exch
109         round .25 add exch round .25 add exch
110         itransform
111 } bind def
112         
113 % endx endy startx starty DL -
114 % we round the endpoints of the line, so that parallel horizontal
115 % and vertical lines will appear even
116
117 /DL {
118         SN
119         moveto
120         SN
121         lineto stroke
122 } bind def
123
124 % centerx centery radius DC -
125
126 /DC {
127         newpath 0 360 arc closepath
128 } bind def
129
130
131 /TM matrix def
132
133 %  width height centerx centery DE -
134
135 /DE {
136         TM currentmatrix pop
137         translate scale newpath 0 0 .5 0 360 arc closepath
138         TM setmatrix
139 } bind def
140
141 % these are for splines
142
143 /RC /rcurveto load def
144 /RL /rlineto load def
145 /ST /stroke load def
146 /MT /moveto load def
147 /CL /closepath load def
148
149 % fill the last path
150
151 % r g b Fr -
152
153 /Fr {
154         setrgbcolor fill
155 } bind def
156
157 % c m y k Fk -
158
159 /setcmykcolor where {
160         pop
161         /Fk {
162                 setcmykcolor fill
163         } bind def
164 } if
165
166 % g Fg -
167
168 /Fg {
169         setgray fill
170 } bind def
171
172 % fill with the ``current color''
173
174 /FL /fill load def
175
176 /LW /setlinewidth load def
177
178 /Cr /setrgbcolor load def
179 /setcmykcolor where {
180         pop
181         /Ck /setcmykcolor load def
182 } if
183 /Cg /setgray load def
184
185 % new_font_name encoding_vector old_font_name RE -
186
187 /RE {
188         findfont
189         dup maxlength 1 index /FontName known not { 1 add } if dict begin
190         {
191                 1 index /FID ne { def } { pop pop } ifelse
192         } forall
193         /Encoding exch def
194         dup /FontName exch def
195         currentdict end definefont pop
196 } bind def
197
198 /DEFS 0 def
199
200 % hpos vpos EBEGIN -
201
202 /EBEGIN {
203         moveto
204         DEFS begin
205 } bind def
206
207 /EEND /end load def
208
209 /CNT 0 def
210 /level1 0 def
211
212 % llx lly newwid wid newht ht newllx newlly PBEGIN -
213
214 /PBEGIN {
215         /level1 save def
216         translate
217         div 3 1 roll div exch scale
218         neg exch neg exch translate
219         % set the graphics state to default values
220         0 setgray
221         0 setlinecap
222         1 setlinewidth
223         0 setlinejoin
224         10 setmiterlimit
225         [] 0 setdash
226         /setstrokeadjust where {
227                 pop
228                 false setstrokeadjust
229         } if
230         /setoverprint where {
231                 pop
232                 false setoverprint
233         } if
234         newpath
235         /CNT countdictstack def
236         userdict begin
237         /showpage {} def
238         %
239         %  Any included setpagedevice should be ignored.
240         %  See: http://www.w-beer.de/doc/ps/.
241         %
242         /setpagedevice {} def
243 } bind def
244
245 /PEND {
246         countdictstack CNT sub { end } repeat
247         level1 restore
248 } bind def
249
250 end def
251
252 /setpacking where {
253         pop
254         setpacking
255 } if