mode_defconvention described on page 94 of The Metafontbook (see TeX-related books). Your distribution should provide a file, conventionally called local.mf, containing all the
mode_defs you will be using. In the unlikely event that local.mf doesn’t already exist, Karl Berry’s collection of modes (modes.mf) is a good starting point (it can be used as a ‘local.mf’ without modification in a modern implementation of Metafont). Settings for new output devices are added to modes.mf as they become available. Now create a
plainbase file using mf (in “initialisation” mode),
This will create a base file named plain.base (or something similar; for example, it will be PLAIN.BAS on MSDOS systems). Move the file to the directory containing the base files on your system, and run texhash as necessary. Now you need to make sure Metafont loads this new base when it starts up. If Metafont loads the% mf -ini This is METAFONT... **plain # you type plain (output) *input local # you type this (output) *dump # you type this Beginning to dump on file plain... (output)
plainbase by default on your system, then you’re ready to go. Under Unix (using the default TeX Live (and earlier) distributions this does indeed happen, but we could for instance define a command plainmf which executes ‘
mf -base=plain’ (or, in more traditional style ‘
mf &plain’) which loads the
plainbase file. The usual way to create a font with Metafont (with an appropriate base file loaded) is to start Metafont’s input with the line
in response to the ‘\mode=<mode name>; mag=<magnification>; input <font file name>
**’ prompt or on the Metafont command line. (If
<mode name>is unknown or omitted, the mode defaults to ‘proof’ mode and Metafont will produce an output file called <font file name>.2602gf) The
<magnification>is a floating point number or a ‘magstep’ (magsteps define sizes by stating how many times you need to multiply a base size by
1.2, so for a base size of
mag=<magnification>is omitted, then the default is
magstep 0). For example, to generate cmr10 at
12ptfor an Epson, printer you might type
Note that under Unix themf \mode=epson; mag=magstep 1; input cmr10
;characters must usually be quoted or escaped, so this would typically look something like
If you need a special mode that isn’t in the base, you can put its commands in a file (e.g., ln03.mf) and invoke it on the fly with themf '\mode=epson; mag=magstep 1; input cmr10'
smodecommand. For example, to create cmr10.300gf for an LN03 printer, using the file
(note the absence of the% This is ln03.mf as of 1990/02/27 % mode_def courtesy of John Sauter proofing:=0; fontmaking:=1; tracingtitles:=0; pixels_per_inch:=300; blacker:=0.65; fillin:=-0.1; o_correction:=.5;
enddefcommands), you would type
This technique isn’t one you should regularly use, but it may prove useful if you acquire a new printer and want to experiment with parameters, or for some other reason are regularly editing the parameters you’re using. Once you’ve settled on an appropriate set of parameters, you should use them to rebuild the base file that you use. Other sources of help are discussed in our list of Metafont and MetaPost Tutorials.mf \smode="ln03"; input cmr10
This answer last edited: 2011-09-04
Go to previous question, or next question
Go to FAQ home.
URL for this question: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=useMF
Comments, suggestions, or error reports? - see “how to improve the FAQ”.
This is FAQ version 3.28, released on 2014-06-10.