F.1. The METAFONT Programming Language

F.1.1. Basic Concepts

There is a fundamental peculiarity of the METAFONT language that distinguishes it from all other languages for graphical description: it takes initiatives. More precisely, METAFONT has an inherent notion of "beauty", and if we give it enough room for maneuver, it will draw curves that it considers "beautiful".

Let us take an example. Suppose that we have a line segment AB and that we ask a graphic artist to draw a curve from point A, with a tangent perpendicular to the segment, that ends at point B, once again perpendicularly to the segment. In the absence of other information, what will he draw? We have no idea. But we know what METAFONT will do: it will draw a semicircle of diameter AB. Any other language for graphical description, such as PostScript or SVG or CGM, would have stopped and made the ironic and condescending remark "insufficient data", worthy of the famous "Illogical, Captain!" that the noted Vulcan frequently uttered to the helpless human Captain Kirk. But since Kirk always won in the end, thanks to his human qualities and despite his illogicality, METAFONT always manages to draw "beautiful" curves, despite the lack of data supplied by its human operator.

We have just said "despite the lack of data". We could go further: most of the time it is "thanks to the lack of data". Indeed, the author has often noticed that supplying fewer data to METAFONT produces a more beautiful curve.

But how does METAFONT ...

Get Fonts & Encodings now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.