BSD 4 development
[unix-history] / .ref-BSD-3 / usr / src / cmd / versatec / vtroff.sh
CommitLineData
fd9bcd2d
BJ
1#
2set flags=() noglob length=() fonts=() fontf=() macp=(/usr/lib/tmac/tmac.vcat)
3top:
4 if ($#argv > 0) then
5 switch ($argv[1])
6
7 case -l*:
8 set length = $argv[1]
9 shift argv
10 goto top
11
12 case -F:
13 if ($#argv < 2) then
14 echo -F takes following font name.
15 exit(1)
16 endif
17 set argv=(-1 $2.r -2 $2.i -3 $2.b $argv[3-])
18 goto top
19
20 case -1:
21 case -2:
22 case -3:
23 if ($#argv < 2) then
24 echo $1 takes following font name.
25 exit(1)
26 endif
27 if (! -r /usr/lib/fontinfo/$2) then
28 if (! -r /usr/lib/fontinfo/$2.r) then
29 echo ${2}: font not found.
30 exit(1)
31 endif
32 set argv[2] = $2.r
33 endif
34 if ($#fonts == 0) then
35 set fontf=/usr/tmp/fnt$$
36 cp /dev/null $fontf
37 endif
38 @ fnum = 0 - $1
39 echo .nr p $fnum >> $fontf
40 cat /usr/lib/fontinfo/$2 >> $fontf
41 set fonts=($fonts $1 $2)
42 shift argv
43 shift argv
44 goto top
45
46 case -x:
47 set macp=()
48 shift argv
49 goto top
50
51 case -*:
52 set flags = ($flags $argv[1])
53 shift argv
54 goto top
55
56 endsw
57 endif
58if ($#argv == 0) then
59 set argv=(-)
60endif
61troff -t $flags $macp $fontf $* | \
62 /usr/lib/vsort $length | /usr/ucb/vpr -t $fonts
63if ($#fontf) then
64 rm $fontf
65endif