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