2 b855148c 2004-05-16 devnull % Encoding vector, operator and procedure redefinitions for Plan 9 UTF
3 b855148c 2004-05-16 devnull % encoding. Prologues are expected to take steps to ensure operator
4 b855148c 2004-05-16 devnull % redefinitions given here are actually used. Current implementation
5 b855148c 2004-05-16 devnull % assumes UTF byte streams that represent ASCII or Latin1 text.
8 b855148c 2004-05-16 devnull /UTFLatin1Encoding [
43 b855148c 2004-05-16 devnull /quotedbl
44 b855148c 2004-05-16 devnull /numbersign
47 b855148c 2004-05-16 devnull /ampersand
48 b855148c 2004-05-16 devnull /quoteright
49 b855148c 2004-05-16 devnull /parenleft
50 b855148c 2004-05-16 devnull /parenright
51 b855148c 2004-05-16 devnull /asterisk
68 b855148c 2004-05-16 devnull /semicolon
72 b855148c 2004-05-16 devnull /question
100 b855148c 2004-05-16 devnull /bracketleft
101 b855148c 2004-05-16 devnull /backslash
102 b855148c 2004-05-16 devnull /bracketright
103 b855148c 2004-05-16 devnull /asciicircum
104 b855148c 2004-05-16 devnull /underscore
105 b855148c 2004-05-16 devnull /quoteleft
132 b855148c 2004-05-16 devnull /braceleft
134 b855148c 2004-05-16 devnull /braceright
135 b855148c 2004-05-16 devnull /asciitilde
136 b855148c 2004-05-16 devnull /.notdef
137 b855148c 2004-05-16 devnull /.notdef
138 b855148c 2004-05-16 devnull /.notdef
139 b855148c 2004-05-16 devnull /.notdef
140 b855148c 2004-05-16 devnull /.notdef
141 b855148c 2004-05-16 devnull /.notdef
142 b855148c 2004-05-16 devnull /.notdef
143 b855148c 2004-05-16 devnull /.notdef
144 b855148c 2004-05-16 devnull /.notdef
145 b855148c 2004-05-16 devnull /.notdef
146 b855148c 2004-05-16 devnull /.notdef
147 b855148c 2004-05-16 devnull /.notdef
148 b855148c 2004-05-16 devnull /.notdef
149 b855148c 2004-05-16 devnull /.notdef
150 b855148c 2004-05-16 devnull /.notdef
151 b855148c 2004-05-16 devnull /.notdef
152 b855148c 2004-05-16 devnull /.notdef
153 b855148c 2004-05-16 devnull /dotlessi
156 b855148c 2004-05-16 devnull /circumflex
160 b855148c 2004-05-16 devnull /dotaccent
161 b855148c 2004-05-16 devnull /dieresis
162 b855148c 2004-05-16 devnull /.notdef
164 b855148c 2004-05-16 devnull /cedilla
165 b855148c 2004-05-16 devnull /.notdef
166 b855148c 2004-05-16 devnull /hungarumlaut
169 b855148c 2004-05-16 devnull /.notdef % was space
170 b855148c 2004-05-16 devnull /exclamdown
172 b855148c 2004-05-16 devnull /sterling
173 b855148c 2004-05-16 devnull /currency
175 b855148c 2004-05-16 devnull /brokenbar
176 b855148c 2004-05-16 devnull /section
177 b855148c 2004-05-16 devnull /dieresis
178 b855148c 2004-05-16 devnull /copyright
179 b855148c 2004-05-16 devnull /ordfeminine
180 b855148c 2004-05-16 devnull /guillemotleft
181 b855148c 2004-05-16 devnull /logicalnot
183 b855148c 2004-05-16 devnull /registered
186 b855148c 2004-05-16 devnull /plusminus
187 b855148c 2004-05-16 devnull /twosuperior
188 b855148c 2004-05-16 devnull /threesuperior
191 b855148c 2004-05-16 devnull /paragraph
192 b855148c 2004-05-16 devnull /periodcentered
193 b855148c 2004-05-16 devnull /cedilla
194 b855148c 2004-05-16 devnull /onesuperior
195 b855148c 2004-05-16 devnull /ordmasculine
196 b855148c 2004-05-16 devnull /guillemotright
197 b855148c 2004-05-16 devnull /onequarter
198 b855148c 2004-05-16 devnull /onehalf
199 b855148c 2004-05-16 devnull /threequarters
200 b855148c 2004-05-16 devnull /questiondown
203 b855148c 2004-05-16 devnull /Acircumflex
205 b855148c 2004-05-16 devnull /Adieresis
208 b855148c 2004-05-16 devnull /Ccedilla
211 b855148c 2004-05-16 devnull /Ecircumflex
212 b855148c 2004-05-16 devnull /Edieresis
215 b855148c 2004-05-16 devnull /Icircumflex
216 b855148c 2004-05-16 devnull /Idieresis
221 b855148c 2004-05-16 devnull /Ocircumflex
223 b855148c 2004-05-16 devnull /Odieresis
224 b855148c 2004-05-16 devnull /multiply
228 b855148c 2004-05-16 devnull /Ucircumflex
229 b855148c 2004-05-16 devnull /Udieresis
232 b855148c 2004-05-16 devnull /germandbls
235 b855148c 2004-05-16 devnull /acircumflex
237 b855148c 2004-05-16 devnull /adieresis
240 b855148c 2004-05-16 devnull /ccedilla
243 b855148c 2004-05-16 devnull /ecircumflex
244 b855148c 2004-05-16 devnull /edieresis
247 b855148c 2004-05-16 devnull /icircumflex
248 b855148c 2004-05-16 devnull /idieresis
253 b855148c 2004-05-16 devnull /ocircumflex
255 b855148c 2004-05-16 devnull /odieresis
260 b855148c 2004-05-16 devnull /ucircumflex
261 b855148c 2004-05-16 devnull /udieresis
264 b855148c 2004-05-16 devnull /ydieresis
267 b855148c 2004-05-16 devnull /NewFontDirectory FontDirectory maxlength dict def
270 b855148c 2004-05-16 devnull % Apparently no guarantee findfont is defined in systemdict so the obvious
272 b855148c 2004-05-16 devnull % systemdict /findfont get exec
274 b855148c 2004-05-16 devnull % can generate an error. So far the only exception is a VT600 (version 48.0).
277 b855148c 2004-05-16 devnull userdict /@RealFindfont known not {
278 b855148c 2004-05-16 devnull userdict begin
279 b855148c 2004-05-16 devnull /@RealFindfont systemdict begin /findfont load end def
283 b855148c 2004-05-16 devnull /findfont {
284 b855148c 2004-05-16 devnull dup NewFontDirectory exch known not {
286 b855148c 2004-05-16 devnull %dup systemdict /findfont get exec % not always in systemdict
287 b855148c 2004-05-16 devnull dup userdict /@RealFindfont get exec
288 b855148c 2004-05-16 devnull dup /Encoding get StandardEncoding eq {
289 b855148c 2004-05-16 devnull dup length 1 add dict begin
290 b855148c 2004-05-16 devnull {1 index /FID ne {def}{pop pop} ifelse} forall
291 b855148c 2004-05-16 devnull /Encoding UTFLatin1Encoding def
292 b855148c 2004-05-16 devnull /Metrics 1 dict def
293 b855148c 2004-05-16 devnull Metrics /.notdef 0 put
294 b855148c 2004-05-16 devnull currentdict
296 b855148c 2004-05-16 devnull /DummyFontName exch definefont
298 b855148c 2004-05-16 devnull NewFontDirectory 3 1 roll put
300 b855148c 2004-05-16 devnull NewFontDirectory exch get
301 b855148c 2004-05-16 devnull } bind def
304 b855148c 2004-05-16 devnull % Assume A0, except for A0A0 which is replaced by 20A0, can be ignored.
305 b855148c 2004-05-16 devnull % Works with ASCII or Latin1 because A0 has been re-encoded as a zero
306 b855148c 2004-05-16 devnull % width non-printing character.
309 b855148c 2004-05-16 devnull /UTFstring {
311 b855148c 2004-05-16 devnull (\240\240) search {
313 b855148c 2004-05-16 devnull 0 16#20 put
314 b855148c 2004-05-16 devnull }{pop exit} ifelse
316 b855148c 2004-05-16 devnull } bind def
318 b855148c 2004-05-16 devnull /ashow {mark 4 1 roll UTFstring //ashow cvx exec cleartomark} bind def
319 b855148c 2004-05-16 devnull /awidthshow {mark 7 1 roll UTFstring //awidthshow cvx exec cleartomark} bind def
320 b855148c 2004-05-16 devnull /show {mark exch UTFstring //show cvx exec cleartomark} bind def
321 b855148c 2004-05-16 devnull /stringwidth {UTFstring //stringwidth cvx exec} bind def
322 b855148c 2004-05-16 devnull /widthshow {mark 5 1 roll UTFstring //widthshow cvx exec cleartomark} bind def
325 b855148c 2004-05-16 devnull % kshow is harder - stack can't change because of the procedure.
328 b855148c 2004-05-16 devnull /kshow dup load type /operatortype eq
329 b855148c 2004-05-16 devnull {{UTFstring kshow} bind}
330 b855148c 2004-05-16 devnull {{UTFstring //kshow cvx exec} bind}
331 b855148c 2004-05-16 devnull ifelse def