annotate etc/ps-prin1.ps @ 27337:d895d4e8a6f0

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