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