Checkpoint.
This commit is contained in:
parent
61f5c35c94
commit
b855148c9b
74 changed files with 5281 additions and 130 deletions
1
src/cmd/postscript/psencoding/.cvsignore
Normal file
1
src/cmd/postscript/psencoding/.cvsignore
Normal file
|
|
@ -0,0 +1 @@
|
|||
psencoding
|
||||
299
src/cmd/postscript/psencoding/Latin1.enc
Normal file
299
src/cmd/postscript/psencoding/Latin1.enc
Normal file
|
|
@ -0,0 +1,299 @@
|
|||
%
|
||||
% Encoding vector and redefinition of findfont for the ISO Latin1 standard.
|
||||
% The 18 characters missing from ROM based fonts on older printers are noted
|
||||
% below.
|
||||
%
|
||||
|
||||
/ISOLatin1Encoding [
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/space
|
||||
/exclam
|
||||
/quotedbl
|
||||
/numbersign
|
||||
/dollar
|
||||
/percent
|
||||
/ampersand
|
||||
/quoteright
|
||||
/parenleft
|
||||
/parenright
|
||||
/asterisk
|
||||
/plus
|
||||
/comma
|
||||
/minus
|
||||
/period
|
||||
/slash
|
||||
/zero
|
||||
/one
|
||||
/two
|
||||
/three
|
||||
/four
|
||||
/five
|
||||
/six
|
||||
/seven
|
||||
/eight
|
||||
/nine
|
||||
/colon
|
||||
/semicolon
|
||||
/less
|
||||
/equal
|
||||
/greater
|
||||
/question
|
||||
/at
|
||||
/A
|
||||
/B
|
||||
/C
|
||||
/D
|
||||
/E
|
||||
/F
|
||||
/G
|
||||
/H
|
||||
/I
|
||||
/J
|
||||
/K
|
||||
/L
|
||||
/M
|
||||
/N
|
||||
/O
|
||||
/P
|
||||
/Q
|
||||
/R
|
||||
/S
|
||||
/T
|
||||
/U
|
||||
/V
|
||||
/W
|
||||
/X
|
||||
/Y
|
||||
/Z
|
||||
/bracketleft
|
||||
/backslash
|
||||
/bracketright
|
||||
/asciicircum
|
||||
/underscore
|
||||
/quoteleft
|
||||
/a
|
||||
/b
|
||||
/c
|
||||
/d
|
||||
/e
|
||||
/f
|
||||
/g
|
||||
/h
|
||||
/i
|
||||
/j
|
||||
/k
|
||||
/l
|
||||
/m
|
||||
/n
|
||||
/o
|
||||
/p
|
||||
/q
|
||||
/r
|
||||
/s
|
||||
/t
|
||||
/u
|
||||
/v
|
||||
/w
|
||||
/x
|
||||
/y
|
||||
/z
|
||||
/braceleft
|
||||
/bar
|
||||
/braceright
|
||||
/asciitilde
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/dotlessi
|
||||
/grave
|
||||
/acute
|
||||
/circumflex
|
||||
/tilde
|
||||
/macron
|
||||
/breve
|
||||
/dotaccent
|
||||
/dieresis
|
||||
/.notdef
|
||||
/ring
|
||||
/cedilla
|
||||
/.notdef
|
||||
/hungarumlaut
|
||||
/ogonek
|
||||
/caron
|
||||
/space
|
||||
/exclamdown
|
||||
/cent
|
||||
/sterling
|
||||
/currency
|
||||
/yen
|
||||
/brokenbar % missing
|
||||
/section
|
||||
/dieresis
|
||||
/copyright
|
||||
/ordfeminine
|
||||
/guillemotleft
|
||||
/logicalnot
|
||||
/hyphen
|
||||
/registered
|
||||
/macron
|
||||
/degree % missing
|
||||
/plusminus % missing
|
||||
/twosuperior % missing
|
||||
/threesuperior % missing
|
||||
/acute
|
||||
/mu % missing
|
||||
/paragraph
|
||||
/periodcentered
|
||||
/cedilla
|
||||
/onesuperior % missing
|
||||
/ordmasculine
|
||||
/guillemotright
|
||||
/onequarter % missing
|
||||
/onehalf % missing
|
||||
/threequarters % missing
|
||||
/questiondown
|
||||
/Agrave
|
||||
/Aacute
|
||||
/Acircumflex
|
||||
/Atilde
|
||||
/Adieresis
|
||||
/Aring
|
||||
/AE
|
||||
/Ccedilla
|
||||
/Egrave
|
||||
/Eacute
|
||||
/Ecircumflex
|
||||
/Edieresis
|
||||
/Igrave
|
||||
/Iacute
|
||||
/Icircumflex
|
||||
/Idieresis
|
||||
/Eth % missing
|
||||
/Ntilde
|
||||
/Ograve
|
||||
/Oacute
|
||||
/Ocircumflex
|
||||
/Otilde
|
||||
/Odieresis
|
||||
/multiply % missing
|
||||
/Oslash
|
||||
/Ugrave
|
||||
/Uacute
|
||||
/Ucircumflex
|
||||
/Udieresis
|
||||
/Yacute % missing
|
||||
/Thorn % missing
|
||||
/germandbls
|
||||
/agrave
|
||||
/aacute
|
||||
/acircumflex
|
||||
/atilde
|
||||
/adieresis
|
||||
/aring
|
||||
/ae
|
||||
/ccedilla
|
||||
/egrave
|
||||
/eacute
|
||||
/ecircumflex
|
||||
/edieresis
|
||||
/igrave
|
||||
/iacute
|
||||
/icircumflex
|
||||
/idieresis
|
||||
/eth % missing
|
||||
/ntilde
|
||||
/ograve
|
||||
/oacute
|
||||
/ocircumflex
|
||||
/otilde
|
||||
/odieresis
|
||||
/divide % missing
|
||||
/oslash
|
||||
/ugrave
|
||||
/uacute
|
||||
/ucircumflex
|
||||
/udieresis
|
||||
/yacute % missing
|
||||
/thorn % missing
|
||||
/ydieresis
|
||||
] def
|
||||
|
||||
/NewFontDirectory FontDirectory maxlength dict def
|
||||
|
||||
%
|
||||
% Apparently no guarantee findfont is defined in systemdict so the obvious
|
||||
%
|
||||
% systemdict /findfont get exec
|
||||
%
|
||||
% can generate an error. So far the only exception is a VT600 (version 48.0).
|
||||
%
|
||||
|
||||
userdict /@RealFindfont known not {
|
||||
userdict begin
|
||||
/@RealFindfont systemdict begin /findfont load end def
|
||||
end
|
||||
} if
|
||||
|
||||
/findfont {
|
||||
dup NewFontDirectory exch known not {
|
||||
dup
|
||||
%dup systemdict /findfont get exec % not always in systemdict
|
||||
dup userdict /@RealFindfont get exec
|
||||
dup /Encoding get StandardEncoding eq {
|
||||
dup length dict begin
|
||||
{1 index /FID ne {def}{pop pop} ifelse} forall
|
||||
/Encoding ISOLatin1Encoding def
|
||||
currentdict
|
||||
end
|
||||
/DummyFontName exch definefont
|
||||
} if
|
||||
NewFontDirectory 3 1 roll put
|
||||
} if
|
||||
NewFontDirectory exch get
|
||||
} bind def
|
||||
|
||||
332
src/cmd/postscript/psencoding/UTF.enc
Normal file
332
src/cmd/postscript/psencoding/UTF.enc
Normal file
|
|
@ -0,0 +1,332 @@
|
|||
%
|
||||
% Encoding vector, operator and procedure redefinitions for Plan 9 UTF
|
||||
% encoding. Prologues are expected to take steps to ensure operator
|
||||
% redefinitions given here are actually used. Current implementation
|
||||
% assumes UTF byte streams that represent ASCII or Latin1 text.
|
||||
%
|
||||
|
||||
/UTFLatin1Encoding [
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/space
|
||||
/exclam
|
||||
/quotedbl
|
||||
/numbersign
|
||||
/dollar
|
||||
/percent
|
||||
/ampersand
|
||||
/quoteright
|
||||
/parenleft
|
||||
/parenright
|
||||
/asterisk
|
||||
/plus
|
||||
/comma
|
||||
/minus
|
||||
/period
|
||||
/slash
|
||||
/zero
|
||||
/one
|
||||
/two
|
||||
/three
|
||||
/four
|
||||
/five
|
||||
/six
|
||||
/seven
|
||||
/eight
|
||||
/nine
|
||||
/colon
|
||||
/semicolon
|
||||
/less
|
||||
/equal
|
||||
/greater
|
||||
/question
|
||||
/at
|
||||
/A
|
||||
/B
|
||||
/C
|
||||
/D
|
||||
/E
|
||||
/F
|
||||
/G
|
||||
/H
|
||||
/I
|
||||
/J
|
||||
/K
|
||||
/L
|
||||
/M
|
||||
/N
|
||||
/O
|
||||
/P
|
||||
/Q
|
||||
/R
|
||||
/S
|
||||
/T
|
||||
/U
|
||||
/V
|
||||
/W
|
||||
/X
|
||||
/Y
|
||||
/Z
|
||||
/bracketleft
|
||||
/backslash
|
||||
/bracketright
|
||||
/asciicircum
|
||||
/underscore
|
||||
/quoteleft
|
||||
/a
|
||||
/b
|
||||
/c
|
||||
/d
|
||||
/e
|
||||
/f
|
||||
/g
|
||||
/h
|
||||
/i
|
||||
/j
|
||||
/k
|
||||
/l
|
||||
/m
|
||||
/n
|
||||
/o
|
||||
/p
|
||||
/q
|
||||
/r
|
||||
/s
|
||||
/t
|
||||
/u
|
||||
/v
|
||||
/w
|
||||
/x
|
||||
/y
|
||||
/z
|
||||
/braceleft
|
||||
/bar
|
||||
/braceright
|
||||
/asciitilde
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/.notdef
|
||||
/dotlessi
|
||||
/grave
|
||||
/acute
|
||||
/circumflex
|
||||
/tilde
|
||||
/macron
|
||||
/breve
|
||||
/dotaccent
|
||||
/dieresis
|
||||
/.notdef
|
||||
/ring
|
||||
/cedilla
|
||||
/.notdef
|
||||
/hungarumlaut
|
||||
/ogonek
|
||||
/caron
|
||||
/.notdef % was space
|
||||
/exclamdown
|
||||
/cent
|
||||
/sterling
|
||||
/currency
|
||||
/yen
|
||||
/brokenbar
|
||||
/section
|
||||
/dieresis
|
||||
/copyright
|
||||
/ordfeminine
|
||||
/guillemotleft
|
||||
/logicalnot
|
||||
/hyphen
|
||||
/registered
|
||||
/macron
|
||||
/degree
|
||||
/plusminus
|
||||
/twosuperior
|
||||
/threesuperior
|
||||
/acute
|
||||
/mu
|
||||
/paragraph
|
||||
/periodcentered
|
||||
/cedilla
|
||||
/onesuperior
|
||||
/ordmasculine
|
||||
/guillemotright
|
||||
/onequarter
|
||||
/onehalf
|
||||
/threequarters
|
||||
/questiondown
|
||||
/Agrave
|
||||
/Aacute
|
||||
/Acircumflex
|
||||
/Atilde
|
||||
/Adieresis
|
||||
/Aring
|
||||
/AE
|
||||
/Ccedilla
|
||||
/Egrave
|
||||
/Eacute
|
||||
/Ecircumflex
|
||||
/Edieresis
|
||||
/Igrave
|
||||
/Iacute
|
||||
/Icircumflex
|
||||
/Idieresis
|
||||
/Eth
|
||||
/Ntilde
|
||||
/Ograve
|
||||
/Oacute
|
||||
/Ocircumflex
|
||||
/Otilde
|
||||
/Odieresis
|
||||
/multiply
|
||||
/Oslash
|
||||
/Ugrave
|
||||
/Uacute
|
||||
/Ucircumflex
|
||||
/Udieresis
|
||||
/Yacute
|
||||
/Thorn
|
||||
/germandbls
|
||||
/agrave
|
||||
/aacute
|
||||
/acircumflex
|
||||
/atilde
|
||||
/adieresis
|
||||
/aring
|
||||
/ae
|
||||
/ccedilla
|
||||
/egrave
|
||||
/eacute
|
||||
/ecircumflex
|
||||
/edieresis
|
||||
/igrave
|
||||
/iacute
|
||||
/icircumflex
|
||||
/idieresis
|
||||
/eth
|
||||
/ntilde
|
||||
/ograve
|
||||
/oacute
|
||||
/ocircumflex
|
||||
/otilde
|
||||
/odieresis
|
||||
/divide
|
||||
/oslash
|
||||
/ugrave
|
||||
/uacute
|
||||
/ucircumflex
|
||||
/udieresis
|
||||
/yacute
|
||||
/thorn
|
||||
/ydieresis
|
||||
] def
|
||||
|
||||
/NewFontDirectory FontDirectory maxlength dict def
|
||||
|
||||
%
|
||||
% Apparently no guarantee findfont is defined in systemdict so the obvious
|
||||
%
|
||||
% systemdict /findfont get exec
|
||||
%
|
||||
% can generate an error. So far the only exception is a VT600 (version 48.0).
|
||||
%
|
||||
|
||||
userdict /@RealFindfont known not {
|
||||
userdict begin
|
||||
/@RealFindfont systemdict begin /findfont load end def
|
||||
end
|
||||
} if
|
||||
|
||||
/findfont {
|
||||
dup NewFontDirectory exch known not {
|
||||
dup
|
||||
%dup systemdict /findfont get exec % not always in systemdict
|
||||
dup userdict /@RealFindfont get exec
|
||||
dup /Encoding get StandardEncoding eq {
|
||||
dup length 1 add dict begin
|
||||
{1 index /FID ne {def}{pop pop} ifelse} forall
|
||||
/Encoding UTFLatin1Encoding def
|
||||
/Metrics 1 dict def
|
||||
Metrics /.notdef 0 put
|
||||
currentdict
|
||||
end
|
||||
/DummyFontName exch definefont
|
||||
} if
|
||||
NewFontDirectory 3 1 roll put
|
||||
} if
|
||||
NewFontDirectory exch get
|
||||
} bind def
|
||||
|
||||
%
|
||||
% Assume A0, except for A0A0 which is replaced by 20A0, can be ignored.
|
||||
% Works with ASCII or Latin1 because A0 has been re-encoded as a zero
|
||||
% width non-printing character.
|
||||
%
|
||||
|
||||
/UTFstring {
|
||||
dup {
|
||||
(\240\240) search {
|
||||
pop
|
||||
0 16#20 put
|
||||
}{pop exit} ifelse
|
||||
} loop
|
||||
} bind def
|
||||
|
||||
/ashow {mark 4 1 roll UTFstring //ashow cvx exec cleartomark} bind def
|
||||
/awidthshow {mark 7 1 roll UTFstring //awidthshow cvx exec cleartomark} bind def
|
||||
/show {mark exch UTFstring //show cvx exec cleartomark} bind def
|
||||
/stringwidth {UTFstring //stringwidth cvx exec} bind def
|
||||
/widthshow {mark 5 1 roll UTFstring //widthshow cvx exec cleartomark} bind def
|
||||
|
||||
%
|
||||
% kshow is harder - stack can't change because of the procedure.
|
||||
%
|
||||
|
||||
/kshow dup load type /operatortype eq
|
||||
{{UTFstring kshow} bind}
|
||||
{{UTFstring //kshow cvx exec} bind}
|
||||
ifelse def
|
||||
|
||||
22
src/cmd/postscript/psencoding/mkfile
Normal file
22
src/cmd/postscript/psencoding/mkfile
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
</$objtype/mkfile
|
||||
|
||||
<../config
|
||||
|
||||
POSTBIN=$ROOT/rc/bin/postscript
|
||||
|
||||
all:V: psencoding
|
||||
|
||||
install installall:V: $POSTBIN/psencoding $POSTLIB/Latin1.enc $POSTLIB/UTF.enc
|
||||
|
||||
clean nuke:V:
|
||||
rm -f psencoding
|
||||
|
||||
$POSTBIN/psencoding: psencoding
|
||||
cp $prereq $target
|
||||
|
||||
$POSTLIB/%.enc: %.enc
|
||||
cp $prereq $target
|
||||
|
||||
psencoding: psencoding.rc
|
||||
sed 's?^POSTLIB=.*?POSTLIB='$POSTLIB'?' psencoding.rc >psencoding
|
||||
chmod 775 psencoding
|
||||
39
src/cmd/postscript/psencoding/psencoding.rc
Normal file
39
src/cmd/postscript/psencoding/psencoding.rc
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#!/bin/rc
|
||||
# Trivial script for checking and setting the default PostScript font
|
||||
# encoding. Changing the default assumes you can write in $POSTLIB.
|
||||
# Available font encodings are files in $POSTLIB that end in .enc.
|
||||
# The default is $POSTLIB/Default.enc.
|
||||
#
|
||||
|
||||
POSTLIB=/sys/lib/postscript/prologues
|
||||
DEFAULT=Default.enc
|
||||
CURRENTDEFAULT=Standard
|
||||
|
||||
if (~ $#* 0) {
|
||||
cd $POSTLIB
|
||||
for (i in *.enc) {
|
||||
if (test -f $i -a $i '!=' $DEFAULT) {
|
||||
NAME=`{echo $i | sed s/\\.enc//}
|
||||
if (cmp $i $DEFAULT >/dev/null >[2]/dev/null) {
|
||||
CURRENTDEFAULT=$NAME
|
||||
}
|
||||
echo $NAME
|
||||
}
|
||||
}
|
||||
echo Standard
|
||||
echo Default'='$CURRENTDEFAULT
|
||||
}
|
||||
if not {
|
||||
switch ($1) {
|
||||
case Default
|
||||
;
|
||||
case Standard
|
||||
rm -f $POSTLIB/$DEFAULT
|
||||
case *
|
||||
if (test -f $POSTLIB/$1.enc) {
|
||||
rm -f $POSTLIB/$DEFAULT
|
||||
cp $POSTLIB/$1.enc $POSTLIB/$DEFAULT
|
||||
}
|
||||
if not echo unrecognized encoding name $1 >[1=2]
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue