1MF(1) General Commands Manual MF(1)
2
3
4
6 mf, mf-nowin, inimf, virmf - Metafont, a language for font and logo
7 design
8
10 mf [options] [commands]
11
13 Metafont reads the program in the specified files and outputs font
14 rasters (in gf format) and font metrics (in tfm format). The Metafont
15 language is described in The Metafontbook.
16
17 Like TeX, Metafont is normally used with a large body of precompiled
18 macros, and font generation in particular requires the support of sev‐
19 eral macro files. This version of Metafont looks at its command line
20 to see what name it was called under. Both inimf and virmf are sym‐
21 links to the mf executable. When called as inimf (or when the -ini
22 option is given) it can be used to precompile macros into a .base file.
23 When called as virmf it will use the plain base. When called under any
24 other name, Metafont will use that name as the name of the base to use.
25 For example, when called as mf the mf base is used, which is identical
26 to the plain base. Other bases than plain are rarely used.
27
28 The commands given on the command line to the Metafont program are
29 passed to it as the first input line. (But it is often easier to type
30 extended arguments as the first input line, since UNIX shells tend to
31 gobble up or misinterpret Metafont's favorite symbols, like semicolons,
32 unless you quote them.) As described in The Metafontbook, that first
33 line should begin with a filename, a \controlsequence, or a &basename.
34
35 The normal usage is to say
36
37 mf '\mode=<printengine>; [mag=magstep(n);]' input font
38
39 to start processing font.mf. The single quotes are the best way of
40 keeping the Unix shell from misinterpreting the semicolons and from
41 removing the \ character, which is needed here to keep Metafont from
42 thinking that you want to produce a font called mode. (Or you can just
43 say mf and give the other stuff on the next line, without quotes.)
44 Other control sequences, such as batchmode (for silent operation) can
45 also appear. The name font will be the ``jobname'', and is used in
46 forming output file names. If Metafont doesn't get a file name in the
47 first line, the jobname is mfput. The default extension, .mf, can be
48 overridden by specifying an extension explicitly.
49
50 A log of error messages goes into the file jobname.log. The output
51 files are jobname.tfm and jobname.<number>gf, where <number> depends on
52 the resolution and magnification of the font. The mode in this example
53 is shown generically as <printengine>, a symbolic term for which the
54 name of an actual device or, most commonly, the name localfont (see
55 below) must be substituted. If the mode is not specified or is not
56 valid for your site, Metafont will default to proof mode which produces
57 large character images for use in font design and refinement. Proof
58 mode can be recognized by the suffix .2602gf after the jobname. Exam‐
59 ples of proof mode output can be found in Computer Modern Typefaces
60 (Volume E of Computers and Typesetting). The system of magsteps is
61 identical to the system used by TeX, with values generally in the range
62 0.5, 1.0, 2.0, 3.0, 4.0 and 5.0. A listing of gf numbers for 118-dpi,
63 240-dpi and 300-dpi fonts is shown below.
64
65 MAGSTEP 118 dpi 240 dpi 300 dpi
66
67 mag=magstep(0) 118 240 300
68 mag=magstep(0.5) 129 263 329
69 mag=magstep(1) 142 288 360
70 mag=magstep(2) 170 346 432
71 mag=magstep(3) 204 415 518
72 mag=magstep(4) 245 498 622
73 mag=magstep(5) 294 597 746
74
75 Magnification can also be specified not as a magstep but as an arbi‐
76 trary value, such as 1.315, to create special character sizes.
77
78 Before font production can begin, it is necessary to set up the appro‐
79 priate base files. The minimum set of components for font production
80 for a given print-engine is the plain.mf macro file and the local
81 mode_def file. The macros in plain.mf can be studied in an appendix to
82 the Metafontbook; they were developed by Donald E. Knuth, and this file
83 should never be altered except when it is officially upgraded. Each
84 mode_def specification helps adapt fonts to a particular print-engine.
85 There is a regular discussion of mode_defs in TUGboat, the journal of
86 the TeX Users Group. The local ones in use on this computer should be
87 in modes.mf.
88
89 The e response to Metafont's error-recovery mode invokes the system
90 default editor at the erroneous line of the source file. There is an
91 environment variable, MFEDIT, that overrides the default editor. It
92 should contain a string with "%s" indicating where the filename goes
93 and "%d" indicating where the decimal linenumber (if any) goes. For
94 example, an MFEDIT string for the vi editor can be set with the csh
95 command
96 setenv MFEDIT "vi +%d %s"
97
98 A convenient file in the library is null.mf, containing nothing. When
99 mf can't find the file it thinks you want to input, it keeps asking you
100 for another file name; responding `null' gets you out of the loop if
101 you don't want to input anything.
102
104 Metafont can use most modern displays, so you can see its output with‐
105 out printing. Chapter 23 of The Metafontbook describes what you can
106 do. This implementation of Metafont uses environment variables to
107 determine which display device you want to use. First it looks for a
108 variable MFTERM, and then for TERM. If it can't find either, you get
109 no online output. Otherwise, the value of the variable determines the
110 device to use: hp2627, sun (for old SunView), tek, uniterm (for an
111 Atari ST Tek 4014 emulator), xterm (for either X10 or X11). Some of
112 these devices may not be supported in all Metafont executables; the
113 choice is made at compilation time.
114
115 On some systems, there are two Metafont binaries, mf and mf-nowin. On
116 those systems the mf binary supports graphics, while the mf-nowin
117 binary does not. The mf-nowin binary is used by scripts like mktexpk
118 where graphics support is a nuisance rather than something helpful.
119
121 This version of Metafont understands the following command line
122 options.
123
124 -base base
125 Use base as the name of the base to be used, instead of the name
126 by which Metafont was called or a %& line.
127
128 -file-line-error
129 Print error messages in the form file:line:error which is simi‐
130 lar to the way many compilers format them.
131
132 -no-file-line-error
133 Disable printing error messages in the file:line:error style.
134
135 -file-line-error-style
136 This is the old name of the -file-line-error option.
137
138 -halt-on-error
139 Exit with an error code when an error is encountered during pro‐
140 cessing.
141
142 -help Print help message and exit.
143
144 -ini Be inimf, for dumping bases; this is implicitly true if the pro‐
145 gram is called as inimf.
146
147 -interaction mode
148 Sets the interaction mode. The mode can be one of batchmode,
149 nonstopmode, scrollmode, and errorstopmode. The meaning of
150 these modes is the same as that of the corresponding commands.
151
152 -jobname name
153 Use name for the job name, instead of deriving it from the name
154 of the input file.
155
156 -kpathsea-debug bitmask
157 Sets path searching debugging flags according to the bitmask.
158 See the Kpathsea manual for details.
159
160 -maketex fmt
161 Enable mktexfmt, where fmt must be mf.
162
163 -no-maketex fmt
164 Disable mktexfmt, where fmt must be mf.
165
166 -output-directory directory
167 Write output files in directory instead of the current direc‐
168 tory. Look up input files in directory first, the along the
169 normal search path.
170
171 -parse-first-line
172 If the first line of the main input file begins with %& parse it
173 to look for a dump name or a -translate-file option.
174
175 -no-parse-first-line
176 Disable parsing of the first line of the main input file.
177
178 -progname name
179 Pretend to be program name. This affects both the format used
180 and the search paths.
181
182 -recorder
183 Enable the filename recorder. This leaves a trace of the files
184 opened for input and output in a file with extension .fls.
185
186 -translate-file tcxname
187 Use the tcxname translation table.
188
189 -version
190 Print version information and exit.
191
193 See the Kpathsearch library documentation (the `Path specifications'
194 node) for the details of how the environment variables are use when
195 searching. The kpsewhich utility can be used to query the values of
196 the variables.
197
198 If the environment variable TEXMFOUTPUT is set, Metafont attempts to
199 put its output files in it, if they cannot be put in the current direc‐
200 tory. Again, see tex(1).
201
202 MFINPUTS
203 Search path for input and openin files.
204
205 MFEDIT Command template for switching to editor.
206
207 MFTERM Determines the online graphics display. If MFTERM is not set,
208 and DISPLAY is set, the Metafont window support for X is used.
209 (DISPLAY must be set to a valid X server specification, as
210 usual.) If neither MFTERM nor DISPLAY is set, TERM is used to
211 guess the window support to use.
212
214 A number of utility programs are available. The following is a partial
215 list of available utilities and their purpose. Consult your local
216 Metafont guru for details.
217
218 gftopk Takes a gf file and produces a more tightly packed pk font
219 file.
220
221 gftodvi Produces proof sheets for fonts.
222
223 gftype Displays the contents of a gf file in mnemonics and/or images.
224
225 pktype Mnemonically displays the contents of a pk file.
226
227 mft Formats a source file as shown in Computer Modern Typefaces.
228
230 mf.pool
231 Encoded text of Metafont's messages.
232
233 *.base Predigested Metafont base files.
234
235 $TEXMFMAIN/metafont/base/plain.mf
236 The standard base.
237
238 $TEXMFMAIN/metafont/misc/modes.mf
239 The file of mode_defs for your site's various printers
240
242 This manual page is not meant to be exhaustive. The complete documen‐
243 tation for this version of Metafont can be found in the info manual
244 Web2C: A TeX implementation.
245
247 On January 4, 1986 the ``final'' bug in Metafont was discovered and
248 removed. If an error still lurks in the code, Donald E. Knuth promises
249 to pay a finder's fee which doubles every year to the first person who
250 finds it. Happy hunting.
251
253 Donald E. Knuth, The Metafontbook (Volume C of Computers and Typeset‐
254 ting), Addison-Wesley, 1986, ISBN 0-201-13445-4.
255 Donald E. Knuth, Metafont: The Program (Volume D of Computers and Type‐
256 setting), Addison-Wesley, 1986, ISBN 0-201-13438-1.
257 Donald E. Knuth, Computer Modern Typefaces (Volume E of Computers and
258 Typesetting), Addison-Wesley, 1986, ISBN 0-201-13446-2.
259 TUGboat (the journal of the TeX Users Group).
260
262 Warning: ``Type design can be hazardous to your other interests. Once
263 you get hooked, you will develop intense feelings about letterforms;
264 the medium will intrude on the messages that you read. And you will
265 perpetually be thinking of improvements to the fonts that you see
266 everywhere, especially those of your own design.''
267
269 gftopk(1), gftodvi(1), gftype(1), mft(1), pltotf(1), tftopl(1).
270
272 Metafont was designed by Donald E. Knuth, who implemented it using his
273 Web system for Pascal programs. It was originally ported to Unix by
274 Paul Richards at the University of Illinois at Urbana-Champaign. This
275 page was mostly written by Pierre MacKay.
276
277
278
279Web2C 2012 1 March 2011 MF(1)