Writing by Peter Hilton

Ligatures with Fira Code

The coding font with ligatures that not everyone knows about - 15 June 2018 #code #typography

In my NDC Oslo 2018 presentation about Beautiful Code this week, I mentioned the latest in a very short list of typographical innovations for source code: ligatures. It turned out that only a few members of the audience knew about Fira Code, even though JetBrains include Fira Code with IntelliJ IDEA since late 2016, so I had the pleasure of introducing it to a larger group.

Ligatures

A typographic ligature combines two letters into a single glyph, as in the lower-case ‘fj’ combination. The first letter’s overhanging ascender combines with the second letter’s dot.

fg ligature

Appropriately for a conference in Norway, the only word in English that contains ‘fj’ is the Norwegian word ‘fjord’. This combination is more common in Norwegian, as is ‘fi’ in English.

Fira Code

Hasklig, announced in 2014, was probably the first code font that used ligatures in the font to replace Haskell ASCII art with proper mathematical symbols. Fira Code is more recent code font, based on Fira Mono, that includes a broader set of ligatures, making it more useful for other programming languages.

Fira Mono and Fira Code

This comparison shows the same text, but with different fonts. When you use Fira Code, the characters on disk are the same: only the on-screen rendering changes. This means that you can be the first person on your team to use Fira Code, without it affecting anyone else… until you try pair programming.

If you write code and haven’t tried Fira Code, then give it a try and stick with it for an hour if it seems weird at first. Maybe you’ll never go back.

Why you shouldn’t be impressed

Code font ligatures are pretty cool, but aren’t much to show for thousands of years of typography. By sticking to monospace fonts in a single font-size, programmers are stuck in the typewriter era, and a 1970s toolchain.

A typical application codebase is a large body of highly-structured text that a team struggles to maintain for years. Given that we typically spend much more time reading code than writing it, programmers would do well to learn how layout and typography improve readability in every other use of structured text in society.

comments powered by Disqus