2 % Encoding vector, operator and procedure redefinitions for Plan 9 UTF
3 % encoding. Prologues are expected to take steps to ensure operator
4 % redefinitions given here are actually used. Current implementation
5 % assumes UTF byte streams that represent ASCII or Latin1 text.
267 /NewFontDirectory FontDirectory maxlength dict def
270 % Apparently no guarantee findfont is defined in systemdict so the obvious
272 % systemdict /findfont get exec
274 % can generate an error. So far the only exception is a VT600 (version 48.0).
277 userdict /@RealFindfont known not {
279 /@RealFindfont systemdict begin /findfont load end def
284 dup NewFontDirectory exch known not {
286 %dup systemdict /findfont get exec % not always in systemdict
287 dup userdict /@RealFindfont get exec
288 dup /Encoding get StandardEncoding eq {
289 dup length 1 add dict begin
290 {1 index /FID ne {def}{pop pop} ifelse} forall
291 /Encoding UTFLatin1Encoding def
293 Metrics /.notdef 0 put
296 /DummyFontName exch definefont
298 NewFontDirectory 3 1 roll put
300 NewFontDirectory exch get
304 % Assume A0, except for A0A0 which is replaced by 20A0, can be ignored.
305 % Works with ASCII or Latin1 because A0 has been re-encoded as a zero
306 % width non-printing character.
318 /ashow {mark 4 1 roll UTFstring //ashow cvx exec cleartomark} bind def
319 /awidthshow {mark 7 1 roll UTFstring //awidthshow cvx exec cleartomark} bind def
320 /show {mark exch UTFstring //show cvx exec cleartomark} bind def
321 /stringwidth {UTFstring //stringwidth cvx exec} bind def
322 /widthshow {mark 5 1 roll UTFstring //widthshow cvx exec cleartomark} bind def
325 % kshow is harder - stack can't change because of the procedure.
328 /kshow dup load type /operatortype eq
329 {{UTFstring kshow} bind}
330 {{UTFstring //kshow cvx exec} bind}