Mercurial > emacs
annotate etc/ps-prin1.ps @ 39771:a43d7c40a1b2
Byte compiler messages.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Thu, 11 Oct 2001 12:58:24 +0000 |
parents | f7aaa73f592e |
children | e5675426ff4c |
rev | line source |
---|---|
27165 | 1 % === BEGIN ps-print prologue 1 |
31252
cdd489417ae4
Changed comment version (6.0).
Gerd Moellmann <gerd@gnu.org>
parents:
29495
diff
changeset
|
2 % version: 6.0 |
27165 | 3 |
36223 | 4 % Copyright (C) 2000, 2001 Free Software Foundation, Inc. |
5 % | |
6 % This file is part of GNU Emacs. | |
7 % | |
8 % GNU Emacs is free software; you can redistribute it and/or modify | |
9 % it under the terms of the GNU General Public License as published by | |
10 % the Free Software Foundation; either version 2, or (at your option) | |
11 % any later version. | |
12 % | |
13 % GNU Emacs is distributed in the hope that it will be useful, | |
14 % but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 % GNU General Public License for more details. | |
17 % | |
18 % You should have received a copy of the GNU General Public License | |
19 % along with GNU Emacs; see the file COPYING. If not, write to the | |
20 % Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
21 % Boston, MA 02111-1307, USA. | |
22 | |
27165 | 23 % ISOLatin1Encoding stolen from ps_init.ps in GhostScript 2.6.1.4: |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
24 /ISOLatin1Encoding where{pop}{ |
27165 | 25 % -- The ISO Latin-1 encoding vector isn't known, so define it. |
26 % -- The first half is the same as the standard encoding, | |
27 % -- except for minus instead of hyphen at code 055. | |
28 /ISOLatin1Encoding | |
29 StandardEncoding 0 45 getinterval aload pop | |
30 /minus | |
31 StandardEncoding 46 82 getinterval aload pop | |
32 %*** NOTE: the following are missing in the Adobe documentation, | |
33 %*** but appear in the displayed table: | |
34 %*** macron at 0225, dieresis at 0230, cedilla at 0233, space at 0240. | |
35 % 0200 (128) | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
36 /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
37 /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
38 /dotlessi/grave/acute/circumflex/tilde/macron/breve/dotaccent |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
39 /dieresis/.notdef/ring/cedilla/.notdef/hungarumlaut/ogonek/caron |
27165 | 40 % 0240 (160) |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
41 /space/exclamdown/cent/sterling |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
42 /currency/yen/brokenbar/section |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
43 /dieresis/copyright/ordfeminine/guillemotleft |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
44 /logicalnot/hyphen/registered/macron |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
45 /degree/plusminus/twosuperior/threesuperior |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
46 /acute/mu/paragraph/periodcentered |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
47 /cedilla/onesuperior/ordmasculine/guillemotright |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
48 /onequarter/onehalf/threequarters/questiondown |
27165 | 49 % 0300 (192) |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
50 /Agrave/Aacute/Acircumflex/Atilde |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
51 /Adieresis/Aring/AE/Ccedilla |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
52 /Egrave/Eacute/Ecircumflex/Edieresis |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
53 /Igrave/Iacute/Icircumflex/Idieresis |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
54 /Eth/Ntilde/Ograve/Oacute |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
55 /Ocircumflex/Otilde/Odieresis/multiply |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
56 /Oslash/Ugrave/Uacute/Ucircumflex |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
57 /Udieresis/Yacute/Thorn/germandbls |
27165 | 58 % 0340 (224) |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
59 /agrave/aacute/acircumflex/atilde |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
60 /adieresis/aring/ae/ccedilla |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
61 /egrave/eacute/ecircumflex/edieresis |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
62 /igrave/iacute/icircumflex/idieresis |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
63 /eth/ntilde/ograve/oacute |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
64 /ocircumflex/otilde/odieresis/divide |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
65 /oslash/ugrave/uacute/ucircumflex |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
66 /udieresis/yacute/thorn/ydieresis |
27165 | 67 256 packedarray def |
68 }ifelse | |
69 | |
70 /reencodeFontISO{ %def | |
71 dup | |
72 length 12 add dict % Make a new font (a new dict the same size | |
73 % as the old one) with room for our new symbols. | |
74 | |
75 begin % Make the new font the current dictionary. | |
76 | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
77 % Copy each of the symbols from the old dictionary |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
78 % to the new one except for the font ID. |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
79 {1 index/FID ne{def}{pop pop}ifelse}forall |
27165 | 80 |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
81 % Override the encoding with the ISOLatin1 encoding. |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
82 currentdict/FontType get 0 ne{/Encoding ISOLatin1Encoding def}if |
27165 | 83 |
84 % Use the font's bounding box to determine the ascent, descent, | |
85 % and overall height; don't forget that these values have to be | |
86 % transformed using the font's matrix. | |
87 | |
88 % ^ (x2 y2) | |
89 % | | | |
90 % | v | |
91 % | +----+ - - | |
92 % | | | ^ | |
93 % | | | | Ascent (usually > 0) | |
94 % | | | | | |
95 % (0 0) -> +--+----+--------> | |
96 % | | | | |
97 % | | v Descent (usually < 0) | |
98 % (x1 y1) --> +----+ - - | |
99 | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
100 currentdict/FontType get 0 ne |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
101 {/FontBBox load aload pop % -- x1 y1 x2 y2 |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
102 FontMatrix transform/Ascent exch def pop |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
103 FontMatrix transform/Descent exch def pop} |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
104 {/PrimaryFont FDepVector 0 get def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
105 PrimaryFont/FontBBox get aload pop |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
106 PrimaryFont/FontMatrix get transform/Ascent exch def pop |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
107 PrimaryFont/FontMatrix get transform/Descent exch def pop}ifelse |
27165 | 108 |
109 /FontHeight Ascent Descent sub def % use `sub' because descent < 0 | |
110 | |
111 % Define these in case they're not in the FontInfo | |
112 % (also, here they're easier to get to). | |
113 /UnderlinePosition Descent 0.70 mul def | |
114 /OverlinePosition Descent UnderlinePosition sub Ascent add def | |
115 /StrikeoutPosition Ascent 0.30 mul def | |
116 /LineThickness FontHeight 0.05 mul def | |
117 /Xshadow FontHeight 0.08 mul def | |
118 /Yshadow FontHeight -0.09 mul def | |
119 /SpaceBackground Descent neg UnderlinePosition add def | |
120 /XBox Descent neg def | |
121 /YBox LineThickness 0.7 mul def | |
122 | |
123 currentdict % Leave the new font on the stack | |
124 end % Stop using the font as the current dictionary. | |
125 definefont % Put the font into the font dictionary | |
126 pop % Discard the returned font. | |
127 }bind def | |
128 | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
129 % Font definition |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
130 /DefFont{findfont exch scalefont reencodeFontISO}def |
27165 | 131 |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
132 % Font selection |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
133 /F{ |
27165 | 134 findfont |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
135 dup/Ascent get/Ascent exch def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
136 dup/Descent get/Descent exch def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
137 dup/FontHeight get/FontHeight exch def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
138 dup/UnderlinePosition get/UnderlinePosition exch def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
139 dup/OverlinePosition get/OverlinePosition exch def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
140 dup/StrikeoutPosition get/StrikeoutPosition exch def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
141 dup/LineThickness get/LineThickness exch def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
142 dup/Xshadow get/Xshadow exch def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
143 dup/Yshadow get/Yshadow exch def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
144 dup/SpaceBackground get/SpaceBackground exch def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
145 dup/XBox get/XBox exch def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
146 dup/YBox get/YBox exch def |
27165 | 147 setfont |
148 }def | |
149 | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
150 /FG/setrgbcolor load def |
27165 | 151 |
152 /bg false def | |
153 /BG{ | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
154 dup/bg exch def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
155 {[4 1 roll]} |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
156 {[1.0 1.0 1.0]} |
27165 | 157 ifelse |
158 /bgcolor exch def | |
159 }def | |
160 | |
161 % B width C | |
162 % +-----------+ | |
163 % | Ascent (usually > 0) | |
164 % A + + | |
165 % | Descent (usually < 0) | |
166 % +-----------+ | |
167 % E width D | |
168 | |
169 /dobackground{ % width -- | |
170 currentpoint % -- width x y | |
171 gsave | |
172 newpath | |
173 moveto % A (x y) | |
174 0 Ascent rmoveto % B | |
175 dup 0 rlineto % C | |
176 0 Descent Ascent sub rlineto % D | |
177 neg 0 rlineto % E | |
178 closepath | |
28428
b2d43a699564
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28284
diff
changeset
|
179 FillBgColor |
27165 | 180 grestore |
181 }def | |
182 | |
183 /eolbg{ % dobackground until right margin | |
184 PrintWidth % -- x-eol | |
185 currentpoint pop % -- cur-x | |
186 sub % -- width until eol | |
187 dobackground | |
188 }def | |
189 | |
37138
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
190 /LineHS LineHeight LineSpacing add def |
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
191 /ParagraphHS LineHeight ParagraphSpacing add def |
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
192 /PSL{/h exch def bg{eolbg}if 0 currentpoint exch pop h sub moveto}def |
27165 | 193 /PLN{PrintLineNumber{doLineNumber}if}def |
194 | |
37138
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
195 /SL{LineHS PSL isLineStep pop}def % Soft Linefeed |
27165 | 196 |
37138
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
197 /PHL{ParagraphHS PSL PLN}def % Paragraph Hard Linefeed |
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
198 /LHL{LineHS PSL PLN}def % Hard Linefeed |
27165 | 199 |
200 % Some debug | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
201 /dcp{currentpoint exch 40 string cvs print(, )print =}def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
202 /dp{print 2 copy exch 40 string cvs print(, )print =}def |
27165 | 203 |
204 /W{ | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
205 ( )stringwidth % Get the width of a space in the current font. |
27165 | 206 pop % Discard the Y component. |
207 mul % Multiply the width of a space | |
208 % by the number of spaces to plot | |
209 bg{dup dobackground}if | |
210 0 rmoveto | |
211 }def | |
212 | |
37138
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
213 /Effect 0 def |
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
214 /EffectUnderline false def |
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
215 /EffectStrikeout false def |
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
216 /EffectOverline false def |
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
217 /EffectShadow false def |
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
218 /EffectBox false def |
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
219 /EffectOutline false def |
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
220 |
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
221 % effect: 1 - underline 2 - strikeout 4 - overline |
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
222 % 8 - shadow 16 - box 32 - outline |
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
223 /EF{ |
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
224 /Effect exch def |
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
225 /EffectUnderline Effect 1 and 0 ne def |
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
226 /EffectStrikeout Effect 2 and 0 ne def |
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
227 /EffectOverline Effect 4 and 0 ne def |
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
228 /EffectShadow Effect 8 and 0 ne def |
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
229 /EffectBox Effect 16 and 0 ne def |
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
230 /EffectOutline Effect 32 and 0 ne def |
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
231 }def |
27165 | 232 |
233 % stack: string |- -- | |
234 /S{ | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
235 /xx currentpoint dup Descent add/yy exch def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
236 Ascent add/YY exch def def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
237 dup stringwidth pop xx add/XX exch def |
37138
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
238 EffectShadow{ |
27165 | 239 /yy yy Yshadow add def |
240 /XX XX Xshadow add def | |
241 }if | |
242 bg{ | |
243 true | |
37138
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
244 EffectBox |
27165 | 245 {SpaceBackground doBox} |
246 {xx yy XX YY doRect} | |
247 ifelse | |
248 }if % background | |
37138
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
249 EffectBox {false 0 doBox}if % box |
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
250 EffectShadow {dup doShadow}if % shadow |
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
251 EffectOutline |
27165 | 252 {true doOutline} % outline |
253 {show} % normal text | |
254 ifelse | |
37138
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
255 EffectUnderline{UnderlinePosition Hline}if % underline |
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
256 EffectStrikeout{StrikeoutPosition Hline}if % strikeout |
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
257 EffectOverline {OverlinePosition Hline}if % overline |
27165 | 258 }bind def |
259 | |
260 % stack: position |- -- | |
261 /Hline{ | |
262 currentpoint exch pop add dup | |
263 gsave | |
264 newpath | |
265 xx exch moveto | |
266 XX exch lineto | |
267 closepath | |
268 LineThickness setlinewidth stroke | |
269 grestore | |
270 }bind def | |
271 | |
272 % stack: fill-or-not delta |- -- | |
273 /doBox{ | |
274 /dd exch def | |
275 xx XBox sub dd sub yy YBox sub dd sub | |
276 XX XBox add dd add YY YBox add dd add | |
277 doRect | |
278 }bind def | |
279 | |
280 % stack: fill-or-not lower-x lower-y upper-x upper-y |- -- | |
281 /doRect{ | |
282 /rYY exch def | |
283 /rXX exch def | |
284 /ryy exch def | |
285 /rxx exch def | |
286 gsave | |
287 newpath | |
288 rXX rYY moveto | |
289 rxx rYY lineto | |
290 rxx ryy lineto | |
291 rXX ryy lineto | |
292 closepath | |
293 % top of stack: fill-or-not | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
294 {FillBgColor} |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
295 {LineThickness setlinewidth stroke}ifelse |
27165 | 296 grestore |
297 }bind def | |
298 | |
299 % stack: string |- -- | |
300 /doShadow{ | |
301 gsave | |
302 Xshadow Yshadow rmoveto | |
303 false doOutline | |
304 grestore | |
305 }bind def | |
306 | |
307 /st 1 string def | |
308 | |
309 % stack: string fill-or-not |- -- | |
310 /doOutline{ | |
311 /-fillp- exch def | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
312 /-ox- currentpoint/-oy- exch def def |
27165 | 313 gsave |
314 LineThickness setlinewidth | |
315 {st 0 3 -1 roll put | |
316 st dup true charpath | |
317 -fillp- {gsave FillBgColor grestore}if | |
318 stroke stringwidth | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
319 -oy- add/-oy- exch def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
320 -ox- add/-ox- exch def |
27165 | 321 -ox- -oy- moveto |
322 }forall | |
323 grestore | |
324 -ox- -oy- moveto | |
325 }bind def | |
326 | |
327 % stack: -- | |
328 /FillBgColor{bgcolor aload pop setrgbcolor fill}bind def | |
329 | |
28762
8e8534ef4b0a
PostScript level 1 compatibility, Upside-down
Gerd Moellmann <gerd@gnu.org>
parents:
28428
diff
changeset
|
330 % stack: -- |- boolean |
8e8534ef4b0a
PostScript level 1 compatibility, Upside-down
Gerd Moellmann <gerd@gnu.org>
parents:
28428
diff
changeset
|
331 /isLineStep{ |
8e8534ef4b0a
PostScript level 1 compatibility, Upside-down
Gerd Moellmann <gerd@gnu.org>
parents:
28428
diff
changeset
|
332 SyncLineZebra |
28980
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
333 {PLScounter 0 gt % or zebra |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
334 {/PLScounter PLScounter 1 sub def PLScounter 0 eq} |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
335 {false}ifelse |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
336 PrintLineStep 1 gt |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
337 {/PrintLineStep PrintLineStep 1 sub def} |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
338 {/PrintLineStep ZebraHeight def |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
339 /PLScounter PrintLineStart def}ifelse} |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
340 {LineNumber PrintLineStart sub PrintLineStep mod 0 eq}ifelse % or line step |
28762
8e8534ef4b0a
PostScript level 1 compatibility, Upside-down
Gerd Moellmann <gerd@gnu.org>
parents:
28428
diff
changeset
|
341 }def |
8e8534ef4b0a
PostScript level 1 compatibility, Upside-down
Gerd Moellmann <gerd@gnu.org>
parents:
28428
diff
changeset
|
342 |
27165 | 343 % stack: -- |
344 /doLineNumber{ | |
345 /LineNumber where | |
28762
8e8534ef4b0a
PostScript level 1 compatibility, Upside-down
Gerd Moellmann <gerd@gnu.org>
parents:
28428
diff
changeset
|
346 {pop |
8e8534ef4b0a
PostScript level 1 compatibility, Upside-down
Gerd Moellmann <gerd@gnu.org>
parents:
28428
diff
changeset
|
347 isLineStep % or line step |
8e8534ef4b0a
PostScript level 1 compatibility, Upside-down
Gerd Moellmann <gerd@gnu.org>
parents:
28428
diff
changeset
|
348 LineNumber Lines ge or % or last line |
8e8534ef4b0a
PostScript level 1 compatibility, Upside-down
Gerd Moellmann <gerd@gnu.org>
parents:
28428
diff
changeset
|
349 {currentfont |
27165 | 350 gsave |
37288
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
351 LineNumberColor SetColor |
27165 | 352 /L0 findfont setfont |
353 LineNumber Lines ge | |
28762
8e8534ef4b0a
PostScript level 1 compatibility, Upside-down
Gerd Moellmann <gerd@gnu.org>
parents:
28428
diff
changeset
|
354 {(end )} |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
355 {LineNumber 6 string cvs( )strcat}ifelse |
27165 | 356 dup stringwidth pop neg 0 rmoveto |
357 show | |
358 grestore | |
28762
8e8534ef4b0a
PostScript level 1 compatibility, Upside-down
Gerd Moellmann <gerd@gnu.org>
parents:
28428
diff
changeset
|
359 setfont}if |
27165 | 360 /LineNumber LineNumber 1 add def |
361 }if | |
362 }def | |
363 | |
28428
b2d43a699564
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28284
diff
changeset
|
364 % stack: color-specifier |- -- |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
365 /SetColor{dup type/realtype eq{setgray}{aload pop setrgbcolor}ifelse}def |
28428
b2d43a699564
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28284
diff
changeset
|
366 |
27165 | 367 % stack: -- |
368 /printZebra{ | |
369 gsave | |
28428
b2d43a699564
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28284
diff
changeset
|
370 ZebraColor SetColor |
27165 | 371 /double-zebra ZebraHeight ZebraHeight add def |
37138
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
372 /yiter double-zebra LineHS mul neg def |
27165 | 373 /xiter PrintWidth InterColumn add def |
34918
3256440cb4bf
Handle form feed better when ps-zebra-stripe-follow
Gerd Moellmann <gerd@gnu.org>
parents:
34046
diff
changeset
|
374 /zebra-line LinesPrinted def |
27165 | 375 NumberOfColumns{LinesPerColumn doColumnZebra xiter 0 rmoveto}repeat |
376 grestore | |
377 }def | |
378 | |
379 % stack: lines-per-column |- -- | |
380 /doColumnZebra{ | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
381 /lpc exch def |
27165 | 382 gsave |
36216
aa6d6e43792f
Code fix to support `ps-zebra-stripe-follow'
Gerd Moellmann <gerd@gnu.org>
parents:
34918
diff
changeset
|
383 ZebraFollow 1 and 0 ne{ |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
384 /H ZebraHeight zebra-line ZebraHeight mod sub def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
385 /lpc lpc H sub def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
386 zebra-line double-zebra mod ZebraHeight lt |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
387 {H doZebra % "black" stripe followed by a "white" stripe |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
388 /lpc lpc ZebraHeight sub def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
389 H ZebraHeight add} |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
390 {H}ifelse % "white" stripe |
37138
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
391 LineHS mul neg 0 exch rmoveto |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
392 /zebra-line zebra-line LinesPerColumn add def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
393 }if |
37138
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
394 /zspacing 0 def |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
395 lpc dup double-zebra idiv{ZebraHeight doZebra 0 yiter rmoveto}repeat |
36216
aa6d6e43792f
Code fix to support `ps-zebra-stripe-follow'
Gerd Moellmann <gerd@gnu.org>
parents:
34918
diff
changeset
|
396 double-zebra mod dup 0 le{pop} |
37138
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
397 {dup ZebraHeight gt |
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
398 {pop ZebraHeight} |
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
399 {/zspacing LineSpacing def |
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
400 ZebraFollow 2 and 0 ne{pop ZebraHeight}if}ifelse |
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
401 doZebra}ifelse |
27165 | 402 grestore |
403 }def | |
404 | |
405 % stack: zebra-height (in lines) |- -- | |
406 /doZebra{ | |
37138
b582e8e39870
Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents:
36223
diff
changeset
|
407 /zh exch 0.05 sub LineHS mul zspacing sub def |
27165 | 408 gsave |
409 0 LineHeight 0.65 mul rmoveto | |
410 PrintWidth 0 rlineto | |
411 0 zh neg rlineto | |
412 PrintWidth neg 0 rlineto | |
413 0 zh rlineto | |
414 fill | |
415 grestore | |
416 }def | |
417 | |
28428
b2d43a699564
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28284
diff
changeset
|
418 % stack: -- |
b2d43a699564
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28284
diff
changeset
|
419 /printBackground{ |
b2d43a699564
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28284
diff
changeset
|
420 /BackgroundColor where{ |
b2d43a699564
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28284
diff
changeset
|
421 pop gsave BackgroundColor SetColor |
b2d43a699564
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28284
diff
changeset
|
422 NumberOfColumns{ |
b2d43a699564
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28284
diff
changeset
|
423 gsave |
b2d43a699564
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28284
diff
changeset
|
424 0 LineHeight 0.65 mul rmoveto |
b2d43a699564
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28284
diff
changeset
|
425 PrintWidth 0 rlineto |
b2d43a699564
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28284
diff
changeset
|
426 0 PrintHeight neg rlineto |
b2d43a699564
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28284
diff
changeset
|
427 PrintWidth neg 0 rlineto |
b2d43a699564
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28284
diff
changeset
|
428 0 PrintHeight rlineto |
b2d43a699564
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28284
diff
changeset
|
429 fill |
b2d43a699564
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28284
diff
changeset
|
430 grestore |
b2d43a699564
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28284
diff
changeset
|
431 PrintWidth InterColumn add 0 rmoveto |
b2d43a699564
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28284
diff
changeset
|
432 }repeat |
b2d43a699564
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28284
diff
changeset
|
433 grestore |
b2d43a699564
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28284
diff
changeset
|
434 }if |
b2d43a699564
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28284
diff
changeset
|
435 }def |
b2d43a699564
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28284
diff
changeset
|
436 |
27165 | 437 % tx ty rotation xscale yscale xpos ypos BeginBackImage |
438 /BeginBackImage{ | |
439 /-save-image- save def | |
440 /showpage{}def | |
441 translate | |
442 scale | |
443 rotate | |
444 translate | |
445 }def | |
446 | |
447 /EndBackImage{-save-image- restore}def | |
448 | |
449 % string fontsize fontname rotation gray xpos ypos ShowBackText | |
450 /ShowBackText{ | |
451 gsave | |
452 translate | |
453 setgray | |
454 rotate | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
455 findfont exch dup/-offset- exch -0.25 mul def scalefont setfont |
27165 | 456 0 -offset- moveto |
457 /-saveLineThickness- LineThickness def | |
458 /LineThickness 1 def | |
459 false doOutline | |
460 /LineThickness -saveLineThickness- def | |
461 grestore | |
462 }def | |
463 | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
464 /SetPageSize{ |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
465 BMark/PageSize[PageWidth LandscapePageHeight LandscapeMode{exch}if]EMark setpagedevice |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
466 }def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
467 |
27165 | 468 /BeginDoc{ |
469 % ---- Remember space width of the normal text font `f0'. | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
470 /SpaceWidth/f0 findfont setfont( )stringwidth pop def |
27165 | 471 % ---- save the state of the document (useful for ghostscript!) |
472 /docState save def | |
473 % ---- [andrewi] set PageSize based on chosen dimensions | |
474 UseSetpagedevice{ | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
475 WarnPaperSize{SetPageSize}{mark{SetPageSize}stopped cleartomark}ifelse |
27165 | 476 }if |
477 /ColumnWidth PrintWidth InterColumn add def | |
478 % ---- define where printing will start | |
479 /f0 F % this installs Ascent | |
480 /PrintStartY PrintHeight Ascent sub def | |
481 /ColumnIndex 1 def | |
482 /N-Up-Counter N-Up-End 1 sub def | |
28980
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
483 /PLScounter PrintLineStart def |
27165 | 484 }def |
485 | |
486 /EndDoc{ | |
487 % ---- restore the state of the document (useful for ghostscript!) | |
488 docState restore | |
489 }def | |
490 | |
491 /BeginDSCPage{ | |
492 % ---- when 1st column, save the state of the page | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
493 ColumnIndex 1 eq{/pageState save def}if |
27165 | 494 % ---- save the state of the column |
495 /columnState save def | |
496 }def | |
497 | |
498 /PrintHeaderWidth PrintOnlyOneHeader{PrintPageWidth}{PrintWidth}ifelse def | |
499 | |
500 /BeginPage{ | |
34918
3256440cb4bf
Handle form feed better when ps-zebra-stripe-follow
Gerd Moellmann <gerd@gnu.org>
parents:
34046
diff
changeset
|
501 /LinesPrinted exch def |
27165 | 502 % ---- when 1st column, print all background effects |
503 ColumnIndex 1 eq{ | |
504 0 PrintStartY moveto % move to where printing will start | |
28428
b2d43a699564
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28284
diff
changeset
|
505 printBackground |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
506 Zebra{printZebra}if |
27165 | 507 printGlobalBackground |
508 printLocalBackground | |
509 }if | |
37288
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
510 PrintOnlyOneHeader{ColumnIndex 1 eq}{true}ifelse |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
511 dup PrintHeader and{ |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
512 PrintHeaderFrame{HeaderFrame}if |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
513 HeaderText |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
514 }if |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
515 PrintFooter and{ |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
516 PrintFooterFrame{FooterFrame}if |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
517 FooterText |
27165 | 518 }if |
519 0 PrintStartY moveto % move to where printing will start | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
520 /LineNumber where |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
521 {pop |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
522 SyncLineZebra |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
523 {/H PageNumber 1 sub NumberOfColumns mul ColumnIndex 1 sub add |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
524 LinesPerColumn mul ZebraHeight mod def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
525 /PLScounter H PrintLineStart ge{0}{PrintLineStart H sub}ifelse def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
526 /PrintLineStep ZebraHeight H sub def}if}if |
27165 | 527 PLN |
528 }def | |
529 | |
530 /EndPage{bg{eolbg}if}def | |
531 | |
532 /EndDSCPage{ | |
533 ColumnIndex NumberOfColumns eq{ | |
534 % ---- restore the state of the page | |
535 pageState restore | |
536 /ColumnIndex 1 def | |
537 % ---- N-up printing | |
538 N-Up 1 gt{ | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
539 N-Up-Counter 0 gt |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
540 {% ---- Next page on same row |
27165 | 541 /N-Up-Counter N-Up-Counter 1 sub def |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
542 N-Up-XColumn N-Up-YColumn} |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
543 {% ---- Next page on next line |
27165 | 544 /N-Up-Counter N-Up-End 1 sub def |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
545 N-Up-XLine N-Up-YLine}ifelse |
27165 | 546 translate |
547 }if | |
548 }{ % else | |
549 % ---- restore the state of the current column | |
550 columnState restore | |
551 % ---- and translate to the next column | |
552 ColumnWidth 0 translate | |
553 /ColumnIndex ColumnIndex 1 add def | |
554 }ifelse | |
555 }def | |
556 | |
37288
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
557 /TextStart{ |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
558 LeftMargin BottomMargin |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
559 PrintFooter{ |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
560 FooterPad add |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
561 FooterLines FooterLineHeight mul add |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
562 FooterPad add |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
563 FooterOffset add}if |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
564 }def |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
565 |
27165 | 566 % stack: number-of-pages-per-sheet |- -- |
567 /BeginSheet{ | |
568 /sheetState save def | |
569 /pages-per-sheet exch def | |
28980
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
570 |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
571 % ---- translate to bottom-right corner of Portrait page |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
572 LandscapeMode{ |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
573 LandscapePageHeight 0 translate |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
574 90 rotate |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
575 }if |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
576 % ---- [jack] Kludge: my ghostscript window is 21x27.7 instead of 21x29.7 |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
577 /JackGhostscript where{pop 1 27.7 29.7 div scale}if |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
578 UpsideDown{PageWidth LandscapePageHeight translate 180 rotate}if |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
579 % ---- N-Up printing |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
580 N-Up 1 gt{ |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
581 % ---- landscape |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
582 N-Up-Landscape{ |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
583 PageWidth 0 translate |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
584 90 rotate |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
585 }if |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
586 N-Up-Margin dup translate |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
587 % ---- scale |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
588 LandscapeMode{ |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
589 /HH PageWidth def |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
590 /WW LandscapePageHeight def |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
591 }{ |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
592 /HH LandscapePageHeight def |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
593 /WW PageWidth def |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
594 }ifelse |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
595 /xx 0 def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
596 N-Up-Landscape{ |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
597 /ww WW WW mul N-Up-Lines HH mul div def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
598 /cc HH N-Up-Columns N-Up-Missing add div def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
599 ww cc gt{/xx WW def/WW cc ww div WW mul def/xx xx WW sub def}if |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
600 }{ |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
601 /hh HH N-Up-Columns N-Up-Missing add div def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
602 /cc HH N-Up-Lines div def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
603 hh cc gt{/xx WW def/WW cc hh div WW mul def/xx xx WW sub def}if |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
604 }ifelse |
28980
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
605 WW N-Up-Margin sub N-Up-Margin sub |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
606 N-Up-Landscape |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
607 {N-Up-Lines div HH} |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
608 {N-Up-Columns N-Up-Missing add div WW}ifelse |
28980
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
609 div dup scale |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
610 LandscapeMode{/yy 0 def}{/yy xx def/xx 0 def}ifelse |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
611 xx N-Up-Repeat 1 sub LandscapePageHeight mul yy add translate |
28980
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
612 % ---- go to start position in page matrix |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
613 N-Up-XStart N-Up-Missing 0.5 mul |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
614 LandscapeMode |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
615 {LandscapePageHeight mul N-Up-YStart add} |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
616 {PageWidth mul add N-Up-YStart}ifelse |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
617 translate |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
618 }if |
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
619 % ---- translate to lower left corner of TEXT |
37288
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
620 TextStart translate |
28980
66e571cf74c6
PostScript code compatibility with other utilities
Gerd Moellmann <gerd@gnu.org>
parents:
28762
diff
changeset
|
621 |
27165 | 622 % ---- N-up printing |
623 N-Up 1 gt N-Up-Border and pages-per-sheet 0 gt and{ | |
624 % ---- page border | |
625 gsave | |
626 0 setgray | |
37288
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
627 TextStart exch neg exch neg moveto |
27165 | 628 N-Up-Repeat |
629 {N-Up-End | |
630 {gsave | |
631 PageWidth 0 rlineto | |
632 0 LandscapePageHeight rlineto | |
633 PageWidth neg 0 rlineto | |
634 closepath stroke | |
635 grestore | |
636 /pages-per-sheet pages-per-sheet 1 sub def | |
637 pages-per-sheet 0 le{exit}if | |
638 N-Up-XColumn N-Up-YColumn rmoveto | |
639 }repeat | |
640 pages-per-sheet 0 le{exit}if | |
641 N-Up-XLine N-Up-XColumn sub N-Up-YLine rmoveto | |
642 }repeat | |
643 grestore | |
644 }if | |
645 }def | |
646 | |
647 /EndSheet{ | |
648 showpage | |
649 sheetState restore | |
650 }def | |
651 | |
652 /SetHeaderLines{ % nb-lines -- | |
653 /HeaderLines exch def | |
654 % ---- bottom up | |
655 HeaderPad | |
656 HeaderLines 1 sub HeaderLineHeight mul add | |
657 HeaderTitleLineHeight add | |
658 HeaderPad add | |
659 /HeaderHeight exch def | |
660 }def | |
661 | |
37288
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
662 /SetFooterLines{ % nb-lines -- |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
663 /FooterLines exch def |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
664 % ---- bottom up |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
665 FooterPad |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
666 FooterLines FooterLineHeight mul add |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
667 FooterPad add |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
668 /FooterHeight exch def |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
669 }def |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
670 |
27165 | 671 % |---------| |
672 % | tm | | |
673 % |---------| | |
674 % | header | | |
675 % |-+-------| <-- (x y) | |
676 % | ho | | |
677 % |---------| | |
678 % | text | | |
37288
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
679 % |---------| |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
680 % | fo | |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
681 % |---------| |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
682 % | footer | |
27165 | 683 % |-+-------| <-- (0 0) |
684 % | bm | | |
685 % |---------| | |
686 | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
687 % -- |- x y |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
688 /HeaderFrameStart{0 PrintHeight HeaderOffset add}def |
37288
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
689 /FooterFrameStart{0 FooterHeight FooterOffset add neg}def |
27165 | 690 |
37288
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
691 /doFramePath{ |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
692 /h exch def |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
693 PrintHeaderWidth 0 rlineto |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
694 0 h rlineto |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
695 PrintHeaderWidth neg 0 rlineto |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
696 0 h neg rlineto |
27165 | 697 }def |
698 | |
37288
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
699 /HeaderFramePath{HeaderHeight doFramePath}def |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
700 /FooterFramePath{FooterHeight doFramePath}def |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
701 |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
702 % /path-fun /start-fun vector-property doFrame |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
703 /doFrame{ |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
704 /vecFrame exch def |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
705 /startFrame exch load def |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
706 /pathFrame exch load def |
27165 | 707 gsave |
37288
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
708 vecFrame 2 get setlinewidth % frame border width |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
709 % ---- do the shadow of the next rectangle |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
710 startFrame moveto |
27165 | 711 1 -1 rmoveto |
37288
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
712 pathFrame |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
713 vecFrame 4 get SetColor fill % frame shadow color |
27165 | 714 % ---- do the next rectangle ... |
37288
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
715 startFrame moveto |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
716 pathFrame |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
717 gsave vecFrame 1 get SetColor fill grestore % frame background |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
718 gsave vecFrame 3 get SetColor stroke grestore % frame border color |
27165 | 719 grestore |
720 }def | |
721 | |
37288
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
722 /HeaderFrame{/HeaderFramePath /HeaderFrameStart HeaderFrameProperties doFrame}def |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
723 /FooterFrame{/FooterFramePath /FooterFrameStart FooterFrameProperties doFrame}def |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
724 |
27165 | 725 /HeaderStart{ |
726 HeaderFrameStart | |
727 exch HeaderPad add exch % horizontal pad | |
728 % ---- bottom up | |
729 HeaderPad add % vertical pad | |
730 HeaderDescent sub | |
731 HeaderLineHeight HeaderLines 1 sub mul add | |
732 }def | |
733 | |
37288
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
734 /FooterStart{ |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
735 FooterFrameStart |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
736 exch FooterPad add exch % horizontal pad |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
737 % ---- bottom up |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
738 FooterPad add % vertical pad |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
739 FooterDescent sub |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
740 FooterLineHeight FooterLines 1 sub mul add |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
741 }def |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
742 |
27165 | 743 /strcat{ |
744 dup length 3 -1 roll dup length dup 4 -1 roll add string dup | |
745 0 5 -1 roll putinterval | |
746 dup 4 2 roll exch putinterval | |
747 }def | |
748 | |
749 /pagenumberstring{ | |
750 PageNumber 32 string cvs | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
751 ShowNofN{(/)strcat PageCount 32 string cvs strcat}if |
27165 | 752 }def |
753 | |
37288
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
754 % lines is-right HeaderOrFooterTextLines |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
755 /HeaderOrFooterTextLines{ |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
756 /is_right exch def |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
757 HFStart moveto |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
758 { % ---- process the lines |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
759 aload pop |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
760 exch F |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
761 gsave |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
762 dup xcheck{exec}if |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
763 is_right{ |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
764 dup stringwidth pop |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
765 PrintHeaderWidth exch sub HFPad HFPad add sub 0 rmoveto |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
766 }if |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
767 HFColor SetColor |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
768 show |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
769 grestore |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
770 0 HFLineHeight neg rmoveto |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
771 }forall |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
772 }def |
27165 | 773 |
37288
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
774 % right-lines left-lines /start lineheight pad fore-color HeaderOrFooterText |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
775 /HeaderOrFooterText{ |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
776 /HFColor exch def |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
777 /HFPad exch def |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
778 /HFLineHeight exch def |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
779 /HFStart exch load def |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
780 |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
781 % -- rightLines leftLines -- at stack |
27165 | 782 |
783 % ---- hack: `PN 1 and' == `PN 2 modulo' | |
784 % ---- if even page number and duplex, then exchange left and right | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
785 PageNumber 1 and 0 eq SwitchHeader and{exch}if |
27165 | 786 |
37288
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
787 % ---- process the left lines |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
788 false HeaderOrFooterTextLines |
27165 | 789 |
37288
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
790 % ---- process the right lines |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
791 true HeaderOrFooterTextLines |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
792 }def |
27165 | 793 |
37288
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
794 /HeaderText{ |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
795 HeaderLinesRight HeaderLinesLeft |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
796 /HeaderStart HeaderLineHeight HeaderPad |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
797 HeaderFrameProperties 0 get |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
798 HeaderOrFooterText |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
799 }def |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
800 |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
801 /FooterText{ |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
802 FooterLinesRight FooterLinesLeft |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
803 /FooterStart FooterLineHeight FooterPad |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
804 FooterFrameProperties 0 get |
f7aaa73f592e
Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
37138
diff
changeset
|
805 HeaderOrFooterText |
27165 | 806 }def |
807 | |
808 /ReportFontInfo{ | |
809 2 copy | |
810 /t0 3 1 roll DefFont | |
811 /t0 F | |
812 /lh FontHeight def | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
813 /sw( )stringwidth pop def |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
814 /aw(01234567890abcdefghijklmnopqrstuvwxyz)dup length exch |
27165 | 815 stringwidth pop exch div def |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
816 /t1 12/Helvetica-Oblique DefFont |
27165 | 817 /t1 F |
818 gsave | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
819 (languagelevel = )show |
28428
b2d43a699564
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28284
diff
changeset
|
820 languagelevel 32 string cvs show |
27165 | 821 grestore |
822 0 FontHeight neg rmoveto | |
823 gsave | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
824 (For )show |
27165 | 825 128 string cvs show |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
826 ( )show |
27165 | 827 32 string cvs show |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
828 ( point, the line height is )show |
27165 | 829 lh 32 string cvs show |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
830 (, the space width is )show |
27165 | 831 sw 32 string cvs show |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
832 (,)show |
27165 | 833 grestore |
834 0 FontHeight neg rmoveto | |
835 gsave | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
836 (and a crude estimate of average character width is )show |
27165 | 837 aw 32 string cvs show |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
838 (.)show |
27165 | 839 grestore |
840 0 FontHeight neg rmoveto | |
841 }def | |
842 | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
843 % cm to point |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
844 /cm{72 mul 2.54 div}def |
27165 | 845 |
846 /ReportAllFontInfo{ | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
847 % key = font name value = font dictionary |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
848 FontDirectory{pop 10 exch ReportFontInfo}forall |
27165 | 849 }def |
850 | |
29495
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
851 % 3 cm 20 cm moveto 10/Courier ReportFontInfo showpage |
a6ce0d37c2cf
Insert a version number comment (5.2.2). Can
Gerd Moellmann <gerd@gnu.org>
parents:
28980
diff
changeset
|
852 % 3 cm 20 cm moveto ReportAllFontInfo showpage |
27165 | 853 |
854 % === END ps-print prologue 1 |