All Topics  
METAFONT

 

   Email Print
   Bookmark   Link






 

METAFONT



 
 
Metafont is a programming language
Programming language

A programming language is a machine-readable artificial language designed to express computations that can be performed by a machine, particularly a computer....
 used to define vector fonts. It is also the name of the interpreter that executes Metafont code, generating the bitmap fonts that can be embedded into e.g. PostScript
PostScript

PostScript is a dynamically typed concatenative programming language programming language created by John Warnock and Charles Geschke in 1982. PostScript is best known for its use as a page description language in the electronic and desktop publishing areas....
. Metafont was devised by Donald Knuth as counterpart to his TeX
TeX

TeX is a typesetting system designed and mostly written by Donald Knuth. Together with the METAFONT language for font description and the Computer Modern typefaces, it was designed with two main goals in mind: to allow anybody to produce high-quality books using a reasonable amount of effort, and to provide a system that would give the exact...
 typesetting system.

One of the characteristics of Metafont is that all of the shapes of the glyph
Glyph

A glyph is an element of writing. Two or more glyphs representing the same symbol, whether interchangeable or context-dependent, are called allographs; the abstract unit they are variants of is called a grapheme or character ....
s are defined with geometrical equations, e.g., one can define a given point to be the intersection of a line segment and a Bézier cubic
Bézier curve

In the mathematics field of numerical analysis, a B?zier curve is a parametric curve important in computer graphics and related fields.Generalizations of B?zier curves to higher dimensions are called B?zier surfaces, of which the B?zier triangle is a special case....
.

ke more common outline font formats (such as TrueType
TrueType

TrueType is an outline font standardization originally developed by Apple Computer in the late 1980s as a competitor to Adobe Systems's Type 1 fonts used in PostScript....
 or PostScript Type 1
PostScript

PostScript is a dynamically typed concatenative programming language programming language created by John Warnock and Charles Geschke in 1982. PostScript is best known for its use as a page description language in the electronic and desktop publishing areas....
), a Metafont font is primarily made up of strokes with finite-width "pens", along with filled regions.






Discussion
Ask a question about 'METAFONT'
Start a new discussion about 'METAFONT'
Answer questions from other users
Full Discussion Forum



Encyclopedia


Metafont is a programming language
Programming language

A programming language is a machine-readable artificial language designed to express computations that can be performed by a machine, particularly a computer....
 used to define vector fonts. It is also the name of the interpreter that executes Metafont code, generating the bitmap fonts that can be embedded into e.g. PostScript
PostScript

PostScript is a dynamically typed concatenative programming language programming language created by John Warnock and Charles Geschke in 1982. PostScript is best known for its use as a page description language in the electronic and desktop publishing areas....
. Metafont was devised by Donald Knuth as counterpart to his TeX
TeX

TeX is a typesetting system designed and mostly written by Donald Knuth. Together with the METAFONT language for font description and the Computer Modern typefaces, it was designed with two main goals in mind: to allow anybody to produce high-quality books using a reasonable amount of effort, and to provide a system that would give the exact...
 typesetting system.

One of the characteristics of Metafont is that all of the shapes of the glyph
Glyph

A glyph is an element of writing. Two or more glyphs representing the same symbol, whether interchangeable or context-dependent, are called allographs; the abstract unit they are variants of is called a grapheme or character ....
s are defined with geometrical equations, e.g., one can define a given point to be the intersection of a line segment and a Bézier cubic
Bézier curve

In the mathematics field of numerical analysis, a B?zier curve is a parametric curve important in computer graphics and related fields.Generalizations of B?zier curves to higher dimensions are called B?zier surfaces, of which the B?zier triangle is a special case....
.

Mode of operation

Unlike more common outline font formats (such as TrueType
TrueType

TrueType is an outline font standardization originally developed by Apple Computer in the late 1980s as a competitor to Adobe Systems's Type 1 fonts used in PostScript....
 or PostScript Type 1
PostScript

PostScript is a dynamically typed concatenative programming language programming language created by John Warnock and Charles Geschke in 1982. PostScript is best known for its use as a page description language in the electronic and desktop publishing areas....
), a Metafont font is primarily made up of strokes with finite-width "pens", along with filled regions. Thus, rather than describing the outline of the glyph directly, a Metafont file describes the pen paths. Some simpler Metafont fonts, such as the calligraphic mathematics fonts in the Computer Modern
Computer Modern

Computer Modern is the family of typefaces used by default by the typesetting program TeX. It was created by Donald Knuth with his METAFONT program, and was most recently updated in 1992....
 family, use a single pen stroke with a relatively large pen to define each visual "stroke" of the glyphs. More complex fonts such as the Roman
Roman type

In Typography, "roman" type has two principal meanings, both stemming from the stylistic origin of text typefaces from Roman square capitals used in ancient Rome:...
 text fonts in the Computer Modern family use a small pen to trace around the outline of the visual "strokes", which are then filled; the result is much like an outline font, but with slightly softened corners defined by the pen shape.

Since the font shapes are defined by equations rather than directly-coded numbers, it is possible to treat parameters such as aspect ratio, font slant, stroke width, serif
Serif

In typography, serifs are semi-structural details on the ends of some of the strokes that make up letters and symbols. A typeface that has serifs is called a serif typeface ....
 size, and so forth as input parameters in each glyph definition (which then define not a single font, but a meta
Meta

Meta , is a prefix used in English language in order to indicate a concept which is an abstraction from another concept, used to complete or add to the latter....
-font). Thus, by changing the value of one of these parameters at one location in the Metafont file, one can produce a consistent change throughout the entire font. Computer Modern Roman illustrates many uses of this feature; a typical TeX installation includes a number of versions of the font in sizes from 5pt to 17pt, with the stroke widths the same in all sizes (rather than increasing as the font is scaled up) and aspect ratios widening in the smaller sizes for increased legibility. In addition, the Computer Modern typewriter and sans-serif
Sans-serif

In typography, a sans-serif or sans serif typeface is one that does not have the small features called "serifs" at the end of strokes. The term comes from the French word sans, meaning "without"....
 fonts are defined using essentially the same Metafont file as the Roman font, but with different global parameters.

Curves in Metafont are defined not as conic sections but as cubic splines, for greater versatility and simpler arithmetic.

Metafont can render any kind of graphical output, not just glyphs. However, MetaPost
MetaPost

MetaPost refers to both a programming language and the only known interpreter of the MetaPost programming language. Both are derived from Donald Knuth's Metafont language and interpreter....
 with its PostScript output is preferred for advanced illustrations. Metafont is most commonly invoked without a direct request from the user. DVI files can only contain references to typefaces, rather than the sets of raster or vector glyphs that other formats like PostScript allow. Consequently the glyphs in the typefaces need to be accessed whenever a request is made to view, print or convert a DVI file. Most TeX distributions are configured so that any fonts not currently available at the required resolution
Dots per inch

Dots per inch is a measure of spatial printing or video dot density, in particular the number of individual dots that can be placed within the span of one linear inch The DPI value tends to correlate with , but is related only indirectly....
 are generated by calls to Metafont. The typefaces are then stored for later reuse.

Metafont can also be run interactively, and has commands for displaying on the screen the images it produces. Knuth has said that he uses Metafont as a kind of desk calculator for solving complicated equations, though he now uses MetaPost for mathematical illustrations.

Producing PostScript Type 1 fonts

There are several tools for converting Metafont programs to PostScript Type 1 fonts. Most make use of Metapost
MetaPost

MetaPost refers to both a programming language and the only known interpreter of the MetaPost programming language. Both are derived from Donald Knuth's Metafont language and interpreter....
's ability to convert a subset of Metafont's language into EPS
EPS

EPS or Eps may refer to:...
 outlines, which can subsequently be converted to PostScript Type 1 fonts. Generating vector outlines of pen strokes directly in Metafont is nontrivial, as the bitmapped strokes are generated by rasterization rather than actual outlines.

  • The Polish JNS team developed METATYPE1
    METATYPE1

    METATYPE1 is a tool for creating PostScript Type 1 fonts using METAPOST, developed by the Polish JNS team .Since METAFONT cannot produce outline fonts , a new tool was needed to help creating such fonts, primarily for the usage in TeX, although the OpenType version of the fonts might be used in any other program....
     (based on Metapost
    MetaPost

    MetaPost refers to both a programming language and the only known interpreter of the MetaPost programming language. Both are derived from Donald Knuth's Metafont language and interpreter....
    ) for creating PostScript Type 1 fonts. Its big disadvantage is that no pens may be used which highly reduces the power of Metafont language. Initially, tool has been used by the Polish GUST
    Gust

    is a Japanese developer and publisher of game software titles, known for games such as Atelier Marie, Atelier Iris, and Ar tonelico....
     typeface foundry to produce a modernized and extended variant of Computer Modern
    Computer Modern

    Computer Modern is the family of typefaces used by default by the typesetting program TeX. It was created by Donald Knuth with his METAFONT program, and was most recently updated in 1992....
    , called Latin Modern.
  • mf2pt1, which is also based on Metapost, was developed by Scott Pakin with some contributions from Werner Lemberg
    Werner Lemberg

    Werner Lemberg is an Austrian musician and computer programmer. He has developed the CJK package for LaTeX, and contributed to the LilyPond music typesetting software....
    . It also has several limitations detailed in its manual, the most significant one being the restriction that each glyph must be drawn entirely from closed paths. In order to overcome the limitations of mf2pt1, the EPS output by Metapost can be post-processed with FontForge
    FontForge

    FontForge is a font editor program developed by George Williams . Fontforge is free software and is distributed under the BSD license. FontForge is available for several operating systems and is localized in several languages....
    , which is capable of interpreting complex PostScript paths generated by Metapost from Metafont's elliptic pens, and also capable of removing contour overlaps. Since FontForge supports scripting, this post-processing step can also be automated. This approach was used to produce Type 1 outlines for the MnSymbol mathematical font developed by Achim Blumensath; MnSymbol was designed as a companion to Minion Pro
    Minion (typeface)

    Minion is the name of a typeface designed by Robert Slimbach in 1990 for Adobe Systems. The name comes from the traditional naming system for type sizes, in which minion is between nonpareil and brevier....
    .
  • MetaFog is a proprietary converter that can analytically convert pen strokes, but it requires manual post processing to eliminate degenerate cases, and it is not publicly available. It can process only Metapost output.


The common approach to generate Type 1 fonts with pen strokes remains to generate a high-resolution bitmap and then using an autotracer, implemented by packages such as mftrace.

Use

While well-known font designers, such as Hermann Zapf
Hermann Zapf

Hermann Zapf is a German typeface designer who lives in Darmstadt, Germany. He is married to calligrapher and typeface designer Gudrun Zapf von Hesse....
, have collaborated with Knuth to create new fonts using Metafont, the system has not been widely adopted by professional type designers. Knuth attributes this to the fact that "asking an artist to become enough of a mathematician to understand how to write a font with 60 parameters is too much".

History

Donald Knuth
Donald Knuth

Donald Ervin Knuth is a renowned computer science and Emeritus of the Art of Computer Programming at Stanford University.Author of the seminal multi-volume work The Art of Computer Programming , Knuth has been called the "father" of the run-time analysis, contributing to the development of, and systematizing formal mathematical techn...
 started work on font creation software in 1977, and produced the first version of Metafont in 1979. Due to shortcomings in the original Metafont language, Knuth developed an entirely new Metafont system in 1984, and it is this revised system that is used today; Metafont has a versioning system similar to that of TeX
TeX

TeX is a typesetting system designed and mostly written by Donald Knuth. Together with the METAFONT language for font description and the Computer Modern typefaces, it was designed with two main goals in mind: to allow anybody to produce high-quality books using a reasonable amount of effort, and to provide a system that would give the exact...
, where the number asymptotically approaches e
E (mathematical constant)

The mathematical constant e is the unique real number such that the function ex has the same value as the derivative, for all values of x....
 with each revision.

External links