home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OpenStep 4.2J
/
os42j.iso
/
usr
/
bin
/
ptroff
< prev
next >
Wrap
Text File
|
1997-04-25
|
2KB
|
70 lines
#! /bin/sh
# sh/ptroff.bsd
# Copyright 1985,1987 Adobe Systems Incorporated. All rights reserved.
# GOVERNMENT END USERS: See notice of rights in Notice file in TranScript
# library directory -- probably /usr/lib/ps/Notice
# RCSID: $Header: /disks/hobo/vp6/snichols/rel3.0/transcript/sh/RCS/ptroff.bsd,v 3.0 1991/06/17 17:29:09 snichols Exp $
#
# run troff in an environment to print on a PostScript printer
#
# ptroff - troff | pscat [| lpr]
PATH=/bin:/usr/bin:$PATH # Make sure we get system programs.
export PATH
opt= spool= pscatopt=
psfontlib=/usr/lib/transcript/troff.font
font=-F${psfontlib}
family=Times
# NeXT default printer
printer=`dread System Printer`
if test "$?" -ne 0 ; then
printer=-PLocal_Printer
else
printer=-P`dread System Printer | sed -e 's/.* //'`
fi
while test $# != 0
do case "$1" in
-F) if test "$#" -lt 2 ; then
echo '-F takes following font family name' 1>&2
exit 1
fi
family=$2 ; shift ;;
-F*) echo 'use -F familyname' 1>&2 ;
exit 1 ;;
-t) nospool=1 ;;
-#*|-h|-m) spool="$spool $1" ;;
-P*) printer=$1 ;;
-C) spool="$spool $1 $2"
classname=$2 ; shift ;;
-J) jobname=$2 ; shift ;;
-l) pscatopt="$pscatopt $1 $2"
shift ;;
-s) pscatopt="$pscatopt $1 $2"
shift ;;
-) fil="$fil $1" ;;
-*) opt="$opt $1" ;;
*) fil="$fil $1" ; jobname=${jobname-$1} ;;
esac
shift
done
spool="$printer $spool"
if test "$jobname" = "" ; then
jobname="Troff"
fi
spool="-J $jobname $spool"
if test "$fil" = "" ; then
fil="-"
fi
troff="troff -F${psfontlib}/${family}/ftXX -t $opt ${psfontlib}/${family}/font.head $fil "
pscat="pscat -F${psfontlib}/${family}/font.ct $pscatopt"
if test "$nospool" = "1" ; then
$troff | $pscat
else
$troff | $pscat | lpr $spool
fi