Go to the first, previous, next, last section, table of contents.


mf invocation

Metafont (usually invoked as mf) reads character definitions specified in the Metafont programming language, and outputs the corresponding font. This section merely describes the options available in the Web2c implementation. For a complete description of the Metafont language, see The Metafontbook (see section References).

Metafont processes its command line and determines its memory dump (base) file in a way exactly analogous to MetaPost and TeX (see section tex invocation, and see section Memory dumps). Synopses:

mf [option]... [mfname[.mf]] [mf-commands]
mf [option]... \first-line
mf [option]... &base args

Most commonly, a Metafont invocation looks like this:

mf '\mode:=mode; mag:=magnification; input mfname'

(The single quotes avoid unwanted interpretation by the shell.)

Metafont searches the usual places for the main input file mfname (see section `Supported file formats' in Kpathsea), extending mfname with `.mf' if necessary. To see all the relevant paths, set the environment variable KPATHSEA_DEBUG to `-1' before running the program. By default, Metafont runs an external program named `MakeTeXMF' to create any nonexistent Metafont source files you input. You can disable this at configure-time or runtime (see section `MakeTeX configuration' in Kpathsea). This is mostly for the sake of the DC fonts, which can be generated at any size.

Metafont writes the main GF output to the file `basemfname.nnngf', where nnn is the font resolution in pixels per inch, and basemfname is the basename of mfname, or `mfput' if no input file was specified. A GF file contains bitmaps of the actual character shapes. Usually GF files are converted immediately to PK files with GFtoPK (see section GFtoPK: Generic to packed font conversion), since PK files contain equivalent information, but are more compact. (Metafont output in GF format rather than PK for only historical reasons.)

Metafont also usually writes a metric file in TFM format to `basemfname.tfm'. A TFM file contains character dimensions, kerns, and ligatures, and spacing parameters. TeX reads only this .tfm file, not the GF file.

The mode in the example command above is a name referring to a device definition (see section Modes: Device definitions for Metafont); for example, localfont or ljfour. These device definitions must generally be precompiled into the base file. If you leave this out, the default is proof mode, as stated in The Metafontbook, in which Metafont outputs at a resolution of 2602dpi; this is usually not what you want. The remedy is simply to assign a different mode---localfont, for example.

The magnification assignment in the example command above is a magnification factor; for example, if the device is 600dpi and you specify mag:=2, Metafont will produce output at 1200dpi. Very often, the magnification is an expression such as magstep(.5), corresponding to a TeX "magstep", which are factors of

After running Metafont, you can use the font in a TeX document as usual. For example:

\font\myfont = newfont
\myfont Now I am typesetting in my new font (minimum hamburgers).

The program accepts the following options, as well as the standard `-help' and `-version' (see section Common options):

`-kpathsea-debug=number'
`-ini'
`-base=basename'
`-progname=string'
These options are common to TeX, Metafont, and MetaPost. See section Common options.
`-maketex=filetype'
`-no-maketex=filetype'
Turn on or off the `MakeTeX' script associated with filetype. The only value that makes sense for filetype is `mf'.


Go to the first, previous, next, last section, table of contents.