Initial import of binutils 2.22 on the new vendor branch
[dragonfly.git] / contrib / groff / 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         DEFS /BPhook known { DEFS begin BPhook end } if
83         72 RES div dup scale
84         LS {
85                 90 rotate
86         } {
87                 0 PL translate
88         } ifelse
89         1 -1 scale
90 } bind def
91
92 /EP {
93         level0 restore
94         showpage
95 } def
96
97
98 % centerx centery radius startangle endangle DA -
99
100 /DA {
101         newpath arcn stroke
102 } bind def
103
104 % x y SN - x' y'
105 % round a position to nearest (pixel + (.25,.25))
106
107 /SN {
108         transform 
109         .25 sub exch .25 sub exch
110         round .25 add exch round .25 add exch
111         itransform
112 } bind def
113         
114 % endx endy startx starty DL -
115 % we round the endpoints of the line, so that parallel horizontal
116 % and vertical lines will appear even
117
118 /DL {
119         SN
120         moveto
121         SN
122         lineto stroke
123 } bind def
124
125 % centerx centery radius DC -
126
127 /DC {
128         newpath 0 360 arc closepath
129 } bind def
130
131
132 /TM matrix def
133
134 %  width height centerx centery DE -
135
136 /DE {
137         TM currentmatrix pop
138         translate scale newpath 0 0 .5 0 360 arc closepath
139         TM setmatrix
140 } bind def
141
142 % these are for splines
143
144 /RC /rcurveto load def
145 /RL /rlineto load def
146 /ST /stroke load def
147 /MT /moveto load def
148 /CL /closepath load def
149
150 % fill the last path
151
152 % r g b Fr -
153
154 /Fr {
155         setrgbcolor fill
156 } bind def
157
158 % c m y k Fk -
159
160 /setcmykcolor where {
161         pop
162         /Fk {
163                 setcmykcolor fill
164         } bind def
165 } if
166
167 % g Fg -
168
169 /Fg {
170         setgray fill
171 } bind def
172
173 % fill with the ``current color''
174
175 /FL /fill load def
176
177 /LW /setlinewidth load def
178
179 /Cr /setrgbcolor load def
180 /setcmykcolor where {
181         pop
182         /Ck /setcmykcolor load def
183 } if
184 /Cg /setgray load def
185
186 % new_font_name encoding_vector old_font_name RE -
187
188 /RE {
189         findfont
190         dup maxlength 1 index /FontName known not { 1 add } if dict begin
191         {
192                 1 index /FID ne
193                 2 index /UniqueID ne
194                 and
195                 { def } { pop pop } ifelse
196         } forall
197         /Encoding exch def
198         dup /FontName exch def
199         currentdict end definefont pop
200 } bind def
201
202 /DEFS 0 def
203
204 % hpos vpos EBEGIN -
205
206 /EBEGIN {
207         moveto
208         DEFS begin
209 } bind def
210
211 /EEND /end load def
212
213 /CNT 0 def
214 /level1 0 def
215
216 % llx lly newwid wid newht ht newllx newlly PBEGIN -
217
218 /PBEGIN {
219         /level1 save def
220         translate
221         div 3 1 roll div exch scale
222         neg exch neg exch translate
223         % set the graphics state to default values
224         0 setgray
225         0 setlinecap
226         1 setlinewidth
227         0 setlinejoin
228         10 setmiterlimit
229         [] 0 setdash
230         /setstrokeadjust where {
231                 pop
232                 false setstrokeadjust
233         } if
234         /setoverprint where {
235                 pop
236                 false setoverprint
237         } if
238         newpath
239         /CNT countdictstack def
240         userdict begin
241         /showpage {} def
242         %
243         %  Any included setpagedevice should be ignored.
244         %  See: http://www.w-beer.de/doc/ps/.
245         %
246         /setpagedevice {} def
247         mark
248 } bind def
249
250 /PEND {
251         cleartomark
252         countdictstack CNT sub { end } repeat
253         level1 restore
254 } bind def
255
256 end def
257
258 /setpacking where {
259         pop
260         setpacking
261 } if