Metafont Mode Help
Name:Metafont Mode
Version:3.1
Last update:2020-05-27 14:28:46





Introduction

MetafontMode is a mode for the text editor Alpha: it is designed to make writing, processing and testing of Metafont source files much easier. Metafont is the programming language written, as a companion to TeX, by Donald Knuth in order to create characters, fonts, font families (and many other things).
Once Metafont mode is installed, the opening of a Metafont source file (i-e with extension .mf) invokes a new menu (called Metafont !) in the menu bar with the following features: As of this release, both CMacTeX Metafont and OzMetafont are supported.

Description

Description of the Metafont Menu items:
Switch To Metafont
Launches the Metafont application in front
Process Current Window
Calls up the Metafont application and processes the current window
Process a File
Prompts you for a Metafont source file to run.
Process a Folder
(When pressing the option key) Prompts you for a folder of Metafont source files to run.

Metafont Modes submenu

The word mode has a different meaning for Alpha and for Metafont: here it means the Metafont's printer mode, the one you specify when you (or Maketexpk) process a font. As usual with Metafont if no mode is specified, the default is proof. You can choose among the following list. User Defined should be set in the Current Mode Setup: it is the printer mode at your installation. If you do not know which mode corresponds to your installation, look in the modes.mf file which comes with your TeX distribution. You can edit this file directly in Alpha from this Metafont Menu (see below).
Proof
To make proof characters at 2602 resolution (36 pixels per point). No tfm file is produced in this mode.
Smoke
To make black proof characters. No tfm file is produced in this mode.
Localfont
Use this mode when you do not know the printer mode's name of your installation: if your administrator did his job well, the localfont variable contains the printer mode.
User Defined
Comes as default as canonex: you set here what you want.

Metafont Options submenu

Define here any particular processing option allowed by Metafont.
Mag...
Default value is 1, which means no magnification.
Magstep...
Default value is 0, which means no magnification Note that you choose a magnification either in mag or in magstep: if you choose the magstep syntax, any choice you previously made with mag will be omitted (and vice versa).
Base File...
You can specify a particular file (a base file for instance) which should be input before the file you want to process. Like in the command line:
(| mf \mode=foo ; input somebasefile.mf ; input currentwindowfile.mf
To cancel an input file you have to clear all options (see below the menu item Clear All Options)
gfcorners
Option to draw corners at the corners of the box containing each character. Works in smoke mode.
imagerules
Option to draw the box of each character.
nodisplays
Don't show the characters on the monitor: to build fonts faster
notransforms
Don't calculate any transformation if currenttransform is identity. To run faster.
screenchars
Show each character once it has been calculated.
screenstrokes
Show each character stroke after stroke while it is calculated
Clear All Options
Cancel all previously selected options.

Metafont Postprocess submenu

Open Log File
Edit in Alpha (read-only) the log file corresponding to the currentwindow and produced by a run of Metafont on this current window.
Open Property List
Open the property list file related to the current window (if it exists, i-e if you have already converted the tfm to pl)
Convert gf to pk
Invokes gftopk to transform the gf file produced after a run of Metafont to the pk (packed) format. This procedure reads in the log file to find the name of the gf file (which depends on the mode chosen and the mag): if the log file is missing, it won't work. Note that with OzMetafont, pk fonts are automatically produced when a source file is processed.
Convert gf to dvi
Invokes gftodvi to transform the gf file produced after a run of Metafont to a dvi (device independant) file. This procedure reads in the log file to find the name of the gf file (which depends on the mode chosen and the mag): if the log file is missing, it won't work. This item is present only when using CMacTeX Metafont.
View dvi file
If a dvi file has been produced (see previous item) you can view it with the dvi previewer (dvipreview with CMacTeX, built-in previewer with Oz).
The following items allow you to process a single file or all the files in a selected folder:
Tfm to pl...
Prompts the user for a tfm file to convert to human readable format: extension of these files will be fpl
Vf to vpl...
Prompts the user for a vpl file to convert to the corresponding tfm and vf
Pl to tfm...
Prompts the user for a pl file in human readable format to compile a tfm file
Vpl to vf...
Prompts the user for tfm and vf files to convert to the corresponding vpl

Metafont Utilities submenu

Open Modes.mf
Edit (read-only) the modes.mf file. It is the file containing the printer mode definitions for allmost all the available printers.
Open Plain.mf
Edit (read-only) the plain.mf file. It is the file containing the definition of all the basic Metafont macros. Note: you have to set the paths to these files in the mode specific preferences when you first use the Metafont Mode.
Delete Auxiliary Files...
Sub menu to delete several types of files in the current folder: log, gf, pk, dvi, tfm, vf, pl, vpl. The pl files will be removed only if they have the plf extension (to avoid accidentally destroying Perl script files)
New Font Template...
Builds a template for a complete new font source file. User is asked for the number of characters in the font.
Menu Shortcuts...
Define custom shortcuts for the menu items.
Display Bindings
Display the bindings currently defined in Metafont mode

Metafont Editing submenus

The following submenus contain the basic Metafont macros.
Any item you choose in one of these submenus is inserted in your file at the cursor's current position with electric tabs for those commands which need arguments (use the tabulation key to jump from one tab to the next one). In some cases, you will be asked to enter a number (see makegrid for instance).
The following menus are available:

File marking

Various elements are marked: macro definitions, character definitions, related files, input files etc. and can be easily accessed through pop-up menus and option or command clicking.

The Mark pop-up menu

If you choose to mark your file from the Marks pop-up menu (top right of your editing window), all the def, vardef and beginchar declarations in your source file will be marked. Remember that the beginchar command is customizable (in the Mode Setup) and any change you make there will be taken into account for marking.
If the 'Auto Mark' checkbox is checked in the Prefs, the file is automatically marked at opening.

The Functions pop-up menu

The Functions pop-up menu (top right of your editing window) contains the functions and macros defined in your source file. We list here all the def, primarydef, secondarydef, tertiarydef and vardef definitions as well as the files input with an input command.

Shift-Command double clicking a word

If you Shift-Command-Double-Click on a keyword you access its definition. This procedure looks first for a definition in the current file itself, then in the list of primitives, then in the plain Metafont macros file and finally in the other text files located in the same folder and called in the current file by an 'input' command (typically they are macros files).

Option clicking the title bar

If you Option-Click in the title bar, you get a list of all the .mf files located in the folder of your current window. Selecting any item in this list will open it in a window or bring its window to front if it is already open.

Completions

Metafont Mode has a rich set of completion procedures:

Key bindings

A few key bindings are defined in Metafont mode. Use the command Mf ↣ Metafont Utilities ↣ Display Bindings to display them.

Metafont mode preferences

If the current window is in Metafont mode, select the command Alpha ↣ Mode Setup ↣ Mode Preferences… to display the Mf Mode Preferences. All of them should be self-explanatory.
Here is the meaning of some of them:

Known problems

Please report any problem or bug you encounter to Alpha's Bug Tracker.

License and Disclaimer

Copyright (c) 1999-2020, Bernard Desgraupes.
All rights reserved.
The Metafont Mode package is free software and distributed under the terms of the new BSD license:
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BERNARD DESGRAUPES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.