annotate etc/ps-prin1.ps @ 28413:abd1f2362ae0

Add locate-word-at-point function In locate function, default to using locate-word-at-point as input Run dired-mode-hook in locate function
author Peter Breton <pbreton@attbi.com>
date Thu, 30 Mar 2000 09:33:17 +0000
parents 4719f42a44e2
children b2d43a699564
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{
28154
16202d8d02cf Eliminate CheckConfig.
Gerd Moellmann <gerd@gnu.org>
parents: 27165
diff changeset
392 << /PageSize [PageWidth LandscapePageHeight] >> setpagedevice
27165
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
393 }{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
394 LandscapeMode{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
395 % ---- translate to bottom-right corner of Portrait page
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
396 LandscapePageHeight 0 translate
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
397 90 rotate
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
398 }if
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
399 }ifelse
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
400 % ---- [jack] Kludge: my ghostscript window is 21x27.7 instead of 21x29.7
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
401 /JackGhostscript where{pop 1 27.7 29.7 div scale}if
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
402 % ---- N-Up printing
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
403 N-Up 1 gt{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
404 % ---- landscape
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
405 N-Up-Landscape{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
406 PageWidth 0 translate
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
407 90 rotate
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
408 }if
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
409 N-Up-Margin dup translate
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
410 % ---- scale
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
411 LandscapeMode{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
412 /HH PageWidth def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
413 /WW LandscapePageHeight def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
414 }{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
415 /HH LandscapePageHeight def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
416 /WW PageWidth def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
417 }ifelse
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
418 WW N-Up-Margin sub N-Up-Margin sub
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
419 N-Up-Landscape
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
420 {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
421 div dup scale
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
422 0 N-Up-Repeat 1 sub LandscapePageHeight mul translate
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
423 % ---- go to start position in page matrix
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
424 N-Up-XStart N-Up-Missing 0.5 mul
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
425 LandscapeMode{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
426 LandscapePageHeight mul N-Up-YStart add
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
427 }{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
428 PageWidth mul add N-Up-YStart
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
429 }ifelse
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
430 translate
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
431 }if
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
432 /ColumnWidth PrintWidth InterColumn add def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
433 % ---- translate to lower left corner of TEXT
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
434 LeftMargin BottomMargin translate
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
435 % ---- define where printing will start
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
436 /f0 F % this installs Ascent
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
437 /PrintStartY PrintHeight Ascent sub def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
438 /ColumnIndex 1 def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
439 /N-Up-Counter N-Up-End 1 sub def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
440 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
441
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
442 /EndDoc{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
443 % ---- restore the state of the document (useful for ghostscript!)
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
444 docState restore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
445 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
446
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
447 /BeginDSCPage{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
448 % ---- when 1st column, save the state of the page
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
449 ColumnIndex 1 eq{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
450 /pageState save def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
451 }if
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
452 % ---- save the state of the column
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
453 /columnState save def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
454 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
455
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
456 /PrintHeaderWidth PrintOnlyOneHeader{PrintPageWidth}{PrintWidth}ifelse 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 /BeginPage{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
459 % ---- when 1st column, print all background effects
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
460 ColumnIndex 1 eq{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
461 0 PrintStartY moveto % move to where printing will start
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
462 Zebra {printZebra}if
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
463 printGlobalBackground
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
464 printLocalBackground
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
465 }if
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
466 PrintHeader{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
467 PrintOnlyOneHeader{ColumnIndex 1 eq}{true}ifelse{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
468 PrintHeaderFrame{HeaderFrame}if
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
469 HeaderText
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
470 }if
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
471 }if
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
472 0 PrintStartY moveto % move to where printing will start
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
473 PLN
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
474 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
475
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
476 /EndPage{bg{eolbg}if}def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
477
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
478 /EndDSCPage{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
479 ColumnIndex NumberOfColumns eq{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
480 % ---- restore the state of the page
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
481 pageState restore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
482 /ColumnIndex 1 def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
483 % ---- N-up printing
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
484 N-Up 1 gt{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
485 N-Up-Counter 0 gt{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
486 % ---- Next page on same row
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
487 /N-Up-Counter N-Up-Counter 1 sub def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
488 N-Up-XColumn N-Up-YColumn
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
489 }{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
490 % ---- Next page on next line
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
491 /N-Up-Counter N-Up-End 1 sub def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
492 N-Up-XLine N-Up-YLine
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
493 }ifelse
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
494 translate
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
495 }if
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
496 }{ % else
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
497 % ---- restore the state of the current column
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
498 columnState restore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
499 % ---- and translate to the next column
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
500 ColumnWidth 0 translate
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
501 /ColumnIndex ColumnIndex 1 add def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
502 }ifelse
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
503 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
504
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
505 % stack: number-of-pages-per-sheet |- --
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
506 /BeginSheet{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
507 /sheetState save def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
508 /pages-per-sheet exch def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
509 % ---- N-up printing
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
510 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
511 % ---- page border
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
512 gsave
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
513 0 setgray
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
514 LeftMargin neg BottomMargin neg moveto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
515 N-Up-Repeat
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
516 {N-Up-End
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
517 {gsave
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
518 PageWidth 0 rlineto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
519 0 LandscapePageHeight rlineto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
520 PageWidth neg 0 rlineto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
521 closepath stroke
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
522 grestore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
523 /pages-per-sheet pages-per-sheet 1 sub def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
524 pages-per-sheet 0 le{exit}if
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
525 N-Up-XColumn N-Up-YColumn rmoveto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
526 }repeat
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-XLine N-Up-XColumn sub N-Up-YLine 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 grestore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
531 }if
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
532 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
533
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
534 /EndSheet{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
535 showpage
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
536 sheetState restore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
537 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
538
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
539 /SetHeaderLines{ % nb-lines --
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
540 /HeaderLines exch def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
541 % ---- bottom up
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
542 HeaderPad
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
543 HeaderLines 1 sub HeaderLineHeight mul add
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
544 HeaderTitleLineHeight add
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
545 HeaderPad add
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
546 /HeaderHeight exch def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
547 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
548
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
549 % |---------|
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
550 % | tm |
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
551 % |---------|
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
552 % | header |
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
553 % |-+-------| <-- (x y)
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
554 % | ho |
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
555 % |---------|
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
556 % | text |
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
557 % |-+-------| <-- (0 0)
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
558 % | bm |
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
559 % |---------|
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
560
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
561 /HeaderFrameStart{ % -- x y
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
562 0 PrintHeight HeaderOffset add
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
563 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
564
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
565 /HeaderFramePath{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
566 PrintHeaderWidth 0 rlineto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
567 0 HeaderHeight rlineto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
568 PrintHeaderWidth neg 0 rlineto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
569 0 HeaderHeight neg rlineto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
570 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
571
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
572 /HeaderFrame{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
573 gsave
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
574 0.4 setlinewidth
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
575 % ---- fill a black rectangle (the shadow of the next one)
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
576 HeaderFrameStart moveto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
577 1 -1 rmoveto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
578 HeaderFramePath
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
579 0 setgray fill
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
580 % ---- do the next rectangle ...
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
581 HeaderFrameStart moveto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
582 HeaderFramePath
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
583 gsave 0.9 setgray fill grestore % filled with grey
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
584 gsave 0 setgray stroke grestore % drawn with black
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
585 grestore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
586 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
587
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
588 /HeaderStart{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
589 HeaderFrameStart
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
590 exch HeaderPad add exch % horizontal pad
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
591 % ---- bottom up
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
592 HeaderPad add % vertical pad
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
593 HeaderDescent sub
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
594 HeaderLineHeight HeaderLines 1 sub mul add
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
595 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
596
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
597 /strcat{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
598 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
599 0 5 -1 roll putinterval
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
600 dup 4 2 roll exch putinterval
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
601 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
602
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
603 /pagenumberstring{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
604 PageNumber 32 string cvs
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
605 ShowNofN{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
606 (/) strcat
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
607 PageCount 32 string cvs strcat
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
608 }if
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
609 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
610
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
611 /HeaderText{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
612 HeaderStart moveto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
613
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
614 HeaderLinesRight HeaderLinesLeft % -- rightLines leftLines
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
615
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
616 % ---- hack: `PN 1 and' == `PN 2 modulo'
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
617
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
618 % ---- if even page number and duplex, then exchange left and right
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
619 PageNumber 1 and 0 eq DuplexValue and{exch}if
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
620
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
621 { % ---- process the left lines
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
622 aload pop
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
623 exch F
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
624 gsave
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
625 dup xcheck{exec}if
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
626 show
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
627 grestore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
628 0 HeaderLineHeight neg rmoveto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
629 }forall
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
630
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
631 HeaderStart moveto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
632
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
633 { % ---- process the right lines
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
634 aload pop
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
635 exch F
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
636 gsave
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
637 dup xcheck{exec}if
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
638 dup stringwidth pop
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
639 PrintHeaderWidth exch sub HeaderPad 2 mul sub 0 rmoveto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
640 show
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
641 grestore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
642 0 HeaderLineHeight neg rmoveto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
643 }forall
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
644 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
645
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
646 /ReportFontInfo{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
647 2 copy
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
648 /t0 3 1 roll DefFont
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
649 /t0 F
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
650 /lh FontHeight def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
651 /sw ( ) stringwidth pop def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
652 /aw (01234567890abcdefghijklmnopqrstuvwxyz) dup length exch
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
653 stringwidth pop exch div def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
654 /t1 12 /Helvetica-Oblique DefFont
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
655 /t1 F
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
656 gsave
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
657 (languagelevel = ) show
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
658 gs_languagelevel 32 string cvs show
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
659 grestore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
660 0 FontHeight neg rmoveto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
661 gsave
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
662 (For ) show
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
663 128 string cvs show
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
664 ( ) show
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
665 32 string cvs show
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
666 ( point, the line height is ) show
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
667 lh 32 string cvs show
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
668 (, the space width is ) show
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
669 sw 32 string cvs show
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
670 (,) show
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
671 grestore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
672 0 FontHeight neg rmoveto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
673 gsave
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
674 (and a crude estimate of average character width is ) show
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
675 aw 32 string cvs show
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
676 (.) show
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
677 grestore
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
678 0 FontHeight neg rmoveto
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
679 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
680
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
681 /cm{ % cm to point
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
682 72 mul 2.54 div
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
683 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
684
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
685 /ReportAllFontInfo{
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
686 FontDirectory
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
687 { % key = font name value = font dictionary
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
688 pop 10 exch ReportFontInfo
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
689 }forall
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
690 }def
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
691
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
692 % 3 cm 20 cm moveto 10 /Courier ReportFontInfo showpage
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
693 % 3 cm 20 cm moveto ReportAllFontInfo showpage
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
694
e0beb5cd0257 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
695 % === END ps-print prologue 1