Metafont is a programming language used to define fonts. It was created by Donald Knuth and is a companion to the TeX typesetting system.
A Metafont script describes the shape of a glyph (or multiple glyphs) as a collection of pen strokes. The cool thing about Metafont is that it is a programming language. You can use variables (parameters), loops, and conditionals to define the shape of a glyph. You can also describe the pen strokes declaratively in terms of their desired shape rather than explicitly list the commands to draw them. This allows you to create complex shapes that would be difficult to draw by hand.
To execute Metafont code, you usually need to install the Metafont interpreter on your computer (typically as part of the TeX distribution). To make it easier to experiment with Metafont, this online tool that allows you to run Metafont code online and see the generated output.
1
mode_setup;
2
3
% parameters are name, width, height over base line, depth below base line