groff_font(5) — Linux manual page

Name | Description | Files | See also | COLOPHON

groff_font(5)              File Formats Manual             groff_font(5)

Name         top

       groff_font - GNU roff device and font description files

Description         top

       The groff font and output device description formats are slight
       extensions of those used by AT&T device-independent troff.  In
       distinction to the AT&T implementation, groff lacks a binary
       format; all files are text files.  (Plan 9 troff has also
       abandoned the binary format.)  The device and font description
       files for a device name are stored in a directory called devname.
       The device description file is called DESC, and, for each font f
       supported by the device, a font file called “f”, where f is
       usually an abbreviation of a font's name and/or style.  For
       example, the ps (PostScript) device has groff font description
       files for Times roman (TR) and Zapf Chancery Medium italic
       (ZCMI), among many others, while the utf8 device (for terminal
       emulators) has only font descriptions for the roman, italic,
       bold, and bold-italic styles (R, I, B, and BI, respectively).

   DESC file format
       The DESC file can contain the following types of line as shown
       below.  Later entries in the file override previous values.

       Empty lines are ignored.

              This line and everything following in the file are
              ignored.  It is allowed for the sake of backwards

       family fam
              The default font family is fam.

       fonts n F1 F2 F3 ... Fn
              Fonts F1, ..., Fn are mounted in the font positions m+1,
              ..., m+n where m is the number of styles.  This command
              may extend over more than one line.  A font name of 0
              causes no font to be mounted on the corresponding font

       hor n  The horizontal resolution is n machine units.

       image_generator string
              Specify the program used to generate PNG images from
              PostScript input; needed for grohtml only.  Under
              GNU/Linux this is usually gs(1) but under other systems
              (notably Cygwin) it might be set to another name.

       paperlength n
              The physical vertical dimension of the output medium in
              machine units.  This isn't used by troff itself, but by
              output devices.  Deprecated.  Use papersize instead.

       papersize string
              Select a paper size.  Valid values for string are the ISO
              paper types A0A7, B0B7, C0C7, D0D7, DL, and the U.S.
              paper types letter, legal, tabloid, ledger, statement,
              executive, com10, and monarch.  Case is not significant
              for string if it holds predefined paper types.
              Alternatively, string can be a file name (e.g.,
              /etc/papersize); if the file can be opened, groff reads
              the first line and tests for the above paper sizes.
              Finally, string can be a custom paper size in the format
              length,width (no spaces before and after the comma).  Both
              length and width must have a unit appended; valid values
              are ‘i’ for inches, ‘c’ for centimeters, ‘p’ for points,
              and ‘P’ for picas.  Example: 12c,235p.  An argument which
              starts with a digit is always treated as a custom paper
              format.  papersize sets both the vertical and horizontal
              dimension of the output medium.

              More than one argument can be specified; groff scans from
              left to right and uses the first valid paper

       paperwidth n
              The physical horizontal dimension of the output medium in
              machine units.  Deprecated.  Use papersize instead.  This
              isn't used by troff itself, but by output devices.

              Make troff tell the driver the source file name being
              processed.  This is achieved by another tcommand:
              F filename.

       postpro program
              Use program as the postprocessor.

       prepro program
              Call program as a preprocessor.

       print program
              Use program as the spooler program for printing.  If
              omitted, the -l and -L options of groff are ignored.

       res n  There are n machine units per inch.

       sizes s1 s2 ... sn 0
              This means that the device has fonts at s1, s2, ..., sn
              scaled points.  The list of sizes must be terminated by a
              0.  Each si can also be a range of sizes mn.  The list
              can extend over more than one line.

       sizescale n
              The scale factor for point sizes.  By default this has a
              value of 1.  One scaled point is equal to one point/n.
              The arguments to the unitwidth and sizes commands are
              given in scaled points.

       styles S1 S2 ... Sm
              The first m font positions are associated with styles S1,
              ..., Sm.

              This means that the postprocessor can handle the t and u
              output commands.

              Indicate that the output device supports the complete
              Unicode repertoire.  Useful only for devices which produce
              character entities instead of glyphs.

              If unicode is present, no charset section is required in
              the font description files since the Unicode handling
              built into groff is used.  However, if there are entries
              in a charset section, they either override the default
              mappings for those particular characters or add new
              mappings (normally for composite characters).

              This is used for -Tutf8, -Thtml, and -Txhtml.

       unitwidth n
              Quantities in the font files are given in machine units
              for fonts whose point size is n scaled points.

              Make the font handling module always return unscaled glyph
              widths.  Needed for the grohtml device.

              This command indicates that troff should encode named
              glyphs inside special commands.

       vert n The vertical resolution is n machine units.

       The res, unitwidth, fonts, and sizes lines are compulsory.  Not
       all commands in the DESC file are used by troff itself; some of
       the keywords (or even additional ones) are used by postprocessors
       to store arbitrary information about the device.

       Here a list of obsolete keywords which are recognized by groff
       but completely ignored: spare1, spare2, biggestfont.

   Font file format
       A font file has two sections; empty lines are ignored in both of

       The first section is a sequence of lines each containing a
       sequence of blank delimited words; the first word in the line is
       a key, and subsequent words give a value for that key.

       ligatures lig1 lig2 ... lign [0]
              Glyphs lig1, lig2, ..., lign are ligatures; possible
              ligatures are ff, fi, fl, ffi, and ffl.  For backwards
              compatibility, the list of ligatures may be terminated
              with a 0.  The list of ligatures may not extend over more
              than one line.

       name F The name of the font is F.

       slant n
              The glyphs of the font have a slant of n degrees.
              (Positive means forward.)

       spacewidth n
              The normal width of a space is n.

              The font is special; this means that when a glyph is
              requested that is not present in the current font, it is
              searched for in any special fonts that are mounted.

       Other commands are ignored by troff but may be used by
       postprocessors to store arbitrary information about the font in
       the font file.

       The first section can contain comments which start with the #
       character and extend to the end of a line.

       The second section contains one or two subsections.  It must
       contain a charset subsection and it may also contain a kernpairs
       subsection.  These subsections can appear in any order.  Each
       subsection starts with a word on a line by itself.

       The word charset starts the charset subsection.  The charset line
       is followed by a sequence of lines.  Each line gives information
       for one glyph.  A line comprises a number of fields separated by
       blanks or tabs.  The format is

              name metrics type code [entity_name] [-- comment]

       name identifies the glyph: if name is a single glyph c then it
       corresponds to the groff input character c; if it is of the form
       \c where c is a single character, then it corresponds to the
       special character \[c]; otherwise it corresponds to the groff
       input character \[name].  If it is exactly two characters xx it
       can be entered as \(xx.  Note that single-letter special
       characters can't be accessed as \c; the only exception is ‘\-’
       which is identical to ‘\[-]’.  The name --- is special and
       indicates that the glyph is unnamed; such glyphs can only be used
       by means of the \N escape sequence in troff.

       The type field gives the glyph type:

       1      means the glyph has a descender, for example, ‘p’;

       2      means the glyph has an ascender, for example, ‘b’;

       3      means the glyph has both an ascender and a descender, for
              example, ‘(’.

       The code field gives the code which the postprocessor uses to
       print the glyph.  The glyph can also be input to groff using this
       code by means of the \N escape sequence.  The code can be any
       integer.  If it starts with a 0 it is interpreted as octal; if it
       starts with 0x or 0X it is interpreted as hexadecimal.  Note,
       however, that the \N escape sequence only accepts a decimal

       The entity_name field defines a string identifying the glyph
       which the postprocessor uses to print that glyph.  This field is
       optional and is used by grops to build sub-encoding arrays for
       PostScript fonts containing more than 256 glyphs.  (It was
       formerly used for grohtml's entity names, but for efficiency
       reasons these data are now compiled directly into grohtml.)

       Anything on the line after the encoding field or ‘--’ are

       The metrics field has the form (on one line; it may be broken
       here for the sake of readability):


       There must not be any spaces between these subfields.  Missing
       subfields are assumed to be 0.  The subfields are all decimal
       integers.  Since there is no associated binary format, these
       values are not required to fit into a variable of type char as
       they are in ditroff.  The width subfields gives the width of the
       glyph.  The height subfield gives the height of the glyph
       (upwards is positive); if a glyph does not extend above the
       baseline, it should be given a zero height, rather than a
       negative height.  The depth subfield gives the depth of the
       glyph, that is, the distance below the baseline to which the
       glyph extends (downwards is positive); if a glyph does not extend
       below the baseline, it should be given a zero depth, rather than
       a negative depth.  The italic-correction subfield gives the
       amount of space that should be added after the glyph when it is
       immediately to be followed by a glyph from a roman font.  The
       left-italic-correction subfield gives the amount of space that
       should be added before the glyph when it is immediately to be
       preceded by a glyph from a roman font.  The subscript-correction
       gives the amount of space that should be added after a glyph
       before adding a subscript.  This should be less than the italic

       A line in the charset section can also have the format

              name "

       This indicates that name is just another name for the glyph
       mentioned in the preceding line.

       The word kernpairs starts the kernpairs section.  This contains a
       sequence of lines of the form:

              c1 c2 n

       This means that when glyph c1 appears next to glyph c2 the space
       between them should be increased by n.  Most entries in kernpairs
       section have a negative value for n.

Files         top

              Device description file for device name.

              Font file for font F of device name.

See also         top

       Groff: The GNU Implementation of troff, by Trent A. Fisher and
       Werner Lemberg, is the primary groff manual.  You can browse it
       interactively with “info groff”.

       “Troff User's Manual” by Joseph F. Ossanna, 1976 (revised by
       Brian W. Kernighan, 1992), AT&T Bell Laboratories Computing
       Science Techical Report No. 54, widely called simply “CSTR #54”,
       documents the language, device and font description file formats,
       and device-independent output format referred to collectively in
       groff documentation as “AT&T troff”.

       “A Typesetter-independent TROFF” by Brian W. Kernighan, 1982,
       AT&T Bell Laboratories Computing Science Techical Report No. 97,
       provides additional insights into the device and font description
       file formats and device-independent output format.

       Section “See Also” of groff(1) lists utilities available for
       preparing font files in a variety of formats for use with groff
       output drivers.

       groff_out(5), troff(1), addftinfo(1), afmtodit(1)

COLOPHON         top

       This page is part of the groff (GNU troff) project.  Information
       about the project can be found at 
       ⟨⟩.  If you have a bug report
       for this manual page, see ⟨⟩.
       This page was obtained from the project's upstream Git repository
       ⟨⟩ on 2021-06-20.  (At
       that time, the date of the most recent commit that was found in
       the repository was 2021-06-17.)  If you discover any rendering
       problems in this HTML version of the page, or you believe there
       is a better or more up-to-date source for the page, or you have
       corrections or improvements to the information in this COLOPHON
       (which is not part of the original manual page), send a mail to

groff 1.23.0.rc1.654-4e1db-dirt1y6 June 2021                 groff_font(5)

Pages that refer to this page: addftinfo(1)afmtodit(1)eqn(1)grodvi(1)groff(1)grohtml(1)grolbp(1)grolj4(1)gropdf(1)grops(1)grotty(1)hpftodit(1)tfmtodit(1)groff_out(5)lj4_font(5)groff(7)groff_char(7)groff_diff(7)