Knuth’s most pleasing curve

Index

Computer programming requires more attention to detail than anything else that human beings have ever done. Moreover, the problems of letterform design are extremely subtle, much more complex than most people think, because our machines and our eyes interact with the shape in complicated ways. I am convinced that digital alphabet design is an extremely challenging problem, and that ait deserve the attention of our best scientific minds and our best artistic skills and sensitivities. Furthermore, I believe that the world will be a better place to live in after we learn more about the subject.1

In the text quoted above, the computer scientist and mathematician Donald E. Knuth shows the erratic first digits designed using his nascent Metafont language. Since the publisher of this seminal text did not grant us permission to publish it or even to use the accompanying pictures, let's try to visualize what would be "the most pleasant possible curve" according the algorithm that produces them:

This animation demonstrates the very basics of the drawing notations in Metapost, the language based on Metafont that supports PostScript output used for graph drawing. Notice how the curve is trying it's best to accommodate the passing points, arguments added in curly braces to the third node.

Let's consider the following mathematical problem: Given n points z1, z2,..., zn in the plane, what is the most pleasing closed curve that goes through them in the specified order [...] To avoid degenerate situations we may assume that n is at least 4. This problem is essentially like the dot-to-dot puzzles that we give to young children. Of course it is not a well-posed mathematical problem, since I didn't say what it means for a curve to be "most pleasing". Let's first postulate some axioms that the most pleasing curve should satisfy. [... skipping mathematical properties 1 to 4 ...] Property 5 (smoothness) : There are no sharp corners in the most pleasing curve. [...] In other words, there is a unique tangent at every point of the curve. Property 6 : if z1, z2, z3, z4 are consecutive points of a circle, the most pleasing curve through them is that circle.2

A more specific application of the subtleties that this pleasing curve parameter can have on a letterform are illustrated by the above screenshot. It summarizes the chronological attempts by Pierre Huyghebaert to draw the glyph "a", based on the gridded plate of DIN Mittelschrift. Several members of OSP, and some participants of the Libre Graphics Meeting took part in the first auto-learning session dedicated to code in Metapost language in Medialab Prado, Madrid in 2012.


  1. Donald E. Knuth, "Lessons learned from Metafont", Visible Language, 1985 

  2. Donald E. Knuth, "Mathematical typography", p. 355, in the Bulletin of the American Mathematical Society, Volume 1, Number 2, March 1979