inimf [ first line ]
virmf [ first line ]
Like TeX, Metafont is normally used with a large body of precompiled macros, and font generation in particular requires the support of several macro files. The basic program as compiled is called inimf; it can be used to precompile macros into a .base file. The virmf variant is used to reload the .base files quickly. Typically, virmf has links to it by the names of the various base files. For example, if you link virmf to foo and then execute the program foo, you get the base file foo.base. You can load a different base by saying, e.g., virmf \\ &mybase.
As described in The Metafontbook, the command line (or first input line) should otherwise begin with a file name or a \ controlsequence. The normal usage is to say
to start processing font.mf. The single quotes are the best way of keeping the Unix shell from misinterpreting the semicolons and from removing the \ character, which is needed here to keep Metafont from thinking that you want to produce a font called mode. (Or you can just say mf and give the other stuff on the next line, without quotes.) Other control sequences, such as batchmode (for silent operation) can also appear. The name font will be the ``jobname'', and is used in forming output file names. If Metafont doesn't get a file name in the first line, the jobname is mfput. The default extension, .mf, can be overridden by specifying an extension explicitly.
A log of error messages goes into the file jobname.log. The output files are jobname.tfm and jobname.<number>gf, where <number> depends on the resolution and magnification of the font. The mode in this example is shown generically as <printengine>, a symbolic term for which the name of an actual device or, most commonly, the name localfont (see below) must be substituted. If the mode is not specified or is not valid for your site, Metafont will default to proof mode which produces large character images for use in font design and refinement. Proof mode can be recognized by the suffix .2602gf after the jobname. Examples of proof mode output can be found in Computer Modern Typefaces (Volume E of Computers and Typesetting). The system of magsteps is identical to the system used by TeX, with values generally in the range 0.5, 1.0, 2.0, 3.0, 4.0 and 5.0. A listing of gf numbers for 118-dpi, 240-dpi and 300-dpi fonts is shown below.
Magnification can also be specified not as a magstep but as an
arbitrary value, such as 1.315, to create special character sizes.
Before font production can begin, it is necessary to set up the
appropriate base files. The minimum set of components for font
production for a given print-engine is the
plain.mf macro file
and the local
mode_def file. The macros in
plain.mf can be
studied in an appendix to the
Metafontbook; they were developed by Donald E. Knuth, and this file should never be
altered except when it is officially upgraded.
Each
mode_def specification helps adapt fonts to a particular print-engine.
There is a regular discussion of
mode_defs in
TUGboat, the journal of the
TeX
Users Group.
The local ones in use on this computer should be in
@MFINPUTDIR@/@LOCALMODES@.mf. With only
plain.mf and the
modes file loaded it is possible to
create fonts of simple characters, such as those used for the
Metafont
logo, and those used for the LaTeX line and circle fonts,
but the production of Computer Modern fonts would be speeded by
making a
cmmf.base file (which includes the macros in
cmbase.mf as
well as those in
plain.mf).
Several environment variables can be used to set up directory
paths to search when Metafont opens a file for input.
For example, the
csh command
setenv MFINPUTS .:~me/mylib:@MFINPUTDIR@or the
MFINPUTS=.:~me/mylib:@MFINPUTDIR@ export MFINPUTSwould cause all invocations of Metafont and its derivatives to look for \ input files first in the current directory, then in a hypothetical user's mylib, and finally in the system library. Normally, the user will place the command sequence which sets up the MFINPUTS environment variable in his or her . login or . profile file.
The e response to Metafont 's error-recovery mode invokes the system default editor at the erroneous line of the source file. There is an environment variable, MFEDIT, that overrides the default editor. It should contain a string with "%s" indicating where the filename goes and "%d" indicating where the decimal linenumber (if any) goes. For example, an MFEDIT string for the vi editor can be set with the csh command
setenv MFEDIT "/usr/ucb/vi +%d %s"The ENVIRONMENT section below lists the relevant environment variables, and their defaults.
A convenient file in the library is null.mf, containing nothing. When mf can't find the file it thinks you want to input, it keeps asking you for another file name; responding `null' gets you out of the loop if you don't want to input anything.
If the environment variable TEXMFOUTPUT is set, Metafont attempts to put its output files in it, if they cannot be put in the current directory. Again, see tex(1).