annotate etc/ps-prin1.ps @ 31717:6b20b7e85e3c

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