\documentstyle[12pt,titlepage]{article}

\font\manual=manfnt at 12pt
\def\MF{{\manual META}\-{\manual FONT}}

\begin{document}
\title{Metafont 2.7\\for the Commodore Amiga}
\author{ported by: Stefan Becker}
\maketitle

\section{What is Metafont?}
\MF\ is a program which produces raster fonts for the \TeX\ system. The user
creates a program for each character of a given font, using the special \MF\
language. \MF\ runs through every program and creates a raster bitmap for the
character in the resolution of the given output device. At the same time it
calculates the font metrics which \TeX\ needs.

This program is a port of \MF\ 2.7 for the Commodore Amiga Computer. It is full
compatible to implementations on other systems, because it has passed the trap
test. Only a graphic output for character screening at runtime was added. This
documentation describes {\bf only} the operation of \MF\ and its utilities on
the Amiga. Further information, especially about the \MF\ language, is
available in the literature, e.g.\ [1] \& [2].

\section{The operation of Metafont}
\MF\ can only be called from the CLI, as the following example shows:

\begin{verbatim}
> virmf
This is METAFONT, C Version 2.7
** _
\end{verbatim}

\MF\ shows its banner line and awaits the name of a \MF\ source file. Such
files have a name ending with {\em .mf}. If your system is equiped with too few
RAM, it can happen that \MF\ stops with the error message {\tt Not enough
memory (x)!} (x is a number). To circumvent this situation you can reduce the
size of the internal memory arrays of \MF, as described below.

\MF\ accepts a number of parameters at call time. This is especially helpful
for the writing of script files. The following parameters are allowed:

\begin{description}
 \item[name]{Name of a \MF\ source file.}
 \item[\&name]{Name of a {\em .base\/} file. This file contains frequently used
               procedures in a pre-compiled form (see below).}
 \item[``$\backslash\ldots$'']{\MF\ language commands, separated by `;', e.g.:
  \begin{description}
   \item[batchmode]{Suppress the \MF\ terminal output.}
   \item[input name]{Process the \MF\ source file {\em name.mf}.}
   \item[mag:=size]{Size of the font to be produced.}
   \item[mode:=name]{Produce a font for the output device {\em name}.}
   \item[screenchars]{Show completed characters in the graphic output
                      window.}
   \item[screenstrokes]{Show all creation stages of a character in the graphic
                        output window.}
  \end{description}}
\end{description}

\MF\ can produce fonts for any output device. The user must create a so called
{\em mode definition\/} for each device. The name of such a definition must be
given behind the {\em mode\/} command. The file {\em mydevices.mf\/} contains
some examples. Detailed information about {\em mode definitions\/} and font
sizes can be obtained from [1].

Two special output devices exist, which can be used to produce big enlarged
fonts. These modes have the names {\em proof\/} and {\em smoke}. If one of this
modes is used, the command {\em screenchars\/} will be executed. It opens a
graphic output window with the size of $500*400$ (or $250*200$, see below),
which will be used to display the characters. If the window couldn't be opened,
\MF\ does {\em not\/} display an error message, but continues its work.

\MF\ displays the number of the currently processed character at runtime. If an
error occurs, \MF\ stops and displays an extensive but cryptic error message
and a prompt. This is the \MF\ error mode. In this interactive mode you can try
to correct the error. A command list is available with `?'. With `X' you can
leave the program and \MF\ continues to work with {\em RETURN}. At runtime you
can reach this error mode with {\em CTRL-C}.

If you have typed in the wrong file name, then \MF\ prompts you for the right
one. In this mode you can leave the program with {\em CTRL-$\backslash$}.

And now an example run of \MF. We want to produce the font {\em cmb10\/} in the
size {\em magstep 4\/} for the screen previewer. The command line and the
(shorten) example run looks as follows:

\begin{verbatim}
> virmf "\mode:=previewer; mag:=magstep(4); input cmb10"
This is METAFONT, C Version 2.7
(mf:mfinputs/cmb10.mf (mf:mfinputs/roman.mf
(mf:mfinputs/romanu.mf [65] [66] [67] [68] [69] [70]
[......]
[34] [45] [92] [123] [124]) ) )
Font metrics written on cmb10.tfm.
Output written on cmb10.207gf (128 characters, 9620 bytes).
Transcript written on cmb10.log.
> _
\end{verbatim}

\section{Metafont Utilities}
This section describes the additional \MF\ utilities.

\subsection{gftopk}

SYNTAX:\quad{\tt gftopk}\quad{\em GF file name\/}\quad{\em PK file name}

This program converts fonts from \MF\ common {\em GF\/} format to the
compressed {\em PK\/} format. It is used by the most printer drivers.

\subsection{gftodvi}

SYNTAX:\quad{\tt gftodvi}

This program converts fonts, which were produced with the {\em proof\/} or {\em
smoke\/} mode, into a printable {\em .dvi} file. Each character of the font
fills one page. The program needs two special fonts {\em black\/} and {\em
gray\/}, which contain mainly gray rasters. To produce these fonts, consult the
appendix in [1].

\subsection{gftype}

SYNTAX:\quad{\tt gftype}\quad[--m] [--i]\quad{\em GF file name}

This program extracts the contents of a {\em GF\/} font file and displays them
in a readable form. With the two options --m and --i you can choose, how much
information will be displayed.

\subsection{mft}

SYNTAX:\quad{\tt mft}\quad{\em MF file name}\quad[--s]\quad[{\em style file\/}]

If you want to print out your \MF\ source files in a more readable form, then
you can use this program to convert {\em .mf\/} files into {\em .tex\/} files.
These files can then be processed with \TeX. The style file contains the
parameters for the conversion. This packet contains the style file {\em
plain.mft\/} and the macro packet {\em mftmac.tex\/} for the post-processing
with \TeX.

\section{The configuration of Metafont}
The paths, which \MF\ and its utilities use for the search of files, can be set
with environment variables. These variables can be set with the AmigaDOS
command {\tt setenv}. The different paths are seperated with `,'. The following
variables are used (the default path is enclosed in parenthesis, `.' stands for
the current directory):

\begin{description}
 \item[mfinputs (.,mf:inputs)]{Path for the {\em .mf\/} files.}
 \item[mfbases (.,mf:bases)]{Path for the {\em .base\/} file.}
 \item[mfpool (.,mf:bases)]{Used by {\tt inimf} for the {\em mf.pool\/} file
                            (see below).}
 \item[texfonts (.,tex:fonts)]{Path for the {\em .tfm\/} files.}
 \item[dviconfig (.,mf:config)]{Path for the {\em MF.mem\/} file (see below).}
\end{description}

The size of the internal memory arrays of \MF\ can be controlled with the
configuration file {\em MF.mem}. This text file consists of several lines with
one number in each line. {\bf BEWARE:} The order and number of lines is
important! The example file supplied with this packet has a comment behind each
line, which describes the function of the number. The following explains only
the important numbers, because all others have only an internal meaning:

\begin{description}
 \item[memmax]{Size of the \MF\ main memory array in memory words. One memory
               word is 4 Bytes large.}
 \item[memtop]{Highest usable memory word. The following {\bf must} be true:
               \hfill\linebreak[4]$memtop \le memmax$}
 \item[scalefactor]{Size of the \MF\ graphic output window:
  \begin{description}
   \item[1]{Big window, characters are displayed in normal size.}
   \item[2]{Small window, characters are displayed in half of the normal size.}
  \end{description}}
\end{description}

If you have changed the configuration, you must create a new {\em .base\/}
file, which corresponds to the new values. This file is created by a special
\MF\ version, called {\tt inimf}. This version ``compiles'' frequently needed
parts, e.g.\ {\em plain.mf}, {\em cmbase.mf}, error messages and your own {\em
mode definitions}, into the {\em .base} file, which the normal \MF\ version
{\tt virmf} only needs to load into memory. The error messages are contained in
the file {\em mf.pool}. A sample run of {\tt inimf} might look as follows:

\begin{verbatim}
> inimf
This is METAFONT, C Version 2.7 (INIMF)
**plain
(plain.mf
Preloading the plain base, version 2.0: preliminaries,
 basic constants and mathematical macros,
 macros for converting from device-independent units to pixels,
 macros and tables for various modes of operation,
 macros for drawing and filling,
 macros for proof labels and rules,
 macros for character and font administration,
and a few last-minute items.)
*\input mydevices
(mf:inputs/mydevices.mf)
*\input cmbase
(mf:inputs/cmbase.mf)
*\dump
Beginning to dump on file plain.base
 (base=plain 90.9.24)
1622 strings of total length 24962
15588 memory locations dumped; current usage is 3789&11746
743 symbolic tokens
> _
\end{verbatim}

The file {\em plain.base}, created by this example run, must then be moved into
a directory, which is contained in the environment variable {\em mfbases}. This
examples has created a file, which contains all procedures needed to create the
{\em Computer Modern Roman\/} fonts, the standard fonts of \TeX. Further
information may be obtained from [1] \& [2].

\section{Appendix}

BIBLIOGRAPHY:
\begin{description}
 \item[1]{{\em The Metafont Book\/} by Donald E.\ Knuth, the inventor of \MF.}
 \item[2]{{\em Computer Modern Typefaces\/} by Donald E.\ Knuth, a detailed
          description of the CMR fonts.}
\end{description}

I hope my english was not too bad$\ldots$

\end{document}
