v.ps - enscript - GNU Enscript
(HTM) git clone git://thinkerwim.org/enscript.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
v.ps (12097B)
---
1 %!PS-Adobe-3.0
2 %%BoundingBox: 24 24 571 818
3 %%Title: Enscript Output
4 %%For:
5 %%Creator: GNU Enscript 1.6.6
6 %%CreationDate: Fri Mar 3 21:26:03 2023
7 %%Orientation: Portrait
8 %%Pages: (atend)
9 %%DocumentMedia: A4 595 842 0 () ()
10 %%DocumentNeededResources: (atend)
11 %%EndComments
12 %%BeginProlog
13 %%BeginResource: procset Enscript-Prolog 1.6 6
14 %
15 % Procedures.
16 %
17
18 /_S { % save current state
19 /_s save def
20 } def
21 /_R { % restore from saved state
22 _s restore
23 } def
24
25 /S { % showpage protecting gstate
26 gsave
27 showpage
28 grestore
29 } bind def
30
31 /MF { % fontname newfontname -> - make a new encoded font
32 /newfontname exch def
33 /fontname exch def
34
35 /fontdict fontname findfont def
36 /newfont fontdict maxlength dict def
37
38 fontdict {
39 exch
40 dup /FID eq {
41 % skip FID pair
42 pop pop
43 } {
44 % copy to the new font dictionary
45 exch newfont 3 1 roll put
46 } ifelse
47 } forall
48
49 newfont /FontName newfontname put
50
51 % insert only valid encoding vectors
52 encoding_vector length 256 eq {
53 newfont /Encoding encoding_vector put
54 } if
55
56 newfontname newfont definefont pop
57 } def
58
59 /MF_PS { % fontname newfontname -> - make a new font preserving its enc
60 /newfontname exch def
61 /fontname exch def
62
63 /fontdict fontname findfont def
64 /newfont fontdict maxlength dict def
65
66 fontdict {
67 exch
68 dup /FID eq {
69 % skip FID pair
70 pop pop
71 } {
72 % copy to the new font dictionary
73 exch newfont 3 1 roll put
74 } ifelse
75 } forall
76
77 newfont /FontName newfontname put
78
79 newfontname newfont definefont pop
80 } def
81
82 /SF { % fontname width height -> - set a new font
83 /height exch def
84 /width exch def
85
86 findfont
87 [width 0 0 height 0 0] makefont setfont
88 } def
89
90 /SUF { % fontname width height -> - set a new user font
91 /height exch def
92 /width exch def
93
94 /F-gs-user-font MF
95 /F-gs-user-font width height SF
96 } def
97
98 /SUF_PS { % fontname width height -> - set a new user font preserving its enc
99 /height exch def
100 /width exch def
101
102 /F-gs-user-font MF_PS
103 /F-gs-user-font width height SF
104 } def
105
106 /M {moveto} bind def
107 /s {show} bind def
108
109 /Box { % x y w h -> - define box path
110 /d_h exch def /d_w exch def /d_y exch def /d_x exch def
111 d_x d_y moveto
112 d_w 0 rlineto
113 0 d_h rlineto
114 d_w neg 0 rlineto
115 closepath
116 } def
117
118 /bgs { % x y height blskip gray str -> - show string with bg color
119 /str exch def
120 /gray exch def
121 /blskip exch def
122 /height exch def
123 /y exch def
124 /x exch def
125
126 gsave
127 x y blskip sub str stringwidth pop height Box
128 gray setgray
129 fill
130 grestore
131 x y M str s
132 } def
133
134 /bgcs { % x y height blskip red green blue str -> - show string with bg color
135 /str exch def
136 /blue exch def
137 /green exch def
138 /red exch def
139 /blskip exch def
140 /height exch def
141 /y exch def
142 /x exch def
143
144 gsave
145 x y blskip sub str stringwidth pop height Box
146 red green blue setrgbcolor
147 fill
148 grestore
149 x y M str s
150 } def
151
152 % Highlight bars.
153 /highlight_bars { % nlines lineheight output_y_margin gray -> -
154 gsave
155 setgray
156 /ymarg exch def
157 /lineheight exch def
158 /nlines exch def
159
160 % This 2 is just a magic number to sync highlight lines to text.
161 0 d_header_y ymarg sub 2 sub translate
162
163 /cw d_output_w cols div def
164 /nrows d_output_h ymarg 2 mul sub lineheight div cvi def
165
166 % for each column
167 0 1 cols 1 sub {
168 cw mul /xp exch def
169
170 % for each rows
171 0 1 nrows 1 sub {
172 /rn exch def
173 rn lineheight mul neg /yp exch def
174 rn nlines idiv 2 mod 0 eq {
175 % Draw highlight bar. 4 is just a magic indentation.
176 xp 4 add yp cw 8 sub lineheight neg Box fill
177 } if
178 } for
179 } for
180
181 grestore
182 } def
183
184 % Line highlight bar.
185 /line_highlight { % x y width height gray -> -
186 gsave
187 /gray exch def
188 Box gray setgray fill
189 grestore
190 } def
191
192 % Column separator lines.
193 /column_lines {
194 gsave
195 .1 setlinewidth
196 0 d_footer_h translate
197 /cw d_output_w cols div def
198 1 1 cols 1 sub {
199 cw mul 0 moveto
200 0 d_output_h rlineto stroke
201 } for
202 grestore
203 } def
204
205 % Column borders.
206 /column_borders {
207 gsave
208 .1 setlinewidth
209 0 d_footer_h moveto
210 0 d_output_h rlineto
211 d_output_w 0 rlineto
212 0 d_output_h neg rlineto
213 closepath stroke
214 grestore
215 } def
216
217 % Do the actual underlay drawing
218 /draw_underlay {
219 ul_style 0 eq {
220 ul_str true charpath stroke
221 } {
222 ul_str show
223 } ifelse
224 } def
225
226 % Underlay
227 /underlay { % - -> -
228 gsave
229 0 d_page_h translate
230 d_page_h neg d_page_w atan rotate
231
232 ul_gray setgray
233 ul_font setfont
234 /dw d_page_h dup mul d_page_w dup mul add sqrt def
235 ul_str stringwidth pop dw exch sub 2 div ul_h_ptsize -2 div moveto
236 draw_underlay
237 grestore
238 } def
239
240 /user_underlay { % - -> -
241 gsave
242 ul_x ul_y translate
243 ul_angle rotate
244 ul_gray setgray
245 ul_font setfont
246 0 0 ul_h_ptsize 2 div sub moveto
247 draw_underlay
248 grestore
249 } def
250
251 % Page prefeed
252 /page_prefeed { % bool -> -
253 statusdict /prefeed known {
254 statusdict exch /prefeed exch put
255 } {
256 pop
257 } ifelse
258 } def
259
260 % Wrapped line markers
261 /wrapped_line_mark { % x y charwith charheight type -> -
262 /type exch def
263 /h exch def
264 /w exch def
265 /y exch def
266 /x exch def
267
268 type 2 eq {
269 % Black boxes (like TeX does)
270 gsave
271 0 setlinewidth
272 x w 4 div add y M
273 0 h rlineto w 2 div 0 rlineto 0 h neg rlineto
274 closepath fill
275 grestore
276 } {
277 type 3 eq {
278 % Small arrows
279 gsave
280 .2 setlinewidth
281 x w 2 div add y h 2 div add M
282 w 4 div 0 rlineto
283 x w 4 div add y lineto stroke
284
285 x w 4 div add w 8 div add y h 4 div add M
286 x w 4 div add y lineto
287 w 4 div h 8 div rlineto stroke
288 grestore
289 } {
290 % do nothing
291 } ifelse
292 } ifelse
293 } def
294
295 % EPSF import.
296
297 /BeginEPSF {
298 /b4_Inc_state save def % Save state for cleanup
299 /dict_count countdictstack def % Count objects on dict stack
300 /op_count count 1 sub def % Count objects on operand stack
301 userdict begin
302 /showpage { } def
303 0 setgray 0 setlinecap
304 1 setlinewidth 0 setlinejoin
305 10 setmiterlimit [ ] 0 setdash newpath
306 /languagelevel where {
307 pop languagelevel
308 1 ne {
309 false setstrokeadjust false setoverprint
310 } if
311 } if
312 } bind def
313
314 /EndEPSF {
315 count op_count sub { pos } repeat % Clean up stacks
316 countdictstack dict_count sub { end } repeat
317 b4_Inc_state restore
318 } bind def
319
320 % Check PostScript language level.
321 /languagelevel where {
322 pop /gs_languagelevel languagelevel def
323 } {
324 /gs_languagelevel 1 def
325 } ifelse
326 %%EndResource
327 %%BeginResource: procset Enscript-Encoding-88591 1.6 6
328 /encoding_vector [
329 /.notdef /.notdef /.notdef /.notdef
330 /.notdef /.notdef /.notdef /.notdef
331 /.notdef /.notdef /.notdef /.notdef
332 /.notdef /.notdef /.notdef /.notdef
333 /.notdef /.notdef /.notdef /.notdef
334 /.notdef /.notdef /.notdef /.notdef
335 /.notdef /.notdef /.notdef /.notdef
336 /.notdef /.notdef /.notdef /.notdef
337 /space /exclam /quotedbl /numbersign
338 /dollar /percent /ampersand /quoteright
339 /parenleft /parenright /asterisk /plus
340 /comma /hyphen /period /slash
341 /zero /one /two /three
342 /four /five /six /seven
343 /eight /nine /colon /semicolon
344 /less /equal /greater /question
345 /at /A /B /C
346 /D /E /F /G
347 /H /I /J /K
348 /L /M /N /O
349 /P /Q /R /S
350 /T /U /V /W
351 /X /Y /Z /bracketleft
352 /backslash /bracketright /asciicircum /underscore
353 /quoteleft /a /b /c
354 /d /e /f /g
355 /h /i /j /k
356 /l /m /n /o
357 /p /q /r /s
358 /t /u /v /w
359 /x /y /z /braceleft
360 /bar /braceright /tilde /.notdef
361 /.notdef /.notdef /.notdef /.notdef
362 /.notdef /.notdef /.notdef /.notdef
363 /.notdef /.notdef /.notdef /.notdef
364 /.notdef /.notdef /.notdef /.notdef
365 /.notdef /.notdef /.notdef /.notdef
366 /.notdef /.notdef /.notdef /.notdef
367 /.notdef /.notdef /.notdef /.notdef
368 /.notdef /.notdef /.notdef /.notdef
369 /space /exclamdown /cent /sterling
370 /currency /yen /brokenbar /section
371 /dieresis /copyright /ordfeminine /guillemotleft
372 /logicalnot /hyphen /registered /macron
373 /degree /plusminus /twosuperior /threesuperior
374 /acute /mu /paragraph /bullet
375 /cedilla /onesuperior /ordmasculine /guillemotright
376 /onequarter /onehalf /threequarters /questiondown
377 /Agrave /Aacute /Acircumflex /Atilde
378 /Adieresis /Aring /AE /Ccedilla
379 /Egrave /Eacute /Ecircumflex /Edieresis
380 /Igrave /Iacute /Icircumflex /Idieresis
381 /Eth /Ntilde /Ograve /Oacute
382 /Ocircumflex /Otilde /Odieresis /multiply
383 /Oslash /Ugrave /Uacute /Ucircumflex
384 /Udieresis /Yacute /Thorn /germandbls
385 /agrave /aacute /acircumflex /atilde
386 /adieresis /aring /ae /ccedilla
387 /egrave /eacute /ecircumflex /edieresis
388 /igrave /iacute /icircumflex /idieresis
389 /eth /ntilde /ograve /oacute
390 /ocircumflex /otilde /odieresis /divide
391 /oslash /ugrave /uacute /ucircumflex
392 /udieresis /yacute /thorn /ydieresis
393 ] def
394 %%EndResource
395 %%EndProlog
396 %%BeginSetup
397 %%IncludeResource: font Courier-Bold
398 %%IncludeResource: font Courier
399 /HFpt_w 10 def
400 /HFpt_h 10 def
401 /Courier-Bold /HF-gs-font MF
402 /HF /HF-gs-font findfont [HFpt_w 0 0 HFpt_h 0 0] makefont def
403 /Courier /F-gs-font MF
404 /F-gs-font 10 10 SF
405 /#copies 1 def
406 % Pagedevice definitions:
407 gs_languagelevel 1 gt {
408 <<
409 /PageSize [595 842]
410 >> setpagedevice
411 } if
412 %%BeginResource: procset Enscript-Header-simple 1.6 6
413
414 /do_header { % print default simple header
415 gsave
416 d_header_x d_header_y HFpt_h 3 div add translate
417
418 HF setfont
419 user_header_p {
420 5 0 moveto user_header_left_str show
421
422 d_header_w user_header_center_str stringwidth pop sub 2 div
423 0 moveto user_header_center_str show
424
425 d_header_w user_header_right_str stringwidth pop sub 5 sub
426 0 moveto user_header_right_str show
427 } {
428 5 0 moveto fname show
429 45 0 rmoveto fmodstr show
430 45 0 rmoveto pagenumstr show
431 } ifelse
432
433 grestore
434 } def
435 %%EndResource
436 /d_page_w 547 def
437 /d_page_h 794 def
438 /d_header_x 0 def
439 /d_header_y 779 def
440 /d_header_w 547 def
441 /d_header_h 15 def
442 /d_footer_x 0 def
443 /d_footer_y 0 def
444 /d_footer_w 547 def
445 /d_footer_h 0 def
446 /d_output_w 547 def
447 /d_output_h 779 def
448 /cols 1 def
449 %%EndSetup
450 %%Page: (1) 1
451 %%BeginPageSetup
452 _S
453 24 24 translate
454 /pagenum 1 def
455 /fname () def
456 /fdir (.) def
457 /ftail (.) def
458 % User defined strings:
459 /fmodstr (Fri Mar 03 21:26:03 2023) def
460 /pagenumstr (1) def
461 /user_header_p false def
462 /user_footer_p false def
463 %%EndPageSetup
464 do_header
465 5 766 M
466 (hello world this is me) s
467 _R
468 S
469 %%Trailer
470 %%Pages: 1
471 %%DocumentNeededResources: font Courier-Bold Courier
472 %%EOF