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