1MF(1)                       General Commands Manual                      MF(1)
2
3
4

NAME

6       mf, inimf, mf-nowin - Metafont, a language for font and logo design
7

SYNOPSIS

9       mf [options] [commands]
10

DESCRIPTION

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

ONLINE GRAPHICS OUTPUT

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

OPTIONS

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       -cnf-line string
128              Parse string as a texmf.cnf configuration line.  See the  Kpath‐
129              sea manual.
130
131       -file-line-error
132              Print  error messages in the form file:line:error which is simi‐
133              lar to the way many compilers format them.
134
135       -no-file-line-error
136              Disable printing error messages in the file:line:error style.
137
138       -file-line-error-style
139              This is the old name of the -file-line-error option.
140
141       -halt-on-error
142              Exit with an error code when an error is encountered during pro‐
143              cessing.
144
145       -help  Print help message and exit.
146
147       -ini   Be inimf, for dumping bases; this is implicitly true if the pro‐
148              gram is called as inimf.
149
150       -interaction mode
151              Sets the interaction mode.  The mode can be  one  of  batchmode,
152              nonstopmode,  scrollmode,  and  errorstopmode.   The  meaning of
153              these modes is the same as that of the corresponding commands.
154
155       -jobname name
156              Use name for the job name, instead of deriving it from the  name
157              of the input file.
158
159       -kpathsea-debug bitmask
160              Sets  path  searching  debugging flags according to the bitmask.
161              See the Kpathsea manual for details.
162
163       -maketex fmt
164              Enable mktexfmt, where fmt must be mf.
165
166       -no-maketex fmt
167              Disable mktexfmt, where fmt must be mf.
168
169       -output-directory directory
170              Write output files in directory instead of  the  current  direc‐
171              tory.   Look  up  input  files in directory first, the along the
172              normal search path.
173
174       -parse-first-line
175              If the first line of the main input file begins with %& parse it
176              to look for a dump name or a -translate-file option.
177
178       -no-parse-first-line
179              Disable parsing of the first line of the main input file.
180
181       -progname name
182              Pretend  to  be program name.  This affects both the format used
183              and the search paths.
184
185       -recorder
186              Enable the filename recorder.  This leaves a trace of the  files
187              opened for input and output in a file with extension .fls.
188
189       -translate-file tcxname
190              Use the tcxname translation table.
191
192       -version
193              Print version information and exit.
194

ENVIRONMENT

196       See  the  Kpathsearch  library documentation (the `Path specifications'
197       node) for the details of how the environment  variables  are  use  when
198       searching.   The  kpsewhich  utility can be used to query the values of
199       the variables.
200
201       If the environment variable TEXMFOUTPUT is set,  Metafont  attempts  to
202       put its output files in it, if they cannot be put in the current direc‐
203       tory.  Again, see tex(1).
204
205       MFINPUTS
206              Search path for input files.
207
208       MFEDIT Command template for switching to editor.
209
210       MFTERM Determines the online graphics display.  If MFTERM is  not  set,
211              and  DISPLAY  is set, the Metafont window support for X is used.
212              (DISPLAY must be set to  a  valid  X  server  specification,  as
213              usual.)   If  neither MFTERM nor DISPLAY is set, TERM is used to
214              guess the window support to use.
215

FONT UTILITIES

217       A number of utility programs are available.  The following is a partial
218       list  of  available  utilities  and  their purpose.  Consult your local
219       Metafont guru for details.
220
221       gftopk   Takes a gf file and produces a more  tightly  packed  pk  font
222                file.
223
224       gftodvi  Produces proof sheets for fonts.
225
226       gftype   Displays the contents of a gf file in mnemonics and/or images.
227
228       pktype   Mnemonically displays the contents of a pk file.
229
230       mft      Formats a source file as shown in Computer Modern Typefaces.
231

FILES

233       mf.pool
234              Encoded text of Metafont's messages.
235
236       *.base Predigested Metafont base files.
237
238       $TEXMFMAIN/metafont/base/plain.mf
239              The standard base.
240
241       $TEXMFMAIN/metafont/misc/modes.mf
242              The file of mode_defs for your site's various printers
243

NOTES

245       This  manual page is not meant to be exhaustive.  The complete documen‐
246       tation for this version of Metafont can be found  in  the  info  manual
247       Web2C: A TeX implementation.
248

BUGS

250       On  January  4,  1986  the ``final'' bug in Metafont was discovered and
251       removed.  If an error still lurks in the code, Donald E. Knuth promises
252       to  pay a finder's fee which doubles every year to the first person who
253       finds it.  Happy hunting.
254

SUGGESTED READING

256       Donald E. Knuth, The Metafontbook (Volume C of Computers  and  Typeset‐
257       ting), Addison-Wesley, 1986, ISBN 0-201-13445-4.
258       Donald E. Knuth, Metafont: The Program (Volume D of Computers and Type‐
259       setting), Addison-Wesley, 1986, ISBN 0-201-13438-1.
260       Donald E. Knuth, Computer Modern Typefaces (Volume E of  Computers  and
261       Typesetting), Addison-Wesley, 1986, ISBN 0-201-13446-2.
262       TUGboat (the journal of the TeX Users Group).
263

COMMENTS

265       Warning:  ``Type design can be hazardous to your other interests.  Once
266       you get hooked, you will develop intense  feelings  about  letterforms;
267       the  medium  will  intrude on the messages that you read.  And you will
268       perpetually be thinking of improvements  to  the  fonts  that  you  see
269       everywhere, especially those of your own design.''
270

SEE ALSO

272       gftopk(1),   gftodvi(1),   gftype(1),   mft(1),   mpost(1),  pltotf(1),
273       tftopl(1).
274

AUTHORS

276       Metafont was designed by Donald E. Knuth, who implemented it using  his
277       Web  system  for  Pascal programs.  It was originally ported to Unix by
278       Paul Richards at the University of Illinois at Urbana-Champaign.   This
279       page was mostly written by Pierre MacKay.
280
281
282
283Web2C 2020                       6 August 2019                           MF(1)
Impressum