annotate etc/ps-prin1.ps @ 98102:172640e67bed

Merge from gnus--devo--0 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1411
author Miles Bader <miles@gnu.org>
date Tue, 09 Sep 2008 02:19:23 +0000
parents cbf5528cf447
children c90853557b90
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27165
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
3
79769
520ca9c99014 Add 2008 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 78271
diff changeset
4 % Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
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
b5a4db21c424 Add copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents: 36216
diff changeset
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
b5a4db21c424 Add copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents: 36216
diff changeset
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
b5a4db21c424 Add copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents: 36216
diff changeset
14 % GNU Emacs is distributed in the hope that it will be useful,
b5a4db21c424 Add copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents: 36216
diff changeset
15 % but WITHOUT ANY WARRANTY; without even the implied warranty of
b5a4db21c424 Add copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents: 36216
diff changeset
16 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b5a4db21c424 Add copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents: 36216
diff changeset
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
b5a4db21c424 Add copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents: 36216
diff changeset
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
b5a4db21c424 Add copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents: 36216
diff changeset
21
46014
e5675426ff4c Add license exception.
Richard M. Stallman <rms@gnu.org>
parents: 37288
diff changeset
22 % As a special exception, the copyright holders of this module give
e5675426ff4c Add license exception.
Richard M. Stallman <rms@gnu.org>
parents: 37288
diff changeset
23 % you permission to include the module in a Postscript file generated
e5675426ff4c Add license exception.
Richard M. Stallman <rms@gnu.org>
parents: 37288
diff changeset
24 % by Emacs or other free software together with the result of
e5675426ff4c Add license exception.
Richard M. Stallman <rms@gnu.org>
parents: 37288
diff changeset
25 % converting text to be printed, regardless of the license terms of
e5675426ff4c Add license exception.
Richard M. Stallman <rms@gnu.org>
parents: 37288
diff changeset
26 % that text, and to use under terms of your choice the page images
e5675426ff4c Add license exception.
Richard M. Stallman <rms@gnu.org>
parents: 37288
diff changeset
27 % resulting from formatting said combination. If you modify this
e5675426ff4c Add license exception.
Richard M. Stallman <rms@gnu.org>
parents: 37288
diff changeset
28 % module, you may extend this exception to your version of the module
e5675426ff4c Add license exception.
Richard M. Stallman <rms@gnu.org>
parents: 37288
diff changeset
29 % but you are not obligated to do so. If you do not wish to do so,
e5675426ff4c Add license exception.
Richard M. Stallman <rms@gnu.org>
parents: 37288
diff changeset
30 % delete this exception statement from your version.
e5675426ff4c Add license exception.
Richard M. Stallman <rms@gnu.org>
parents: 37288
diff changeset
31
e5675426ff4c Add license exception.
Richard M. Stallman <rms@gnu.org>
parents: 37288
diff changeset
32
27165
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
35 % -- The ISO Latin-1 encoding vector isn't known, so define it.
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
36 % -- The first half is the same as the standard encoding,
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
37 % -- except for minus instead of hyphen at code 055.
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
38 /ISOLatin1Encoding
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
39 StandardEncoding 0 45 getinterval aload pop
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
40 /minus
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
41 StandardEncoding 46 82 getinterval aload pop
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
42 %*** NOTE: the following are missing in the Adobe documentation,
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
43 %*** but appear in the displayed table:
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
44 %*** macron at 0225, dieresis at 0230, cedilla at 0233, space at 0240.
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
77 256 packedarray def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
78 }ifelse
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
79
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
80 /reencodeFontISO{ %def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
81 dup
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
82 length 12 add dict % Make a new font (a new dict the same size
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
83 % as the old one) with room for our new symbols.
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
84
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
85 begin % Make the new font the current dictionary.
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
93
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
94 % Use the font's bounding box to determine the ascent, descent,
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
95 % and overall height; don't forget that these values have to be
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
96 % transformed using the font's matrix.
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
97
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
98 % ^ (x2 y2)
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
99 % | |
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
100 % | v
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
101 % | +----+ - -
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
102 % | | | ^
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
103 % | | | | Ascent (usually > 0)
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
104 % | | | |
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
105 % (0 0) -> +--+----+-------->
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
106 % | | |
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
107 % | | v Descent (usually < 0)
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
108 % (x1 y1) --> +----+ - -
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
118
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
119 /FontHeight Ascent Descent sub def % use `sub' because descent < 0
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
120
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
121 % Define these in case they're not in the FontInfo
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
122 % (also, here they're easier to get to).
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
123 /UnderlinePosition Descent 0.70 mul def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
124 /OverlinePosition Descent UnderlinePosition sub Ascent add def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
125 /StrikeoutPosition Ascent 0.30 mul def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
126 /LineThickness FontHeight 0.05 mul def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
127 /Xshadow FontHeight 0.08 mul def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
128 /Yshadow FontHeight -0.09 mul def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
129 /SpaceBackground Descent neg UnderlinePosition add def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
130 /XBox Descent neg def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
131 /YBox LineThickness 0.7 mul def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
132
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
133 currentdict % Leave the new font on the stack
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
134 end % Stop using the font as the current dictionary.
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
135 definefont % Put the font into the font dictionary
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
136 pop % Discard the returned font.
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
137 }bind def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
157 setfont
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
158 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
161
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
162 /bg false def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
167 ifelse
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
168 /bgcolor exch def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
169 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
170
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
171 % B width C
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
172 % +-----------+
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
173 % | Ascent (usually > 0)
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
174 % A + +
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
175 % | Descent (usually < 0)
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
176 % +-----------+
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
177 % E width D
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
178
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
179 /dobackground{ % width --
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
180 currentpoint % -- width x y
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
181 gsave
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
182 newpath
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
183 moveto % A (x y)
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
184 0 Ascent rmoveto % B
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
185 dup 0 rlineto % C
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
186 0 Descent Ascent sub rlineto % D
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
187 neg 0 rlineto % E
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
188 closepath
28428
b2d43a699564 Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents: 28284
diff changeset
189 FillBgColor
27165
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
190 grestore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
191 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
192
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
193 /eolbg{ % dobackground until right margin
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
194 PrintWidth % -- x-eol
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
195 currentpoint pop % -- cur-x
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
196 sub % -- width until eol
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
197 dobackground
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
198 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
203 /PLN{PrintLineNumber{doLineNumber}if}def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
209
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
213
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
216 pop % Discard the Y component.
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
217 mul % Multiply the width of a space
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
218 % by the number of spaces to plot
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
219 bg{dup dobackground}if
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
220 0 rmoveto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
221 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
242
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
243 % stack: string |- --
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
249 /yy yy Yshadow add def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
250 /XX XX Xshadow add def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
251 }if
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
252 bg{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
253 true
37138
b582e8e39870 Line and paragraph spacing feature.
Gerd Moellmann <gerd@gnu.org>
parents: 36223
diff changeset
254 EffectBox
27165
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
255 {SpaceBackground doBox}
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
256 {xx yy XX YY doRect}
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
257 ifelse
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
262 {true doOutline} % outline
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
263 {show} % normal text
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
268 }bind def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
269
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
270 % stack: position |- --
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
271 /Hline{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
272 currentpoint exch pop add dup
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
273 gsave
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
274 newpath
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
275 xx exch moveto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
276 XX exch lineto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
277 closepath
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
278 LineThickness setlinewidth stroke
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
279 grestore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
280 }bind def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
281
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
282 % stack: fill-or-not delta |- --
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
283 /doBox{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
284 /dd exch def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
285 xx XBox sub dd sub yy YBox sub dd sub
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
286 XX XBox add dd add YY YBox add dd add
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
287 doRect
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
288 }bind def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
289
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
290 % stack: fill-or-not lower-x lower-y upper-x upper-y |- --
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
291 /doRect{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
292 /rYY exch def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
293 /rXX exch def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
294 /ryy exch def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
295 /rxx exch def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
296 gsave
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
297 newpath
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
298 rXX rYY moveto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
299 rxx rYY lineto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
300 rxx ryy lineto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
301 rXX ryy lineto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
302 closepath
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
306 grestore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
307 }bind def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
308
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
309 % stack: string |- --
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
310 /doShadow{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
311 gsave
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
312 Xshadow Yshadow rmoveto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
313 false doOutline
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
314 grestore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
315 }bind def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
316
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
317 /st 1 string def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
318
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
319 % stack: string fill-or-not |- --
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
320 /doOutline{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
323 gsave
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
324 LineThickness setlinewidth
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
325 {st 0 3 -1 roll put
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
326 st dup true charpath
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
327 -fillp- {gsave FillBgColor grestore}if
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
331 -ox- -oy- moveto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
332 }forall
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
333 grestore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
334 -ox- -oy- moveto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
335 }bind def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
336
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
337 % stack: --
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
338 /FillBgColor{bgcolor aload pop setrgbcolor fill}bind def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
353 % stack: --
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
354 /doLineNumber{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
360 gsave
37288
f7aaa73f592e Footer implementation. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 37138
diff changeset
361 LineNumberColor SetColor
27165
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
362 /L0 findfont setfont
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
366 dup stringwidth pop neg 0 rmoveto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
367 show
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
368 grestore
28762
8e8534ef4b0a PostScript level 1 compatibility, Upside-down
Gerd Moellmann <gerd@gnu.org>
parents: 28428
diff changeset
369 setfont}if
27165
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
370 /LineNumber LineNumber 1 add def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
371 }if
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
372 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
377 % stack: --
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
378 /printZebra{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
379 gsave
28428
b2d43a699564 Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents: 28284
diff changeset
380 ZebraColor SetColor
27165
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
385 NumberOfColumns{LinesPerColumn doColumnZebra xiter 0 rmoveto}repeat
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
386 grestore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
387 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
388
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
389 % stack: lines-per-column |- --
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
412 grestore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
413 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
414
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
415 % stack: zebra-height (in lines) |- --
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
418 gsave
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
419 0 LineHeight 0.65 mul rmoveto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
420 PrintWidth 0 rlineto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
421 0 zh neg rlineto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
422 PrintWidth neg 0 rlineto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
423 0 zh rlineto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
424 fill
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
425 grestore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
426 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
449 % tx ty rotation xscale yscale xpos ypos BeginBackImage
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
450 /BeginBackImage{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
451 /-save-image- save def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
452 /showpage{}def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
453 translate
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
454 scale
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
455 rotate
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
456 translate
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
457 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
458
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
459 /EndBackImage{-save-image- restore}def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
460
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
461 % string fontsize fontname rotation gray xpos ypos ShowBackText
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
462 /ShowBackText{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
463 gsave
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
464 translate
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
465 setgray
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
468 0 -offset- moveto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
469 /-saveLineThickness- LineThickness def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
470 /LineThickness 1 def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
471 false doOutline
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
472 /LineThickness -saveLineThickness- def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
473 grestore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
474 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
480 /BeginDoc{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
483 % ---- save the state of the document (useful for ghostscript!)
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
484 /docState save def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
485 % ---- [andrewi] set PageSize based on chosen dimensions
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
488 }if
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
489 /ColumnWidth PrintWidth InterColumn add def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
490 % ---- define where printing will start
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
491 /f0 F % this installs Ascent
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
492 /PrintStartY PrintHeight Ascent sub def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
493 /ColumnIndex 1 def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
496 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
497
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
498 /EndDoc{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
499 % ---- restore the state of the document (useful for ghostscript!)
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
500 docState restore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
501 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
502
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
503 /BeginDSCPage{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
506 % ---- save the state of the column
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
507 /columnState save def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
508 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
509
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
510 /PrintHeaderWidth PrintOnlyOneHeader{PrintPageWidth}{PrintWidth}ifelse def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
511
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
514 % ---- when 1st column, print all background effects
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
515 ColumnIndex 1 eq{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
519 printGlobalBackground
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
520 printLocalBackground
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
530 }if
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
539 PLN
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
540 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
541
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
542 /EndPage{bg{eolbg}if}def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
543
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
544 /EndDSCPage{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
545 ColumnIndex NumberOfColumns eq{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
546 % ---- restore the state of the page
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
547 pageState restore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
548 /ColumnIndex 1 def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
549 % ---- N-up printing
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
558 translate
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
559 }if
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
560 }{ % else
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
561 % ---- restore the state of the current column
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
562 columnState restore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
563 % ---- and translate to the next column
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
564 ColumnWidth 0 translate
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
565 /ColumnIndex ColumnIndex 1 add def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
566 }ifelse
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
567 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
578 % stack: number-of-pages-per-sheet |- --
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
579 /BeginSheet{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
580 /sheetState save def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
634 % ---- N-up printing
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
635 N-Up 1 gt N-Up-Border and pages-per-sheet 0 gt and{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
636 % ---- page border
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
637 gsave
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
640 N-Up-Repeat
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
641 {N-Up-End
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
642 {gsave
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
643 PageWidth 0 rlineto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
644 0 LandscapePageHeight rlineto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
645 PageWidth neg 0 rlineto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
646 closepath stroke
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
647 grestore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
648 /pages-per-sheet pages-per-sheet 1 sub def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
649 pages-per-sheet 0 le{exit}if
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
650 N-Up-XColumn N-Up-YColumn rmoveto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
651 }repeat
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
652 pages-per-sheet 0 le{exit}if
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
653 N-Up-XLine N-Up-XColumn sub N-Up-YLine rmoveto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
654 }repeat
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
655 grestore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
656 }if
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
657 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
658
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
659 /EndSheet{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
660 showpage
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
661 sheetState restore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
662 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
663
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
664 /SetHeaderLines{ % nb-lines --
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
665 /HeaderLines exch def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
666 % ---- bottom up
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
667 HeaderPad
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
668 HeaderLines 1 sub HeaderLineHeight mul add
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
669 HeaderTitleLineHeight add
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
670 HeaderPad add
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
671 /HeaderHeight exch def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
672 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
683 % |---------|
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
684 % | tm |
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
685 % |---------|
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
686 % | header |
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
687 % |-+-------| <-- (x y)
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
688 % | ho |
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
689 % |---------|
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
695 % |-+-------| <-- (0 0)
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
696 % | bm |
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
697 % |---------|
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
709 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
731 grestore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
732 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
737 /HeaderStart{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
738 HeaderFrameStart
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
739 exch HeaderPad add exch % horizontal pad
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
740 % ---- bottom up
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
741 HeaderPad add % vertical pad
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
742 HeaderDescent sub
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
743 HeaderLineHeight HeaderLines 1 sub mul add
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
744 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
758 /strcat{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
759 dup length 3 -1 roll dup length dup 4 -1 roll add string dup
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
760 0 5 -1 roll putinterval
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
761 dup 4 2 roll exch putinterval
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
762 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
763
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
764 /pagenumberstring{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
767 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
797
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
798 % ---- hack: `PN 1 and' == `PN 2 modulo'
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
825 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
826
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
827 /ReportFontInfo{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
828 2 copy
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
829 /t0 3 1 roll DefFont
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
830 /t0 F
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
836 /t1 F
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
840 grestore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
841 0 FontHeight neg rmoveto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
852 grestore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
853 0 FontHeight neg rmoveto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
858 grestore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
859 0 FontHeight neg rmoveto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
860 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
864
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
868 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
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
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
872
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
873 % === END ps-print prologue 1