home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume5 / htroff2 / htroff < prev   
Encoding:
Text File  |  1989-02-03  |  1.1 KB  |  54 lines

  1. :
  2. # htroff - troff for HP LaserJet
  3. # Usage: htroff [-options] [files]
  4. #
  5. # Special options:
  6. # -nXX    mount font XX on position n (n = 1-3)
  7. # -dYY    download font YY
  8. #
  9. # Sends its output to the LaserJet automatically.
  10. # Latest revision: 07/26/88
  11.  
  12. translate=troff2lj
  13. #translate=/usr/local/lib/troff2lj
  14. printcmd='lpr -plaserjet'
  15. #printcmd='uux -n - "sst!/usr/ucb/lpr -Prhp"'
  16. download= # null to start out with
  17. dfiles=
  18.  
  19. options=-t # Send output to stdout instead of /dev/cat.
  20. ljopts=
  21. files=
  22. font1=R
  23. font2=I
  24. font3=B
  25.  
  26. for arg
  27. do
  28.     case $arg in
  29.     -) files="$files $arg" ;;
  30.     -d*) download="download -d";
  31.          dfiles="$dfiles `echo $arg|sed 's/-d//'`" ;;
  32.     -1*) font1=`echo $arg|sed 's/-1//'`; ljopts="$ljopts $arg" ;;
  33.     -2*) font2=`echo $arg|sed 's/-2//'`; ljopts="$ljopts $arg" ;;
  34.     -3*) font3=`echo $arg|sed 's/-3//'`; ljopts="$ljopts $arg" ;;
  35.     -[4-9]*|-0*) echo "Illegal font mount: $arg" >&2; exit 1 ;;
  36.     -*) options="$options $arg" ;;
  37.     *) files="$files $arg" ;;
  38.     esac
  39. done
  40.  
  41. {
  42. $download $dfiles
  43. {
  44. echo "\
  45. .fp 1 $font1
  46. .fp 2 $font2
  47. .fp 3 $font3
  48. .fp 4 S
  49. .lg 0"
  50.  
  51. cat $files
  52. } | troff $options | $translate $ljopts
  53. } | $printcmd
  54.