aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/postscript/psencoding/psencoding.rc
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/postscript/psencoding/psencoding.rc')
-rw-r--r--src/cmd/postscript/psencoding/psencoding.rc39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/cmd/postscript/psencoding/psencoding.rc b/src/cmd/postscript/psencoding/psencoding.rc
new file mode 100644
index 00000000..c0b6aeff
--- /dev/null
+++ b/src/cmd/postscript/psencoding/psencoding.rc
@@ -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]
+ }
+}