annotate etc/ps-prin0.ps @ 31231:abc7c24c58bb

*** empty log message ***
author Gerd Moellmann <gerd@gnu.org>
date Mon, 28 Aug 2000 16:08:42 +0000
parents 0763a6ed0743
children cdd489417ae4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
28155
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
1 % === BEGIN ps-print prologue 0
29497
0763a6ed0743 Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28764
diff changeset
2 % version: 5.2.2
28155
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
3
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
4 %%BeginProcSet: ErrorHandler
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5 % Downloaded Error Break-page handler
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
6 % Adapted from:
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
7 % PostScript Language Program Design,
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
8 % Adobe Systems Incorporated.
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
9 % Appendix A, pages 217-219
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
10
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
11 /ps$brkpage where{pop}
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
12 {
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
13 /ps$brkpage 64 dict def
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
14 ps$brkpage begin
29497
0763a6ed0743 Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28764
diff changeset
15 /tx 0 def/ty 0 def/toy 0 def/tox 0 def
28155
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
16 /prnt{
29497
0763a6ed0743 Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28764
diff changeset
17 dup type/stringtype ne{=string cvs}if
28155
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
18 dup length 6 mul
29497
0763a6ed0743 Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28764
diff changeset
19 /tx exch def/ty 10 def
0763a6ed0743 Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28764
diff changeset
20 currentpoint/toy exch def/tox exch def
28155
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
21 1 setgray newpath
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
22 tox toy 2 sub moveto
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
23 0 ty rlineto tx 0 rlineto
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
24 0 ty neg rlineto
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
25 closepath fill
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
26 tox toy moveto 0 setgray show
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
27 }bind def
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
28 /nl{currentpoint exch pop lmargin exch moveto 0 -10 rmoveto}def
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
29 /=={/cp 0 def typeprint nl}def
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
30 /typeprint{dup type dup currentdict exch known{exec}{unknowntype}ifelse}readonly def
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
31 /lmargin 72 def
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
32 /rmargin 72 def
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
33 /tprint{
29497
0763a6ed0743 Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28764
diff changeset
34 dup length cp add rmargin gt{nl/cp 0 def}if
0763a6ed0743 Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28764
diff changeset
35 dup length cp add/cp exch def
28155
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
36 prnt
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
37 }readonly def
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
38 /cvsprint{=string cvs tprint( )tprint}readonly def
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
39 /unknowntype{exch pop cvlit(??)tprint cvsprint}readonly def
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
40 /integertype{cvsprint}readonly def
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
41 /realtype{cvsprint}readonly def
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
42 /booleantype{cvsprint}readonly def
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
43 /operatortype{(//)tprint cvsprint}readonly def
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
44 /marktype{pop(-mark-)tprint}readonly def
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
45 /dicttype{pop(-dictionary-)tprint}readonly def
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
46 /nulltype{pop(-null-)tprint}readonly def
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
47 /filetype{pop(-filestream-)tprint}readonly def
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
48 /savetype{pop(-savelevel-)tprint}readonly def
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
49 /fonttype{pop(-fontid-)tprint}readonly def
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
50 /nametype{dup xcheck not{(/)tprint}if cvsprint}readonly def
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
51 /stringtype{
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
52 dup rcheck
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
53 {(\()tprint tprint(\))tprint}
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
54 {pop(-string-)tprint}ifelse}readonly def
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
55 /arraytype{
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
56 dup rcheck
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
57 {dup xcheck
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
58 {({)tprint{typeprint}forall(})tprint}
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
59 {([)tprint{typeprint}forall(])tprint}ifelse}
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
60 {pop(-array-)tprint}ifelse}readonly def
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
61 /packedarraytype{
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
62 dup rcheck
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
63 {dup xcheck
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
64 {({)tprint{typeprint}forall(})tprint}
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
65 {([)tprint{typeprint}forall(])tprint}ifelse}
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
66 {pop(-packedarray-)tprint}ifelse}readonly def
29497
0763a6ed0743 Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28764
diff changeset
67 /courier/Courier findfont 10 scalefont def
0763a6ed0743 Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28764
diff changeset
68 /OLDhandleerror errordict/handleerror get def
28155
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
69 end %ps$brkpage
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
70
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
71 /handleerror{
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
72 systemdict begin $error begin ps$brkpage begin
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
73 newerror
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
74 {/newerror false store vmstatus pop pop 0 ne{grestoreall}if
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
75 initgraphics
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
76 ErrorMessage 1 and 0 ne{ % print on paper
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
77 courier setfont lmargin 720 moveto
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
78 (# ERROR: )prnt errorname prnt nl
29497
0763a6ed0743 Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28764
diff changeset
79 (# OFFENDING COMMAND: )prnt/command load prnt
0763a6ed0743 Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28764
diff changeset
80 $error/ostack known
0763a6ed0743 Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28764
diff changeset
81 {nl nl(# STACK:)prnt nl nl $error/ostack get aload length{==}repeat}if
0763a6ed0743 Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28764
diff changeset
82 $error/errorinfo known
0763a6ed0743 Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28764
diff changeset
83 {nl nl(# ERRORINFO:)prnt nl nl $error/errorinfo get aload length{==}repeat}if
0763a6ed0743 Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28764
diff changeset
84 systemdict/showpage get exec}if
28155
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
85 ErrorMessage 2 and 0 ne{ % send back to printing system
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
86 (\%\%[ Error: )print errorname =print
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
87 (; OffendingCommand: )print/command load =print
29497
0763a6ed0743 Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28764
diff changeset
88 $error/errorinfo known
0763a6ed0743 Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28764
diff changeset
89 {(; ErrorInfo:)print $error/errorinfo get aload length{( )=print =print}repeat}if
28155
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
90 ( ]\%\%)= flush
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
91 (\%\%[ Rest of job is ignored ]\%\%)= flush}if
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
92 /newerror true store}if
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
93 end end end
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
94 stop
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
95 } % handleerror
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
96 dup 0 systemdict put % replace name by actual dict object
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
97 dup 4 ps$brkpage put % replace name by dict object
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
98 bind readonly
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
99
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
100 errordict 3 1 roll put % put proc in errordict as /handleerror
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
101 }ifelse
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
102 %%EndProcSet
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
103
28764
a94b3ce0fa8c *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents: 28427
diff changeset
104
a94b3ce0fa8c *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents: 28427
diff changeset
105 % operators for language level 2 only
a94b3ce0fa8c *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents: 28427
diff changeset
106
a94b3ce0fa8c *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents: 28427
diff changeset
107 (<<)cvn where % << operator
a94b3ce0fa8c *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents: 28427
diff changeset
108 {pop/BMark(<<)cvn load def}
a94b3ce0fa8c *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents: 28427
diff changeset
109 {/BMark{mark}bind def}ifelse
a94b3ce0fa8c *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents: 28427
diff changeset
110 (>>)cvn where % >> operator
a94b3ce0fa8c *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents: 28427
diff changeset
111 {pop/EMark(>>)cvn load def}
a94b3ce0fa8c *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents: 28427
diff changeset
112 {/EMark{counttomark 2 idiv dup dict begin{def}repeat pop currentdict end}bind def}ifelse
a94b3ce0fa8c *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents: 28427
diff changeset
113 /setpagedevice where % setpagedevice
a94b3ce0fa8c *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents: 28427
diff changeset
114 {pop}
a94b3ce0fa8c *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents: 28427
diff changeset
115 {/setpagedevice{pop}bind def}ifelse
a94b3ce0fa8c *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents: 28427
diff changeset
116 /packedarray where % packedarray
a94b3ce0fa8c *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents: 28427
diff changeset
117 {pop}
a94b3ce0fa8c *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents: 28427
diff changeset
118 {/packedarray{array astore readonly}bind def}ifelse
a94b3ce0fa8c *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents: 28427
diff changeset
119
28155
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
120
28167
cb25a24ec3e1 Change /setduplexmode, /settumble, add /packedarray.
Gerd Moellmann <gerd@gnu.org>
parents: 28155
diff changeset
121 % device dependent operators
cb25a24ec3e1 Change /setduplexmode, /settumble, add /packedarray.
Gerd Moellmann <gerd@gnu.org>
parents: 28155
diff changeset
122
28427
15c0a66a4a8b Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents: 28265
diff changeset
123 /DefOp{
15c0a66a4a8b Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents: 28265
diff changeset
124 dup where{pop pop pop}
15c0a66a4a8b Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents: 28265
diff changeset
125 {exch dup where{pop}{pop/pop}ifelse load def}ifelse}def
28155
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
126
29497
0763a6ed0743 Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28764
diff changeset
127 /duplexmode/setduplexmode DefOp
0763a6ed0743 Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28764
diff changeset
128 /tumble/settumble DefOp
28155
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
129
f568116325f9 *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
130 % === END ps-print prologue 0