# phpman > man > GROFF_FONT(5)

[GROFF_FONT(5)](https://www.chedong.com/phpMan.php/man/GROFFFONT/5/markdown)                            File Formats Manual                           [GROFF_FONT(5)](https://www.chedong.com/phpMan.php/man/GROFFFONT/5/markdown)



## NAME
       groff_font - format of groff device and font description files

## DESCRIPTION
       The  groff  font format is roughly a superset of the ditroff font format.  The font files for
       device _name_ are stored in a directory _dev_name.  There are two types of  file:  a  device  de‐
       scription  file called _DESC_ and for each font _F_, a font file called F.  These are text files;
       unlike the ditroff font format, there is no associated binary format.

### 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.

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

       **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  num‐
              ber  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 position.

       **hor** _n_  The horizontal resolution is _n_ machine units.

       **image**___**generator** _string_
              Needed for **grohtml** only.  It specifies the program to generate PNG images  from  Post‐
              Script  input.   Under  GNU/Linux  this is usually _gs_ 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 A0–A7, B0–B7,
              C0–C7, D0–D7, DL, and the US paper types letter, legal,  tabloid,  ledger,  statement,
              executive,  com10, and monarch.  Case is not significant for _string_ if it holds prede‐
              fined 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 spa‐
              ces  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  pi‐
              cas.  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 specification.

       **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.

       **pass**___**filenames**
              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 _m_–_n_.  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_.

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

### unicode
              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.

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

       **use**___**charnames**___**in**___**special**
              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 postpro‐
       cessors 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 them.

       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_.

### special
              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  in‐
       formation 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 spe‐
       cial 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 integer.

       The _entity_name_ field gives an ASCII string identifying the  glyph  which  the  postprocessor
       uses  to  print  that  glyph.  This field is optional and is currently used by **grops** to build
       sub-encoding arrays for PS fonts containing more than 256 glyphs.  (It has also been used for
       **grohtml**'s  entity  names  but  for efficiency reasons this data is now compiled directly into
       **grohtml**.)

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

       The _metrics_ field has the form (in one line; it is broken here for the sake of readability):

              _width_[**,**_height_[**,**_depth_[**,**_italic-correction_
              [**,**_left-italic-correction_[**,**_subscript-correction_]]]]]

       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 be‐
       fore  the glyph when it is immediately to be preceded by a glyph from a roman font.  The _sub__‐
       _script-correction_ gives the amount of space that should be added after a glyph before  adding
       a subscript.  This should be less than the italic correction.

       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  in‐
       creased by _n_.  Most entries in kernpairs section have a negative value for _n_.

## FILES
       _/usr/share/groff/1.22.4/font/dev_name_/DESC_
              Device description file for device _name_.

       _/usr/share/groff/1.22.4/font/dev_name_/_F
              Font file for font _F_ of device _name_.

## SEE ALSO
       **groff**___**[out**(5)](https://www.chedong.com/phpMan.php/man/out/5/markdown), [**troff**(1)](https://www.chedong.com/phpMan.php/man/troff/1/markdown), [**addftinfo**(1)](https://www.chedong.com/phpMan.php/man/addftinfo/1/markdown), [**afmtodit**(1)](https://www.chedong.com/phpMan.php/man/afmtodit/1/markdown)

       A man page [_name_(_n_)](https://www.chedong.com/phpMan.php/man/name/n/markdown) of section _n_ can be viewed either with
              $ **man** _n_ _name_
       for text mode or
              $ **groffer** _n_ _name_
       for graphical mode (default is PDF mode).



groff 1.22.4                                23 March 2022                              [GROFF_FONT(5)](https://www.chedong.com/phpMan.php/man/GROFFFONT/5/markdown)
