Programming ligatures

A ligature is a glyph formed by two or more graphemes. Computer fonts with programming ligatures use ligatures to present lexemes formed of two or more symbols. There is disagreement over whether that is useful or harmful – harmful because the presentation masks the symbols required to form the lexeme in code.

Ian Tuomi’s Hasklig fonts add programming ligatures to Adobe’s Source Code Pro fonts, with Haskell’s lexemes in mind. For example, the code (in Consolas):

can be presented as (in Hasklig):

Microsoft ships another font with programming ligatures, Cascadia Code, with its Windows Terminal. However, that covers != (‘not equal to’ in C) and does not cover /= (‘not equal to’ in Haskell).

Crayon Syntax Highlighter

Adding a font to the WordPress plugin Crayon Syntax Highlighter involves adding (1) a folder with the web font files and (2) an .css file, to wp-content/uploads/crayon-syntax-highlighter/fonts/. As an example of the .css file:

This specifies an @font-face rule for the web font and a rule with a descendant selector specifying the font-family. The !important keyword affects the order of the rule in the cascade.