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 for

Markdown font | Devpost

submited by
Style Pass
2021-06-11 11:00:08

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.

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).

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.

Leave a Comment