COHERENT manpages

This page displays the COHERENT manpage for troff [Extended text-formatting language].

List of available manpages
Index


troff -- Command

Extended text-formatting language
troff [option ...] [file ...]

The command troff  is the COHERENT typesetter and text-formatting language.
It  performs  typeset-quality text  formatting,  suitable  for printing  on
either the  Hewlett-Packard LaserJet II or III printers,  or on any printer
for which the PostScript language has been implemented.

troff Input

troff  processes  each  given  file,  or  the standard  input  if  none  is
specified, and  prints the  formatted result  on the standard  output.  The
input must consist of text with formatting commands embedded within it.

troff provides a  full suite of commands that set  line length, page length
and  page offset,  generate vertical  and horizontal  motions, indentation,
fill and  adjust output lines,  and center text.  The  great flexibility of
troff lies  in its acceptance of user-defined macros  to control almost all
higher-level formatting.  For  example, the formation of paragraphs, header
and footer  areas, and footnotes  must all be  implemented by the  user via
macros.

troff uses a  superset of the commands and syntax  used by nroff, the other
COHERENT  text-formatter: files  prepared  for the  latter  usually can  be
processed through the  former without requiring any changes.  troff differs
from nroff  in that nroff  can perform only  monospaced formatting, whereas
troff can handle multiple fonts of type, both monospaced and proportionally
spaced.  It  lets you  load font-width tables  dynamically, so you  can use
whatever fonts  you have loaded into  your printer at a  given time.  troff
also lets  you move about  the page in  increments other than  sixths of an
inch vertically or tenths of an inch horizontally.

troff  produces  output  either  in  the  Hewlett-Packard  Printer  Control
Language  (PCL) or  PostScript, whichever  you prefer.   The former  can be
printed on  the Hewlett-Packard LaserJet  family of laser  printer, and can
use any  PCL bitmapped  ``soft font''.   The latter can  be printed  on any
printer that  supports the  PostScript language, and  can use any  font for
which  you have  an  Adobe Font  Metric  description.  The  default is  PCL
output; to  obtain PostScript, use  the -p command-line  option.  See below
for information on how to manage downloadable fonts.

Command-line Options

Command-line options may be listed in any order.  They are as follows:

-d      Debug: print  each request before  execution.  This option  is very
        useful when you are writing and debugging new macros.

-D      Display the  available fonts.   These are  all the fonts  that have
        been loaded into troff with the .lf primitive (described below).

-f name Write the temporary file into file name.

-i files
        Read from the standard input after reading the given files.

-k      Keep: do not erase the temporary file.

-l      Landscape mode: output is  rotated 90 degrees, with default size 11
        by 8.5 inches rather than 8.5 by 11 inches.

-mname  Include the macro file /usr/lib/tmac.name in the input stream.

-nN     Number the first page of output N.

-p      Produce  output for  a  PostScript printer  rather than  for a  HP-
        compatible printer.

-raN    Set number register a to the value N.

-rabN   Set number register ab to  value N.  For obvious reasons, ab cannot
        contain a digit.

-v      Return the number of your version.

-x      Do not eject  to the bottom of the last  page when text ends.  This
        option lets you use troff interactively, which is especially useful
        when debugging macros.

If  the environmental  variable TROFF  is  set when  troff is  invoked, its
contents are  prefixed to the list of  command-line arguments.  This allows
the user to  set commonly used options once in  the environment rather than
on each troff command line.

troff Primitives

As noted earlier, troff's command set  is a superset of that used by nroff:
see the Lexicon  entry on nroff for information on  the commands and escape
sequences shared by troff  and nroff. This article describes the primitives
that troff does not share with nroff.

Please note that the basic troff unit is one-tenth of a point.  A printer's
point is 1/12 of a pica,  which is in turn one-sixth of an inch; therefore,
there are 72 points and 720 troff units in an inch.

.co endmark
     Copy input  to output file  directly, with no  processing.  If endmark
     argument  is  present,  troff  copies  input  until it  finds  a  line
     containing  endmark followed  by \n.   If no  endmark is  given, troff
     copies input  until it finds a line  containing .co\n.  This directive
     is useful for embedding PostScript commands in an input file.

.cs XX N M
     Set  font XX  to use  constant character spacing.   The width  of each
     character is N  divided by 36 ems.  If M  is present, it specifies the
     width of an em; otherwise,  N  assumes the point size em for the given
     font.

.fd  Display the currently available fonts.

.fp N XX
     Associate  font name  XX with  numeric  font position  N. The  given N
     should be  a number between  1 and 9.  Subsequently,  the numeric font
     position can  be used in  an escape sequence  \fN to select  the font.
     (This  nomenclature comes  from  the days  when phototypesetters  used
     print  wheels that  were set  in fixed positions  on the  device.) The
     nroff primitive  .rf performs a similar task, and  is more flexible in
     its syntax.

.fz XX N
     Fix the  point size of font  XX at N. The point size  of the font will
     not be affected by subsequent .ps commands or \sN point size escapes.

.lf XX file [n]
     Load font-width table from file and use it for font XX. If file is not
     found,   troff    looks   for    /usr/lib/roff/troff_pcl/fwt/file   or
     /usr/lib/roff/troff_ps/fwt/file (depending on whether the -p option is
     used).

     The optional third argument sets  the default point size of the loaded
     font  to n.  Note that  this argument  takes effect  only if  troff is
     running in -p (PostScript) mode.

     For example,  to load the font-width table for  the PCL bitmapped font
     cn090rpn.usp (which sets Century Roman, nine point, portrait mode) and
     name it font RS, use the command:

         .lf RS cn090rpn.usp

     To do the same thing under PostScript, use the command:

         .lf RS Century_R.fwt 9

     Thereafter, you can reference font RS with either .ft RS or \f(RS.

     Note that the second argument to this primitive must name a font-width
     table generated by the  COHERENT command fwtable, not the font itself,
     although both may have the same name.

     Please  note that  .lf  is unique  to the  COHERENT implementation  of
     troff, and cannot be ported to other implementations.

.ps Np
     Set point size to N points.  The default point size is 10 point.

.rb file
     Read input  from file  and copy it  to the output  without processing.
     This  directive is  useful for  including files  containing PostScript
     routines in the output.

.ss N
     Set the minimum word spacing to N divided by 36 ems.

.vs Np
     Set the  vertical spacing to  N points.  The  default vertical spacing
     for troff is 11 points.

Escape Sequences

troff  recognizes the  following  escape sequences,  in  addition to  those
recognized by nroff:

\|   Set a 1/6th-em half-narrow space character.

\^   Set a 1/12th-em half-narrow space character.

\s´N´
     Set the  point-size escape sequence  to N. Like the  .ps primitive, it
     changes the point  size to N. The specified N  may have a leading plus
     or minus sign to make the new size relative to the current point size.

\Xdd Output  character dd  where dd  are two  hexadecimal digits.   This is
     useful  for  forcing  troff to  print  characters  outside the  normal
     printable  range, e.g.,  those  with the  high-order  bit set.   troff
     reserves the following values for its internal use:

          <ctrl-space>  0X00 Ignored
          <ctrl-A>      0X01 Leader dots, same as ``\a''
          <ctrl-I>      0X09 Tab, same as ``\t''
          <ctrl-J>      0X10 Newline

     The  hexadecimal  values  to  which  characters  map depend  upon  the
     character set  that you (or your printer) use.   For example, to print
     the character `û'  using the Hewlett-Packard Laser-Jet printer and the
     Pacific Page cartridge, use the escape sequence \XFB.

     The escape  sequence \X  is unique  to the COHERENT  implementation of
     nroff and troff. Code that uses it will behave differently when ported
     to other implementations.

Number Registers

The basic unit  of measure under troff is the  decipoint, or one-tenth of a
printer's point.   A point  is one-tenth  of a pica,  which in turn  is one
sixth  of an  inch;  therefore, there  are  72 points  in an  inch, or  720
decipoints.  All troff number registers that hold information about page or
type dimensions hold that  information in decipoints.  For this reason, the
decipoint is sometimes called the ``machine unit.''

The following  table shows how other units of  measure translate into troff
machine units:

     inch:                         1i = 720u
     vertical line space:          1v = 110u
     centimeter:                   1c = 283u
     em:                           1m = 100u
     en:                           1n = 50u
     pica:                         1P = 120u
     point:                        1p = 10u

If you are  working with PostScript, you must remember  to divide the value
of a troff number register by  ten before you pass the value to PostScript,
or  you will  see very  strange  results on  your page  -- or  likelier, no
results at all.

Special Characters

troff includes  a set of  escape sequences for  setting special characters.
These     escape     sequences     are     defined     in     the     files
/usr/lib/roff/troff_*/specials.r.  If  you  have  additional  fonts  or  an
extended PostScript  cartridge on your printer, you  can modify these files
to change the current definitions or add new ones.

The following  shows the escape sequences  currently defined in specials.r,
and the character each prints:

\(em --                  \(hy -                   \(bu ->
\(sq []                  \(ru _                   \(14 ¼
\(12 ½              \(34 ¾              \(fi fi
\(fl fl                  \(ff ff                  \(Fi ffi
\(Fl ffl                 \(de °              \(dg +
\(fm '                   \(ct cents               \(rg ®
\(co ©              \(tm [tm]                \(pl +
\(mi -                   \(eq =                   \(** *
\(sc §              \(aa ´              \(ga `
\(ul _                   \(sl /                   \(*a alpha
\(*b beta                \(*g gamma               \(*d delta
\(*e epsilon             \(*z zeta                \(*y eta
\(*h theta               \(*i iota                \(*k kappa
\(*l lambda              \(*m ´              \(*n nu
\(*c xi                  \(*o omicron             \(*p pi
\(*r rho                 \(*s sigma               \(ts sigma
\(*t tau                 \(*u upsilon             \(*f phi
\(*x chi                 \(*q psi                 \(*w omega
\(*A Alpha               \(*B Beta                \(*G Gamma
\(*D Delta               \(*E Epsilon             \(*Z Zeta
\(*Y Eta                 \(*H Theta               \(*I Iota
\(*K Kappa               \(*L Lambda              \(*M Mu
\(*N Nu                  \(*C Xi                  \(*O Omicron
\(*P Pi                  \(*R Rho                 \(*S Sigma
\(*T Tau                 \(*U Upsilon             \(*F Phi
\(*X Chi                 \(*Q Psi                 \(*W Omega
\(sr square root         \(rn                     \(>=>=
\(<=                  <=   \(==                ==   \(~=~=
\(ap ~                   \(!= !=                  \(->->
\(<-                  <-   \(ua                ^    \(dav
\(mu ×              \(di ÷              \(+- ±
\(cu union               \(ca intersection        \(sb subset of
\(sp superset of         \(ib improper subset of  \(ip improper superset of
\(in infinity            \(pd partial derivitive  \(gr gradient
\(no not                 \(is integral            \(pt proportional to
\(es {}                  \(mo member of           \(br |
\(dd double dagger       \(rh ->                  \(lh <-
\(or |                   \(ci O                   \(lt (
\(lb (                   \(rt )                   \(rb )
\(lk (                   \(rk )                   \(bv |
\(lf [                   \(rf ]                   \(lc [
\(rc ]

Printer Configuration

troff  reads  several  files  in  directory  /usr/lib/roff/troff_pcl  (when
generating   PCL  output)   or   /usr/lib/roff/troff_ps  (when   generating
PostScript)  to  find   printer-specific  information.   It  reads  special
character definitions from  file specials.r. It reads font loading requests
from file fonts.r. It copies file  .pre at the beginning of the output.  It
copies file .post at the end of the output.  In landscape mode, troff looks
for files .pre_land and .post_land  instead.  You can change these files as
desired to include printer-specific commands in troff output.

Managing Fonts

As noted  above, troff  produces output  in either of  two page-description
languages: the Hewlett-Packard Printer Control Language (PCL), which is the
``native language'' of  Hewlett-Packard's LaserJet printers; or PostScript.
The COHERENT system  also comes with tools that lets  you process fonts, so
that you  can use with  troff either downloadable  soft fonts or  the fonts
that are on board your printer.

The following two sections describe how to manage fonts under PCL and under
PostScript.  You  should refer to  the section that is  appropriate to your
type of printer.

PCL Fonts

Before troff can use a font, it must know the following information:

-> What the width of every character of the font is, and
-> How it can tell the printer to print that font.

Both pieces of information are stored  in a file called a font-width table.
Before troff  can use a  font, it must  read the font-width  table for that
font.

To load a  font-width table into troff, use the  primitive .lf.  Its syntax
is as follows:

    .lf XX file

XX gives  the name by which  you will call the font  in your troff program.
file is  the font-width table  for this font.   If file is not  a full path
name, troff looks for it in directory /usr/lib/roff/troff_pcl/fwt.

COHERENT comes with font-width tables  for a number of commonly used fonts.
The  following tables  are  for the  fonts built  into the  Hewlett-Packard
LaserJet III:

Table............ Description
CGTimes_B.fwt.... Times Bold, scalable, rotatable
CGTimes_BI.fwt... Times Bold Italic, scalable, rotatable
CGTimes_I.fwt.... Times Italic, scalable, rotatable
CGTimes_R.fwt.... Times Roman, scalable, rotatable
Cour10_B.fwt..... Courier Bold, ten point, portrait
Cour10_I.fwt..... Courier Italic, ten point, portrait
Cour10_R.fwt..... Courier Roman, ten point, portrait
Cour12L_B.fwt.... Courier Bold, 12 point, landscape
Cour12L_R.fwt.... Courier Roman, 12 point, landscape
Cour12_B.fwt..... Courier Bold, 12 point, portrait
Cour12_I.fwt..... Courier Italic, 12 point, portrait
Cour12_R.fwt..... Courier Roman, 12 point, portrait
LinepL_R.fwt..... Line Printer, 8.5 point, landscape
Linep_R.fwt...... Line Printer, 8.5 point, portrait
Univers_B.fwt.... Univers Bold, scalable, rotatable
Univers_BI.fwt... Univers Bold Italic, scalable, rotatable
Univers_I.fwt.... Univers Italic, scalable, rotatable
Univers_R.fwt.... Univers Roman, scalable, rotatable

Note  that the  scalable Hewlett-Packard  fonts are set  by default  at 250
points in size -- that is,  about 3.5 inches.  Because you cannot scale PCL
fonts when you load them, you must use the .ps primitive to size the font.

The  following troff  program demonstrates scalable  fonts on  the Hewlett-
Packard LaserJet III:

    .lf TR CGTimes_R.fwt
    .lf TB CGTimes_B.fwt
    .lf TI CGTimes_I.fwt
    .lf UR Univers_R.fwt
    .lf UB Univers_B.fwt
    .lf UI Univers_I.fwt
    .vs 14p
    .ps 12p
    \f(TRThis is Times Roman, 12 point.
    .sp
    \f(TBThis is Times Bold, 12 point.
    .sp
    \f(TIThis is Times Italic, 12 point.
    .vs 26p
    .ps 24p
    \f(URThis is Univers Roman, 24 point.
    .sp
    \f(UBThis is Univers Bold, 24 point.
    .sp
    \f(UIThis is Univers Italic, 24 point.
    .br

Note that this  program does not run correctly if  downloaded to a LaserJet
II, or to any printer that is running PostScript.

The COHERENT command fwtable lets  you build new font-width tables.  It can
build tables for  PCL bit-mapped soft fonts, as well  as for fonts that are
built into the LaserJet III.

To manipulate PCL bit-mapped soft fonts, do the following:

-> Use the command fwtable to build  a font-width table from the font.  The
   input  to fwtable  should be  the soft  font itself;  and the  output of
   fwtable should be redirected  into an appropriately named file.  See the
   lists of tables  given above for an idea of  how to name your font-width
   table.

-> Move    the   newly    created   font-width    table    into   directory
   /usr/lib/roff/troff_pcl/fwt.

-> Move the  font itself into  directory /usr/lib/roff/troff_pcl/fonts. You
   may need  to create  this directory  if this is  the first time  you are
   using soft fonts.

-> Include the  instruction .lf in  your troff file to  load the font-width
   table and  name the  font, as  shown above.  If  you use the  same fonts
   repeatedly, you may wish to put  the .lf primitives into a separate file
   that you always include on your troff command line via the environmental
   variable TROFF.

-> Before you  print your document,  load the soft font  into your printer.
   If you are using the hp  spooler to spool files to your printer, use the
   command hpr  -f. If you  are using the  MLP spooler, then  you must pre-
   process the font with the command pclfont, then spool the processed font
   to device hpraw. Both commands  are described in detail in their Lexicon
   entries.  Briefly, to load  font tr100bpn.usp into your printer, use the
   command

       hpr -f /usr/lib/roff/troff_pcl/fonts/tr100bpn.usp

   or the command:

       pclfont /usr/lib/roff/troff_pcl/fonts/tr100bpn.usp | lp -d hpraw

   These commands also  let you specify what ``slot'' to  put the font; you
   can  use this  to help  manage fonts  in your  printer.  By  placing the
   frequently used  fonts in the lower  slots, you can then  load the less-
   frequently used  fonts into  the upper  slots, and overwrite  just those
   fonts when you change fonts for  another printing job.  You must do such
   font management by hand -- COHERENT  does not include a utility to do it
   for you.

   You may wish  to write the font-loading commands into  a script that you
   execute before  you print a job.   You must reload fonts  every time you
   power up your printer or clear its memory.

To build a font-width table for a font built into your LaserJet III, do the
following:

-> Each font on your printer is  described with a .tfm file, which comes on
   a disk  with your printer.  (If  you did not receive  such a disk, check
   with  the dealer  from which  you  purchased your  printer, or  write to
   Hewlett-Packard.) Use  the COHERENT command doscp to  copy the .tfm file
   for the font that interests you from the disk.

-> Use the  command fwtable  -t to build  the font-width table.   Its input
   should be  the .tfm  file that you  just uploaded.  Redirect  its output
   into an appropriate named file.

-> Move    the   newly    created   font-width    table    into   directory
   /usr/lib/roff/troff_pcl/fwt.

-> Note that because  the font is build into your  printer, you do not need
   to download anything before you can  use the font.  When troff reads the
   font-width table, it will know how to invoke the font on your printer.

PostScript Fonts

Before troff can use a font, it must know the following information:

-> What the width of every character of the font is, and
-> How it can tell the printer to print that font.

Both pieces of information are stored  in a file called a font-width table.
Before troff  can use a  font, it must  read the font-width  table for that
font.

To  load a  font  into troff,  use  the primitive  .lf.  Its  syntax is  as
follows:

    .lf XX file [n]

XX gives  the name by which  you will call the font  in your troff program.
file is  the font-width table  for this font.   If file is not  a full path
name, troff looks for it either in directory /usr/lib/roff/troff_ps/fwt.

The  optional argument  n lets  you size  the font.   This applies  only to
PostScript scalable fonts.  All fonts  that are loaded with this option are
not affected by the .ps primitive.

For example, the instruction

    .lf HR  HelvNar_R.fwt  12

loads a font  for PostScript output.  The font is  named HR. The font-width
table is read from file /usr/lib/roff/troff_ps/HelvNar_R.fwt, which defines
the font Helvetica Narrow Roman.  Finally,  it sizes the font to 12 points.
Hereafter, the instructions .ft HR or \f(HR invoke this font.

COHERENT comes with font-width tables  for a number of commonly used fonts.
The following tables are for  PostScript fonts.  LaserJet III, and are kept
in directory /usr/lib/roff/troff_pcl/fwt.  All are, of course, scalable and
rotatable:

Table............ Description
Avant_B.fwt...... Avant-Garde Roman (Gothic Book)
Avant_BI.fwt..... Avant-Garde Bold Italic
Avant_I.fwt...... Avant-Garde Italic
Avant_R.fwt...... Avant-Garde Roman
Bookman_B.fwt.... Bookman Bold
Bookman_BI.fwt... Bookman Bold Italic
Bookman_I.fwt.... Bookman Italic
Bookman_R.fwt.... Bookman Roman
Century_B.fwt.... Century Bold
Century_BI.fwt... Century Bold Italic
Century_I.fwt.... Century Italic
Century_R.fwt.... Century Roman
Chancery_I.fwt... Zapf Chancery Italic
Courier_B.fwt.... Courier Bold
Courier_BI.fwt... Courier Bold Italic
Courier_I.fwt.... Courier Italic
Courier_R.fwt.... Courier Roman
Dingbats.fwt..... Zapf Dingbats
HelvNar_B.fwt.... Helvetica Narrow Bold
HelvNar_BI.fwt... Helvetica Narrow Bold Italic
HelvNar_I.fwt.... Helvetica Narrow Italic
HelvNar_R.fwt.... Helvetica Narrow Roman
Helv_B.fwt....... Helvetica Bold
Helv_BI.fwt...... Helvetica Bold Italic
Helv_I.fwt....... Helvetica Italic
Helv_R.fwt....... Helvetica Narrow
Pala_B.fwt....... Zapf Calligraphic Bold (Palatino)
Pala_BI.fwt...... Zapf Calligraphic Bold Italic
Pala_I.fwt....... Zapf Calligraphic Italic
Pala_R.fwt....... Zapf Calligraphic Roman
Symbol.fwt....... Symbols
Times_B.fwt...... Times Bold
Times_BI.fwt..... Times Bold Italic
Times_I.fwt...... Times Italic
Times_R.fwt...... Times Roman

Note that these tables are designed  for the fonts used on the Pacific Page
implementation  of the  PostScript language.  They  may not  work correctly
with genuine Adobe fonts.

The following gives an example program to demonstrate the PostScript fonts:

    .lf HR  HelvNar_R.fwt  12
    .lf HC  Avant_B.fwt    24
    .lf DB  Dingbats.fwt    9
    .vs 14
    .sp
    \f(HRThis is 12-point Helvetic Narrow Roman
    .vs 26
    .sp
    \f(HCThis is 24-point Avant-Garde
    .vs 11
    .sp
    \fRA row of dingbats:  \f(DBa row of dingbats

This program will not work unless  you format using the -p option to troff,
and print it on a  PostScript printer.  Please note that because PostScript
is a portable language, you can print the PostScript output of troff on any
printer that implements PostScript, not just the Hewlett-Packard LaserJet.

COHERENT comes with tools with which you can ``cook'' fonts so that you can
use with  with troff, whether the  fonts are downloadable soft  fonts or on
board a  cartridge.  To cook  fonts that are  on-board a cartridge  in your
printer, do the following:

-> First, the  PostScript cartridge  should come with  a set of  files that
   give font-width  information.  These have the  suffix .afm; there should
   be one  file for each  font in your  cartridge.  If you  did not receive
   such  a  cartridge, contact  the  dealer from  which  you purchased  the
   cartridge,  or contact  the cartridge's  manufacturer.  Use  the command
   doscp to copy the .afm files from the disk onto your COHERENT system.

-> Use the  command fwtable -p  to cook each  .afm file into  troff's font-
   width table  format.  Each font-width table that  you create should have
   the suffix  .fwt, and should  be named so that  it appropriate describes
   the font.  See the above table of font-width tables for examples.

   Move    the   newly   created    font-width   tables    into   directory
   /usr/lib/roff/troff_ps/fwt.

   Thereafter, when  you write  a troff program,  use the .lf  primitive to
   load the font-width table.  You may wish to create a file called fonts.r
   that  routinely  loads  all  of  the  font-width  tables  that  you  use
   routinely.  You do  not need to load fonts into  your printer; the font-
   width table  includes the  information needed  so that troff  can invoke
   them from your cartridge.

COHERENT  comes with  tools to  help you manage  download soft  fonts under
PostScript.  Note  that the fonts  must be in  the Adobe Font  Metric (AFM)
format.  To manage downloadable AFM fonts, do the following:

-> A  downloadable AFM  font comes  in three files:  a file  of information
   about the  font, which  has the  suffix .inf; a  file that  contains the
   font-width table,  which has the  suffix .afm; and a  file that contains
   the font  itself, which has  the suffix .pfb.   You can ignore  the .inf
   file;  it is  not used  in this  process.  You  should use  the COHERENT
   command doscp  -b to  copy the  .pfb from the  floppy disk; and  use the
   command doscp -a to copy the .afm file from floppy disk.  (The options -
   b and -a stand, respectively, for binary and ASCII modes.)

-> Use the command

       fwtable -p fontname.afm fontname.fwt

   to  generate the  font-width table  from the .afm  file.  Note  that the
   font-width table should have the suffix .fwt.  By convention, you should
   give  the font-width  table  the same  name  as the  font,  to help  you
   remember  which  table  goes with  which  font;  this,  however, is  not
   required.  For  example, to  create the  font-width table for  the Adobe
   font Avant Garde bold, use the following command:

       fwtable -p avgb____.afm avgb____.fwt

-> Move    the   newly    created   font-width    table    into   directory
   /usr/lib/roff/troff_ps/fwt.

-> Next, use the command PSfont to  ``cook'' the .pfb file into a form that
   can be downloaded to your printer.   Note that a font can be cooked into
   either of two  forms.  The first form permits the  font to stay resident
   in your printer, so that you can use it to print an indefinite number of
   documents.  The second form does not permit the font to stay resident in
   your printer, but it does permit you to include the font directly within
   your troff output.   The first form is the default  output of PSfont; to
   create the  second form, invoke PSfont with its  option -s. For example,
   to cook the font Avant Garde  bold into the first output format, use the
   command:

       PSfont avgb____.pfb avgb____.ps1

   To it into the second form, use the command:

       PSfont -s avgb____.pfb avgb____.ps2

   Note that  the suffix .ps1  indicates the first  (stay-resident) form of
   the font, whereas the suffix .ps2 indicates the second (includable) form
   of  the  font.   These suffixes  are  simply  conventions,  and are  not
   required.

-> Move the  newly created fonts  into directory /usr/lib/roff/troff_ps/ps.
   Note that you may need to  create this directory when you first begin to
   process fonts.

-> When you  create a troff program,  use the primitive .lf  to include the
   font-width table for this font and size the font, as described above.

-> If you have processed the fonts into the first (stay-resident) form, you
   must load them into your printer before you can print any documents.  To
   download  the font,  use either  the command  hpr -B  or the  command lp
   -dprinter (where  printer names the  printer to which the  font is being
   downloaded).   For example,  to download  the Avant  Garde bold  font to
   printer hpraw, use the command:

       lp -dhpraw /usr/lib/roff/troff_ps/ps/avgb____.ps1

   (For more information  on the command lp, see its  entry in the Lexicon,
   or  see the  entry for  printer.)  You may  wish to  create a  script to
   download the fonts that you use commonly.  Note that you must reload the
   fonts into  your printer every time  you either power up  the printer or
   clear out its memory.   Note, too, that downloading and processing stay-
   resident fonts  may take several minutes,  depending upon your printer's
   make.

-> To use the ``includable'' form of a font, use the troff primitive .rb to
   load  it  into the  troff.  For  example, to  include  Avant Garde  bold
   directly within  your troff output,  include the following  statement in
   your troff source:

       .rb /usr/lib/roff/troff_ps/ps/avgb____.ps2

   If you use  some downloadable fonts commonly, you may  wish to include a
   set of  .rb statements for  the fonts in  file fonts.r. Note  that files
   that include  downloadable fonts will be much larger  than those that do
   not use them.

Files

/tmp/rof* -- Temporary files
/usr/lib/tmac.* -- Standard macro packages
/usr/lib/roff/troff_pcl/ -- Support files directory for PCL
/usr/lib/roff/troff_ps/ -- Support files directory for PostScript
/usr/lib/roff/troff_*/.pre --  Output prefix
/usr/lib/roff/troff_*/.pre_land -- Output prefix, landscape mode
/usr/lib/roff/troff_*/.post -- Output suffix
/usr/lib/roff/troff_*/.post_land -- Output suffix, landscape mode
/usr/lib/roff/troff_*/fonts.r -- Font definitions
/usr/lib/roff/troff_*/fwt/ -- Directory for font width tables
/usr/lib/roff/troff_*/specials.r -- Special character definitions

See Also

col,
commands,
deroff,
fwtable,
hpr,
lp,
man,
ms,
nroff,
printer,
PSfont
nroff, The Text-Formatting Language, tutorial

Adobe Systems Incorporated:  PostScript Language Reference Manual. Reading,
Mass.: Addison-Wesley Publishing Company, Inc., 1988.

Adobe  Systems  Incorporated: PostScript  Language  Tutorial and  Cookbook.
Reading, Mass.: Addison-Wesley Publishing Company, Inc., 1988.

Emerson, S.L., Paulsell,  K.: troff Typesetting for Unix Systems. Englewood
Cliffs, N.J.: Prentice-Hall, Inc., 1987 (ISBN 0-13-930959-4).

Lawson, A.: Printing Types: An Introduction.  Boston: Beacon Press, 1971.

Lawson,  A.: Anatomy  of a  Typeface. Boston:  David R.  Godine, Publisher,
1990.

Diagnostics

For a  list of the error  messages that troff can  produce, see the Lexicon
entry for nroff.

Notes

Like nroff, troff should be used with the macro packages ms, which is found
in  the  file  /usr/lib/tmac.s,  and  man,  which  is  found  in  the  file
/usr/lib/tmac.an.

troff output, unlike that of  nroff, cannot be processed through a terminal
driver.  If  you redirect the output  of troff to a  terminal, all you will
see is the literal program it outputs.

Laser printers cannot  print on an area near each  edge of the output page.
Output sent to the unprintable  area will disappear.  On some printers, the
logical page  does not  correspond to the  physical page, so  printed troff
output may be offset from the specified position on the physical page.