Initial import from FreeBSD RELENG_4:
[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         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 } bind 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 /Fk {
160         setcmykcolor fill
161 } bind def
162
163 % g Fg -
164
165 /Fg {
166         setgray fill
167 } bind def
168
169 % fill with the ``current color''
170
171 /FL /fill load def
172
173 /LW /setlinewidth load def
174
175 /Cr /setrgbcolor load def
176 /Ck /setcmykcolor load def
177 /Cg /setgray load def
178
179 % new_font_name encoding_vector old_font_name RE -
180
181 /RE {
182         findfont
183         dup maxlength 1 index /FontName known not { 1 add } if dict begin
184         {
185                 1 index /FID ne { def } { pop pop } ifelse
186         } forall
187         /Encoding exch def
188         dup /FontName exch def
189         currentdict end definefont pop
190 } bind def
191
192 /DEFS 0 def
193
194 % hpos vpos EBEGIN -
195
196 /EBEGIN {
197         moveto
198         DEFS begin
199 } bind def
200
201 /EEND /end load def
202
203 /CNT 0 def
204 /level1 0 def
205
206 % llx lly newwid wid newht ht newllx newlly PBEGIN -
207
208 /PBEGIN {
209         /level1 save def
210         translate
211         div 3 1 roll div exch scale
212         neg exch neg exch translate
213         % set the graphics state to default values
214         0 setgray
215         0 setlinecap
216         1 setlinewidth
217         0 setlinejoin
218         10 setmiterlimit
219         [] 0 setdash
220         /setstrokeadjust where {
221                 pop
222                 false setstrokeadjust
223         } if
224         /setoverprint where {
225                 pop
226                 false setoverprint
227         } if
228         newpath
229         /CNT countdictstack def
230         userdict begin
231         /showpage {} def
232 } bind def
233
234 /PEND {
235         clear
236         countdictstack CNT sub { end } repeat
237         level1 restore
238 } bind def
239
240 end def
241
242 /setpacking where {
243         pop
244         setpacking
245 } if