trofftable.rc: make work

This commit is contained in:
Humm 2021-04-09 16:05:30 +02:00
parent 1b4758d596
commit a0997f38c4
3 changed files with 1173 additions and 1164 deletions

File diff suppressed because it is too large Load diff

View file

@ -1,46 +1,63 @@
.ds dF /usr/lib/font .ds dF /sys/lib/troff/font
.ds dQ /usr/lib/postscript .ds dQ /sys/lib/postscript/prologues
.TH TROFFTABLE 1 "DWB 3.2" .TH TROFFTABLE 1
.SH NAME .SH NAME
.B trofftable trofftable \- output a PostScript program that builds a font width table
\- output a PostScript program that builds a font width table
.SH SYNOPSIS .SH SYNOPSIS
\*(mBtrofftable\f1
.OP "" options []
.OP "" shortname
.OP "" longname []
.SH DESCRIPTION
.B trofftable .B trofftable
[
.B -t
.I name
] [
.B -C
.I file
] [
.B -H
.I hostdir
] [
.B -L
.I file
] [
.B -S
.I file
] [
.B -T
.I name
]
.I shortname
[
.I longname
]
.SH DESCRIPTION
.I Trofftable
writes a PostScript program on the standard output that builds a writes a PostScript program on the standard output that builds a
font width table or typesetter description file. font width table or typesetter description file.
The following The following options are understood:
.I options .TP
are understood: .BI -t " name"
.TP 1.0i
.OP \-t name
Use Use
.I name .I name
as the template for fonts not in the default set. as the template for fonts not in the default set.
Choose Choose
.MW R .B R
for proportionally spaced fonts and for proportionally spaced fonts and
.MW CW .B CW
for fixed width fonts. for fixed width fonts.
Try Try
.MW ZD .B ZD
(ZapfDingbats) if the font has a non-standard (ZapfDingbats) if the font has a non-standard
character set. character set.
The default is The default is
.MR R . .BR R .
.TP 1.0i .TP
.OP \-C file .BI -C " file"
Copy Copy
.I file .I file
into each PostScript table program; into each PostScript table program;
.I file .I file
must contain legitimate PostScript. must contain legitimate PostScript.
.TP 1.0i .TP
.OP \-H hostdir .BI -H " hostdir"
Use Use
.I hostdir .I hostdir
as the host resident font directory. as the host resident font directory.
@ -50,55 +67,55 @@ that matches the name of the troff font is assumed to be a host
resident font program and is included in the PostScript width resident font program and is included in the PostScript width
table program. table program.
There is no default. There is no default.
.TP 1.0i .TP
.OP \-L file .BI -L " file"
Use Use
.I file .I file
as the PostScript prologue. as the PostScript prologue.
.br .br
The default is The default is
.MW \*(dQ/trofftable.ps .B \*(dQ/trofftable.ps
.TP 1.0i .TP
.OP \-S file .BI -S " file"
Use Use
.I file .I file
as the shell library file. as the shell library file.
Overrides the choice made with the Overrides the choice made with the
.OP \-T .B -T
option. option.
.TP 1.0i .TP
.OP \-T name .BI -T " name"
Set the target device to Set the target device to
.IR name . .IR name .
Device Device
.I name .I name
means means
.br .br
.MI \*(dF/dev name /shell.lib .BI \*(dF/dev name /shell.lib
is the shell library file. is the shell library file.
There is no default. There is no default.
.PP .PP
One of One of
.OP \-T .B -T
or or
.OP \-S .B -S
is required. is required.
If both are given If both are given
.OP \-S .B -S
wins. wins.
Either Either
.OP \-H .B -H
or or
.OP \-C .B -C
can be used to include a host resident font. can be used to include a host resident font.
.PP .PP
The shell library file defines a collection of functions used to The shell library file defines a collection of functions used to
build troff tables. build troff tables.
The default set of tables is the list of names returned by the The default set of tables is the list of names returned by the
.MW AllTables .B AllTables
function. function.
Changes to the default list can be made by updating the Changes to the default list can be made by updating the
.MW BuiltinTables .B BuiltinTables
function. function.
.PP .PP
.I Shortname .I Shortname
@ -112,16 +129,16 @@ can be omitted only if
.I shortname .I shortname
is a default table name. is a default table name.
PostScript table programs created by PostScript table programs created by
.B trofftable .I trofftable
return data to the host computer using PostScript's return data to the host computer using PostScript's
.MW print .B print
operator. operator.
See See
.BR hardcopy (1) .IR hardcopy (1)
if you don't have access to the printer's serial port. if you don't have access to the printer's serial port.
.SH EXAMPLES .SH EXAMPLES
Get the PostScript program that builds a width table for font Get the PostScript program that builds a width table for font
.MR R : .BR R :
.EX .EX
trofftable -Tpost R >R.ps trofftable -Tpost R >R.ps
.EE .EE
@ -133,32 +150,32 @@ trofftable -TLatin1 GL Garamond-Light >GL.ps
.EE .EE
A font must be available on the printer when the table is built. A font must be available on the printer when the table is built.
Use Use
.OP \-H .B -H
or or
.OP \-C .B -C
to include host resident fonts. to include host resident fonts.
.SH WARNINGS .SH WARNINGS
A width table will not build properly if the printer cannot access A width table will not build properly if the printer cannot access
the PostScript font. the PostScript font.
.PP .PP
The The
.OP -TLatin1 .B -TLatin1
option only works on PostScript printers that support the full option only works on PostScript printers that support the full
.SM ISO .SM ISO
Latin-1 character set. Latin-1 character set.
The error message from older printers will likely indicate a missing The error message from older printers will likely indicate a missing
.MW ISOLatin1Encoding .B ISOLatin1Encoding
array. array.
.SH FILES .SH FILES
.MW \*(dF/dev*/shell.lib .B \*(dF/dev*/shell.lib
.br .br
.MW \*(dQ/dpost.ps .B \*(dQ/dpost.ps
.br .br
.MW \*(dQ/trofftable.ps .B \*(dQ/trofftable.ps
.SH SEE ALSO .SH SEE ALSO
.BR dpost (1), .IR dpost (1),
.BR hardcopy (1), .IR hardcopy (1),
.BR postio (1), .IR postio (1),
.BR troff (1), .IR troff (1),
.BR buildtables (1), .IR buildtables (1),
.BR font (5) .IR font (5)

View file

@ -5,6 +5,8 @@
# serial port. Try hardcopy if you don't have access to the port. # serial port. Try hardcopy if you don't have access to the port.
# #
rfork e
POSTLIB=/sys/lib/postscript/prologues POSTLIB=/sys/lib/postscript/prologues
FONTDIR=/sys/lib/troff/font FONTDIR=/sys/lib/troff/font
@ -15,7 +17,7 @@ COPYFILE=()
HOSTFONTDIR=() HOSTFONTDIR=()
DEVICE=() DEVICE=()
LIBRARY=() LIBRARY=()
TEMPLATE=-R TEMPLATE=R
SLOWDOWN=25 SLOWDOWN=25
STARTCOMMENTS=256 STARTCOMMENTS=256
@ -28,8 +30,8 @@ TRAILER='%%Trailer'
while (! ~ $#* 0 && ~ $1 -*) { while (! ~ $#* 0 && ~ $1 -*) {
switch ($1) { switch ($1) {
case -C; shift; COPYFILE=$COPYFILE' '$1 case -C; shift; COPYFILE=($COPYFILE $1)
case -C*; COPYFILE=$COPYFILE' '`{echo $1 | sed s/-C//} case -C*; COPYFILE=($COPYFILE `{echo $1 | sed s/-C//})
case -F; shift; FONTDIR=$1 case -F; shift; FONTDIR=$1
case -F*; FONTDIR=`{echo $1 | sed s/-F//} case -F*; FONTDIR=`{echo $1 | sed s/-F//}
@ -63,7 +65,7 @@ while (! ~ $#* 0 && ~ $1 -*) {
shift shift
} }
if (! ~ $#DEVICE 0 && ! ~ $#LIBRARY 0) { if (~ $#DEVICE 0 && ~ $#LIBRARY 0) {
echo $0: no device or shell library >[1=2] echo $0: no device or shell library >[1=2]
exit 1 exit 1
} }
@ -73,28 +75,31 @@ if (! ~ $#* 1 2) {
exit 1 exit 1
} }
if (test -d $HOSTFONTDIR -a -f $HOSTFONTDIR/$1) { if (! ~ $#HOSTFONTDIR 0 && test -d $HOSTFONTDIR -a -f $HOSTFONTDIR/$1) {
COPYFILE=$COPYFILE' '$HOSTFONTDIR/$1 COPYFILE=($COPYFILE $HOSTFONTDIR/$1)
} }
# #
# Include the shell library and get the command used to build the table. # Include the shell library and get the command used to build the table.
# Make awk call a separate library function?? # Make awk call a separate library function??
# #
if (~ $#LIBRARY 0 || ~ $LIBRARY '') LIBRARY=$FONTDIR/dev$DEVICE/shell.lib if (~ $#LIBRARY 0) LIBRARY=$FONTDIR/dev$DEVICE/shell.lib
. $LIBRARY . $LIBRARY
if (~ $#* 1) TEMPLATE=$1 if (~ $#* 1) TEMPLATE=$1
if (~ $#* 2) pname=$2
if not pname=''
CMD=`{BuiltinTables | awk '$2 == template"" { CMD=`{BuiltinTables | awk '$2 == template"" {
if ( pname == "" ) if ( pname == "" )
pname = $3 pname = $3
printf "%s %s %s", $1, tname, pname printf "%s %s %s", $1, tname, pname
exit 0 exit 0
}' template=$TEMPLATE tname=$1 pname=$2} }' 'template='$TEMPLATE 'tname='$1 'pname='$pname}
if (! $CMD) { if (~ $#CMD 0) {
echo $0: $TEMPLATE not found >[1=2] echo $0: $TEMPLATE not found >[1=2]
exit 1 exit 1
} }
@ -111,8 +116,8 @@ echo end def
echo $ENDPROLOG echo $ENDPROLOG
echo $BEGINSETUP echo $BEGINSETUP
if (~ $COPYFILE '') COPYFILE=/dev/null if (! ~ $#COPYFILE 0)
cat $COPYFILE cat $COPYFILE
echo /slowdown $SLOWDOWN def echo /slowdown $SLOWDOWN def
echo /startcomments $STARTCOMMENTS def echo /startcomments $STARTCOMMENTS def
echo $ENDSETUP echo $ENDSETUP
@ -120,4 +125,3 @@ echo $ENDSETUP
$CMD $CMD
echo $TRAILER echo $TRAILER