annotate etc/ps-prin1.ps @ 79241:9b10cc0b84c1

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