beta-0.89.2
[luatex.git] / source / texk / web2c / man / mf.man
blob8c092e17ce6371149be6b05c987c5d7b94726f67
1 .TH MF 1 "16 June 2015" "Web2C @VERSION@"
2 .\"=====================================================================
3 .if n .ds MF Metafont
4 .if t .ds MF Metafont
5 .if t .ds TX \fRT\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X\fP
6 .if n .ds TX TeX
7 .ie t .ds OX \fIT\v'+0.25m'E\v'-0.25m'X\fP
8 .el .ds OX TeX
9 .\" BX definition must follow TX so BX can use TX
10 .if t .ds BX \fRB\s-2IB\s0\fP\*(TX
11 .if n .ds BX BibTeX
12 .\" LX definition must follow TX so LX can use TX
13 .if t .ds LX \fRL\\h'-0.36m'\\v'-0.15v'\s-2A\s0\\h'-0.15m'\\v'0.15v'\fP\*(TX
14 .if n .ds LX LaTeX
15 .if n .ds WB Web
16 .if t .ds WB W\s-2EB\s0
17 .\"=====================================================================
18 .SH NAME
19 mf, inimf, mf-nowin \- Metafont, a language for font and logo design
20 .SH SYNOPSIS
21 .B mf
22 .RI [ options ]
23 .RI [ commands ]
24 .\"=====================================================================
25 .SH DESCRIPTION
26 \*(MF reads the program in the specified files
27 and outputs font rasters (in
28 .I gf
29 format) and font metrics (in
30 .I tfm
31 format).  The \*(MF
32 language is described in
33 .IR "The \*(MF\^book" .
34 .PP
35 Like
36 \*(TX, \*(MF
37 is normally used with a large body of precompiled macros, and font generation
38 in particular requires the support of several macro files.  This
39 version of \*(MF looks at its command line to see what name it was
40 called under.  Both
41 .B inimf
42 and
43 .B virmf
44 are symlinks to the
45 .B mf
46 executable.  When called as
47 .BR inimf
48 (or when the
49 .B -ini
50 option is given) it can be used to precompile macros into a
51 .I .base
52 file.  When called as
53 .B virmf
54 it will use the
55 .I plain
56 base.  When called under any other name, \*(MF will use that name as
57 the name of the base to use.   For example, when called as
58 .B mf
59 the
60 .I mf
61 base is used, which is identical to the
62 .I plain
63 base.  Other bases than
64 .I plain
65 are rarely used.
66 .PP
67 The
68 .I commands
69 given on the command line to the \*(MF program are passed to it as the
70 first input line.  (But it is often easier to type extended arguments
71 as the first input line, since UNIX shells tend to gobble up or
72 misinterpret \*(MF's favorite symbols, like semicolons, unless you
73 quote them.)  As described in
74 .IR "The \*(MF\^book" ,
75 that first line should begin with a filename, a
76 .RI \e controlsequence ,
77 or a
78 .IR &basename .
79 .PP
80 The normal usage is to say
81 .IP
82 \fBmf\ \fP '\\\|mode=<printengine>\^;\^ [\^mag=magstep(\fI\^n\fP\^)\^;\^]' input\ \^\fI font \fP
83 .PP
84 to start processing
85 .IR font.mf .
86 The single quotes are the best way of keeping the Unix
87 shell from misinterpreting the semicolons and
88 from removing the \\ character, which is needed here to
89 keep \*(MF from thinking that you want to produce a font called
90 .IR mode .
91 (Or you can just say
92 .I mf
93 and give the other stuff on the next line, without quotes.) Other
94 control sequences, such as
95 .I batchmode
96 (for silent operation) can also appear.
97 The name
98 .I font
99 will be the ``jobname'', and is used in forming
100 output file names.
101 If \*(MF doesn't get a file name in the first line,
102 the jobname is
103 .IR mfput .
104 The default extension,
105 .IR .mf ,
106 can be overridden by specifying an extension explicitly.
108 A log of error messages goes into the file \fIjobname\fP\fB\^.\^\fP\fIlog\fP.
109 The output files are \fIjobname\fP\fB\^.\^\fP\fItfm\fP and
110 \fIjobname\fP\fB\^.\^\fP\fI<\fP\^number\^\fI>gf\fP, where <number> depends on
111 the resolution and magnification of the font.  The
112 .I mode
113 in this
114 example is shown generically as <printengine>, a symbolic term for which
115 the name of an actual device or, most commonly, the name
116 .I localfont
117 (see below) must
118 be substituted. If the mode is not specified or is not valid for your
119 site, \*(MF will default to
120 .I proof
121 mode which produces
122 large character images for use in font design and refinement.  Proof
123 mode can be recognized by the suffix
124 .I .2602gf
125 after the jobname.  Examples of proof mode output can be found
127 .I "Computer Modern Typefaces"
128 (Volume E of
129 .IR "Computers and Typesetting" ).
130 The system of
131 .I magsteps
132 is identical to the system used by
133 \*(TX,
134 with values generally in the range 0.5, 1.0, 2.0, 3.0, 4.0 and 5.0.
135 A listing of
136 .I gf
137 numbers for 118-dpi, 240-dpi and 300-dpi fonts
138 is shown below.
140 tab(:);
141 c c c c
142 l l l l.
143 MAGSTEP:118 dpi:240 dpi:300 dpi
144 mag=magstep(0):118:240:300
145 mag=magstep(0.5):129:263:329
146 mag=magstep(1):142:288:360
147 mag=magstep(2):170:346:432
148 mag=magstep(3):204:415:518
149 mag=magstep(4):245:498:622
150 mag=magstep(5):294:597:746
153 Magnification can also be specified not as a magstep but as an
154 arbitrary value, such as 1.315, to create special character sizes.
156 Before font production can begin, it is necessary to set up the
157 appropriate base files.  The minimum set of components for font
158 production for a given print-engine is the
159 .I plain.mf
160 macro file
161 and the local
162 .I mode_def
163 file.  The macros in
164 .I plain.mf
165 can be
166 studied in an appendix to the
167 .IR "\*(MF\^book" ;
168 they were developed by Donald E. Knuth, and this file should never be
169 altered except when it is officially upgraded.
170 Each
171 .I mode_def
172 specification helps adapt fonts to a particular print-engine.
173 There is a regular discussion of
174 .IR mode_def s
176 .IR TUGboat ,
177 the journal of the
178 \*(TX
179 Users Group.
180 The local ones in use on this computer should be in
181 .IR modes.mf .
184 .I e
185 response to \*(MF\|'s error-recovery mode invokes the
186 system default
187 editor at the erroneous line of the source file.
188 There is an environment variable, MFEDIT,
189 that overrides the default editor.
190 It should contain a string with "%s" indicating where the
191 filename goes and "%d" indicating where the decimal linenumber (if any) goes.
192 For example, an MFEDIT string for the
193 .B vi
194 editor can be set with the
195 .B csh
196 command
198 \fIsetenv MFEDIT "vi +%d %s"\fP
201 A convenient file in the library is
202 .IR null.mf ,
203 containing nothing.
204 When
205 .B mf
206 can't find the file it thinks you want to input, it keeps
207 asking you for another file name; responding `null' gets you out
208 of the loop if you don't want to input anything.
209 .\"=====================================================================
210 .SH "ONLINE GRAPHICS OUTPUT"
211 \*(MF can use most modern displays, so you can see its output
212 without printing.  Chapter 23 of
213 .I "The \*(MF\^book"
214 describes what you can do.  This implementation of \*(MF uses
215 environment variables to determine which display device you want to use.
216 First it looks for a variable MFTERM, and then for TERM.
217 If it can't find either, you get no online output.  Otherwise, the value
218 of the variable determines the device to use:
219 .BR hp2627 ,
220 .B sun
221 (for old SunView),
222 .BR tek ,
223 .B uniterm
224 (for an Atari ST Tek 4014 emulator),
225 .B xterm
226 (for either X10 or X11).
227 Some of these devices may not be supported in all \*(MF
228 executables; the choice is made at compilation time.
230 On some systems, there are two \*(MF binaries,
231 .B mf
233 .BR mf-nowin .
234 On those systems the
235 .B mf
236 binary supports graphics, while the
237 .B mf-nowin
238 binary does not.  The
239 .B mf-nowin
240 binary is used by scripts like
241 .B mktexpk
242 where graphics support is a nuisance rather than something helpful.
243 .\"=====================================================================
244 .SH OPTIONS
245 This version of \*(MF understands the following command line options.
247 .BI -base \ base
249 .I base
250 as the name of the base to be used, instead of the name by which
251 \*(MF was called or a
252 .I %&
253 line.
255 .B -file-line-error
256 Print error messages in the form
257 .I file:line:error
258 which is similar to the way many compilers format them.
260 .B -no-file-line-error
261 Disable printing error messages in the
262 .I file:line:error
263 style.
265 .B -file-line-error-style
266 This is the old name of the
267 .B -file-line-error
268 option.
270 .B -halt-on-error
271 Exit with an error code when an error is encountered during processing.
273 .B -help
274 Print help message and exit.
276 .B -ini
278 .BR inimf ,
279 for dumping bases; this is implicitly true if the program is called
281 .BR inimf .
283 .BI -interaction \ mode
284 Sets the interaction mode.  The mode can be one of
285 .IR batchmode ,
286 .IR nonstopmode ,
287 .IR scrollmode ,
289 .IR errorstopmode .
290 The meaning of these modes is the same as that of the corresponding
291 commands.
293 .BI -jobname \ name
295 .I name
296 for the job name, instead of deriving it from the name of the input file.
298 .BI -kpathsea-debug \ bitmask
299 Sets path searching debugging flags according to the bitmask.  See the
300 .I Kpathsea
301 manual for details.
303 .BI -maketex \ fmt
304 Enable
305 .RI mktex fmt ,
306 where
307 .I fmt
308 must be
309 .IR mf .
311 .BI -no-maketex \ fmt
312 Disable
313 .RI mktex fmt ,
314 where
315 .I fmt
316 must be
317 .IR mf .
319 .BI -output-directory \ directory
320 Write output files in
321 .I directory
322 instead of the current directory.  Look up input files in
323 .I directory
324 first, the along the normal search path.
326 .B -parse-first-line
327 If the first line of the main input file begins with
328 .I %&
329 parse it to look for a dump name or a
330 .B -translate-file
331 option.
333 .B -no-parse-first-line
334 Disable parsing of the first line of the main input file.
336 .BI -progname \ name
337 Pretend to be program
338 .IR name .
339 This affects both the format used and the search paths.
341 .B -recorder
342 Enable the filename recorder.  This leaves a trace of the files opened
343 for input and output in a file with extension
344 .IR .fls .
346 .BI -translate-file \ tcxname
347 Use the
348 .I tcxname
349 translation table.
351 .B -version
352 Print version information and exit.
353 .\"=====================================================================
354 .SH ENVIRONMENT
355 See the Kpathsearch library documentation (the `Path specifications'
356 node) for the details of how the environment variables are use when
357 searching.  The
358 .B kpsewhich
359 utility can be used to query the values of the variables.
361 If the environment variable
362 .B TEXMFOUTPUT
363 is set, \*(MF attempts to put its output
364 files in it, if they cannot be put in the current directory.  Again, see
365 .BR tex (1).
367 .B MFINPUTS
368 Search path for
369 .I input
371 .I openin
372 files.
374 .B MFEDIT
375 Command template for switching to editor.
377 .B MFTERM
378 Determines the online graphics display. If MFTERM is not set,
379 and DISPLAY is set, the Metafont window support for X is used.
380 (DISPLAY must be set to a valid X server specification, as usual.)
381 If neither MFTERM nor DISPLAY is set, TERM is used to guess the window
382 support to use.
383 .\"=====================================================================
384 .SH "FONT UTILITIES"
385 A number of utility programs are available.
386 The following is a partial list of available utilities and their purpose.
387 Consult your local \*(MF guru for details.
389 .TP \w'gftodvi'u+2n
390 .B gftopk
391 Takes a
392 .I gf
393 file and produces a more tightly packed
394 .I pk
395 font file.
397 .B gftodvi
398 Produces proof sheets for fonts.
400 .B gftype
401 Displays the contents of a
402 .I gf
403 file in mnemonics and/or images.
405 .B pktype
406 Mnemonically displays the contents of a
407 .I pk
408 file.
410 .B mft
411 Formats a source file as shown in
412 .IR "Computer Modern Typefaces" .
413 .\"=====================================================================
414 .SH "FILES"
416 .I "mf.pool"
417 Encoded text of \*(MF's messages.
419 .I *.base
420 Predigested \*(MF base files.
422 .I $TEXMFMAIN/metafont/base/plain.mf
423 The standard base.
425 .I $TEXMFMAIN/metafont/misc/modes.mf
426 The file of
427 .IR mode_def s
428 for your site's various printers
429 .\"=====================================================================
430 .SH NOTES
431 This manual page is not meant to be exhaustive.  The complete
432 documentation for this version of \*(MF can be found in the info manual
433 .IR "Web2C: A TeX implementation" .
434 .\"=====================================================================
435 .SH BUGS
436 On January 4, 1986 the ``final'' bug in \*(MF was discovered
437 and removed. If an error still lurks in the code, Donald E. Knuth promises to
438 pay a finder's fee which doubles every year to the first person who finds
439 it.  Happy hunting.
440 .\"=====================================================================
441 .SH "SUGGESTED READING"
442 Donald E. Knuth,
443 .I "The \*(MF\^book"
444 (Volume C of
445 .IR "Computers and Typesetting" ),
446 Addison-Wesley, 1986, ISBN 0-201-13445-4.
448 Donald E. Knuth,
449 .I "\*(MF:\^ The Program"
450 (Volume D of
451 .IR "Computers and Typesetting" ),
452 Addison-Wesley, 1986, ISBN 0-201-13438-1.
454 Donald E. Knuth,
455 .I Computer Modern Typefaces
456 (Volume E of
457 .IR "Computers and Typesetting" ),
458 Addison-Wesley, 1986, ISBN 0-201-13446-2.
460 .I TUGboat
461 (the journal of the \*(TX Users Group).
462 .\"=====================================================================
463 .SH COMMENTS
464 Warning: ``Type design can be hazardous to your other interests.
465 Once you get hooked, you will develop intense feelings about letterforms;
466 the medium will intrude on the messages that you read.
467 And you will perpetually be thinking of improvements to the fonts that
468 you see everywhere, especially those of your own design.''
469 .\"=====================================================================
470 .SH "SEE ALSO"
471 .BR gftopk (1),
472 .BR gftodvi (1),
473 .BR gftype (1),
474 .BR mft (1),
475 .BR pltotf (1),
476 .BR tftopl (1).
477 .\"=====================================================================
478 .SH AUTHORS
479 \*(MF was designed by Donald E. Knuth, who implemented it
480 using his \*(WB system for Pascal programs.  It was originally
481 ported to Unix by Paul Richards at the University of Illinois at
482 Urbana-Champaign.  This page was mostly written by Pierre MacKay.