Blob


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