This is a font that interprets text as markdown and renders it with formatting. The font supports bold, italics and monospace text and escaping of formatting markers. Try the web demo.

How does it work?

The font takes advantage of a fancy opentype feature called contextual alternates, which is a kind of rewrite system that allows a font to conditionally choose which glyph to display for a character depending on its surrounding text. As recursion is possible, this system makes opentype turing complete in theory. The substitution rules are typically expressed in the syntax of a opentype feature file and then compiled into a binary table embedded in the font.

To encode the rules of markdown in opentype, I had to write a script to generate a 2500+ lines long feature file. I also wrote a script to stitch together arbitrary user specified font files (five in total, one for each stylistic variant).

Does this actually have any use?

Since this is a font, you can use it to get markdown rendering in any software with sufficient support for opentype features such as browsers, word processors and even terminal emulators. As the font merely changes how text is displayed, the source text is preserved and can be copied and pasted like normal text.

So you made a useless thing again

A beautiful useless thing.


The font is only designed to work with printable ASCII characters (U+0020 to U+007F). Using non-supported characters inside format markers will mess up the formatting of subsequent characters.


This project was inspired by this blog post which brought my attention to the capacity of fonts to perform computation.

Built With

Share this project: