1 33adad7d 2005-01-04 devnull #!/usr/local/plan9/bin/rc
2 b855148c 2004-05-16 devnull # Formatted dump of encoded characters in one or more PostScript fonts.
3 b855148c 2004-05-16 devnull # Arguments should be PostScript font names or the word all, which dumps
4 b855148c 2004-05-16 devnull # all ROM and disk based fonts.
7 33adad7d 2005-01-04 devnull POSTLIB=/usr/local/plan9/postscript/prologues
8 b855148c 2004-05-16 devnull PROLOGUE=$POSTLIB/printfont.ps
10 b855148c 2004-05-16 devnull OPTIONS=''
11 b855148c 2004-05-16 devnull COPYFILE=''
12 b855148c 2004-05-16 devnull MODE=portrait
13 b855148c 2004-05-16 devnull FONTENCODING=Default
15 b855148c 2004-05-16 devnull NONCONFORMING='%!PS'
16 b855148c 2004-05-16 devnull ENDPROLOG='%%EndProlog'
17 b855148c 2004-05-16 devnull BEGINSETUP='%%BeginSetup'
18 b855148c 2004-05-16 devnull ENDSETUP='%%EndSetup'
19 b855148c 2004-05-16 devnull TRAILER='%%Trailer'
21 b855148c 2004-05-16 devnull SETUP=setup
23 b855148c 2004-05-16 devnull while (! ~ $#* 0 && ~ $1 -*) {
24 b855148c 2004-05-16 devnull switch ($1) {
25 b855148c 2004-05-16 devnull case -a; shift; OPTIONS=$OPTIONS' /axescount $1 def'
26 b855148c 2004-05-16 devnull case -a*; OPTIONS=$OPTIONS' /axescount '`{echo $1 | sed s/-a//}' def'
28 b855148c 2004-05-16 devnull case -b; shift; OPTIONS=$OPTIONS' /radix '$1' def'
29 b855148c 2004-05-16 devnull case -b*; OPTIONS=$OPTIONS' /radix '`{echo $1 | sed s/-b//}' def'
31 b855148c 2004-05-16 devnull case -c; shift; OPTIONS=$OPTIONS' /#copies '$1' store'
32 b855148c 2004-05-16 devnull case -c*; OPTIONS=$OPTIONS' /#copies '`{echo $1 | sed s/-c//}' store'
34 b855148c 2004-05-16 devnull case -f; shift; OPTIONS=$OPTIONS' /labelfont /'$1' def'
35 b855148c 2004-05-16 devnull case -f*; OPTIONS=$OPTIONS' /labelfont /'`{echo $1 | sed s/-f//}' def'
37 b855148c 2004-05-16 devnull case -g; shift; OPTIONS=$OPTIONS' /graynotdef '$1' def'
38 b855148c 2004-05-16 devnull case -g*; OPTIONS=$OPTIONS' /graynotdef '`{echo $1 | sed s/-g//}' def'
40 b855148c 2004-05-16 devnull case -p; shift; MODE=$1
41 b855148c 2004-05-16 devnull case -p*; MODE=`{echo $1 | sed s/-p//}
43 b855148c 2004-05-16 devnull case -q; OPTIONS=$OPTIONS' /longnames false def /charwidth false def'
45 b855148c 2004-05-16 devnull case -m; shift; OPTIONS=$OPTIONS' /magnification '$1' def'
46 b855148c 2004-05-16 devnull case -m*; OPTIONS=$OPTIONS' /magnification '`{echo $1 | sed s/-m//}' def'
48 b855148c 2004-05-16 devnull case -v; OPTIONS=$OPTIONS' /longnames true def /charwidth true def'
50 b855148c 2004-05-16 devnull case -w; shift; OPTIONS=$OPTIONS' /linewidth '$1' def'
51 b855148c 2004-05-16 devnull case -w*; OPTIONS=$OPTIONS' /linewidth '`{echo $1 | sed s/-w//}' def'
53 b855148c 2004-05-16 devnull case -x; shift; OPTIONS=$OPTIONS' /xoffset '$1' def'
54 b855148c 2004-05-16 devnull case -x*; OPTIONS=$OPTIONS' /xoffset '`{echo $1 | sed s/-x//}' def'
56 b855148c 2004-05-16 devnull case -y; shift; OPTIONS=$OPTIONS' /yoffset '$1' def'
57 b855148c 2004-05-16 devnull case -y*; OPTIONS=$OPTIONS' /yoffset '`{echo $1 | sed s/-y//}' def'
59 b855148c 2004-05-16 devnull case -z; shift; OPTIONS=$OPTIONS' /zerocell '$1' def'
60 b855148c 2004-05-16 devnull case -z*; OPTIONS=$OPTIONS' /zerocell '`{echo $1 | sed s/-z//}' def'
62 b855148c 2004-05-16 devnull case -C; shift; COPYFILE=$COPYFILE' '$1
63 b855148c 2004-05-16 devnull case -C*; COPYFILE=$COPYFILE' '`{echo $1 | sed s/-C//}
65 b855148c 2004-05-16 devnull case -E; shift; FONTENCODING=$1
66 b855148c 2004-05-16 devnull case -E*; FONTENCODING=`{echo $1 | sed s/-E//}
68 b855148c 2004-05-16 devnull case -L; shift; PROLOGUE=$1
69 b855148c 2004-05-16 devnull case -L*; PROLOGUE=`{echo $1 | sed s/-L//}
71 b855148c 2004-05-16 devnull case -*; echo $0:' illegal option '$1 >[1=2]; exit 1
76 b855148c 2004-05-16 devnull switch ($MODE) {
77 b855148c 2004-05-16 devnull case l*; OPTIONS=$OPTIONS' /landscape true def'
78 b855148c 2004-05-16 devnull case *; OPTIONS=$OPTIONS' /landscape false def'
81 b855148c 2004-05-16 devnull echo $NONCONFORMING
82 b855148c 2004-05-16 devnull cat $PROLOGUE
83 b855148c 2004-05-16 devnull echo $ENDPROLOG
84 b855148c 2004-05-16 devnull echo $BEGINSETUP
85 b855148c 2004-05-16 devnull if (~ $#COPYFILE 0 || ~ $COPYFILE '') COPYFILE=/dev/null
86 b855148c 2004-05-16 devnull cat $COPYFILE
87 b855148c 2004-05-16 devnull echo $OPTIONS
89 b855148c 2004-05-16 devnull switch ($FONTENCODING) {
90 b855148c 2004-05-16 devnull case /*; cat $FONTENCODING
91 b855148c 2004-05-16 devnull case ?*; cat $POSTLIB^/$FONTENCODING^.enc >[2]/dev/null
94 b855148c 2004-05-16 devnull echo $SETUP
95 b855148c 2004-05-16 devnull echo $ENDSETUP
97 b855148c 2004-05-16 devnull for (i) {
98 b855148c 2004-05-16 devnull switch ($i) {
99 b855148c 2004-05-16 devnull case all; echo AllFonts
100 b855148c 2004-05-16 devnull case /*; echo $i' PrintFont'
101 b855148c 2004-05-16 devnull case ?*; echo /$i' PrintFont'
105 b855148c 2004-05-16 devnull echo $TRAILER