Skip to content

METAFONT for Designers

MM edited this page Aug 3, 2016 · 48 revisions

LaTeX, TeX and METAFONT are not preinstalled on Mac OS X. This is a guide for designers how to install and work with METAFONT on Mac OS X:

Install MacTeX

The main LaTeX distribution for Mac OS X is MacTeX. This package contains the LaTeX distribution, several editors (including TeXShop we need later on) and other useful stuff. Head over to MacTeX from the TeX Users Group. If you follow the link you can immediately download it. Note that the package is about 2 GB and thus may take a while to be downloaded (depending on your internet connection).

Once you’ve downloaded the distribution, install it by double-clicking the .dmg file. The rest is just the same installation procedure as any other Mac software.

Now, open your Applications folder and search for a folder called TeX. It contains everything you need. TeXShop and TeXworks are both open source LaTeX editors, released under the GPL. You can start right away working with them. (1)

Install the command line developer tool (cc)

Part of OS X is its powerful command-line interface, where we can make use of a number of tools for configuring and customizing the system, and run programs as METAFONT and scripts. While OS X ships with a number of common commands, by default Apple does not include those that are used for checking out, compiling, and otherwise managing code for developing applications. There are three ways you can get them on your Mac:

  • install Apple's XCode developer suite, which is available via the Mac App Store for free
  • get it over the Apple developer website
  • open the Terminal (HD > Programs > Utilities > Terminal), type make or any desired common developer command, and press Enter, and then when prompted you can install the developer tools 

When installed, the developer tools will be placed in the Macintosh HD > Library > Developer directory, which you can peruse to see what exactly has been installed. To uninstall these tools, simply remove the Developer folder from the Macintosh HD > Library directory. (2)

Install XQuartz/X11

The XQuartz project is an open-source implementation of the X Window System that runs on OS X. Download the package, install and restart your computer to make X11 your default server.

Get started with METAFONT

Open the Terminal (HD > Programs > Utilities > Terminal), type mf and press Enter. The terminal should return:

This is METAFONT, Version 2.7182818 (TeX Live 2016)

**

That is the confirmation that METAFONT runs on your system. METAFONT displays a ** prompt, which is METAFONT’s way of asking you for an input file name. METAFONT source files are suffixed .mf and if you don't have MF files ready you can force quit the routine by pressing control-D.

While creating fonts, it is useful to enlarge the character shapes enough to be able to make out small details. This blowing-up process is called proofing. METAFONT works together with GFtoDVI, another program created as part of the TeX project, to do this. The only thing is that current versions of MacTeX don’t include the gray.tfm file anymore that you will need for METAFONTs proofing mode. To generate this file, type mktextfm gray and press Enter. Done.

  1. download one of our Metaflop fonts or get a METAFONT from the CTAN archive
  2. open the Terminal (HD > Programs > Utilities > Terminal)
  3. go to your local MF file folder cd /local path
  4. enter a METAFONT source file name, e.g. font.mf and execute it with mf font
  5. METAFONT generates a bitmap output called font.2602gf and a font.log file. The gf (generic font) file is suffixed .*gf respectively, where, in a typical unix installation, the * stands for the font resolution.
  6. gftodvi font generates a bitmap needed for large-scale proofs called font.dvi
  7. open font.dvi in TeXShop, that will generate and display font.pdf

METAFONT proofing for TeXShop

  1. go to our Metaflop miscellaneous site, download and save MFproof.engine
  2. open the Terminal (HD > Programs > Utilities > Terminal)
  3. copy the file to your local TeXShop folder cp /local path/MFproof.engine ~/Library/TeXShop/Engines
  4. go to the local TeXShop engines folder cd ~/Library/TeXShop/Engines
  5. change the file permission chmod ugo+rwx "MFproof.engine"
  6. open TeXShop
  7. open a METAFONT source file name, e.g. font.mf in TeXShop
  8. choose „MFproof“ from the pulldown menu beside the Typeset button on any document window
  9. press Typeset

(1) Installing LaTeX on Mac OS X, http://www.howtotex.com/howto/installing-latex-on-mac-os-x/
(2) Install command line developer tools in OS X, Topher Kessler, http://www.cnet.com/how-to/install-command-line-developer-tools-in-os-x/