If you’re a programmer you may have noticed a variety of online posts about good programming fonts over the years. This article provides a concise explanation of why you might want to chose a particular programming font and a brief overview of the latest programming fonts available. Then—based on that criteria—I’ll pick a winner for the best programmer font for 2013.
Generally speaking, most novice programmers start their careers using whatever default font is set by their IDE. However, as developers become aware of the benefits of good programming fonts there is a growing demand for programmer fonts that improve on old standbys like Courier New. Nowadays a few new great programming fonts have appeared on the scene. And the best part is that many of these are free. For example, recently Adobe has released an excellent open source font called, simply enough, “Source Code”. There are many others.
Programmer fonts are also useful for terminal emulators / consoles, or anywhere else fixed-width fonts are useful.
Let’s take a brief look at what makes a good programming font.
WHAT MAKES A GOOD PROGRAMMING FONT?
In my experience, great programming fonts share the following primary traits:
- The font should be easily legible at any size, and in particular at small sizes.
- Oft-confused letters should still be distinctly different, such as 1 vs l vs i vs |. Also, O vs 0 vs B.
- The zero should be distinct from the capital O, which is usually accomplished by putting a slash through the zero (IMHO, “slashed” zero is better than “dotted” zero because dotted zero can look like “8” at small font sizes.)
- The font should offer bold and/or italic versions for syntax highlighting, e.g., keywords can be displayed bold.
- The font should be monospaced rather than proportional. Coding is easiest for most developers when using a fixed-width font.
The important of legibility cannot be overemphasized. Programmers sometimes work long hours in front of the computer, so ideal programmer fonts must be readable with tired, bleary eyes.
Now that we know what to look for in a programming font, let’s look at some of the free fonts out there that programmers are flocking to.
POPULAR FREE PROGRAMMING FONTS COMPARED
Here, in alphabetical order, are a few of the hot programming fonts for the beginning of 2013. The images show each font at the same font size. As you can see, some fonts appear larger than others at the same font size.
This is sample of Anonymous Pro. It’s a great modern update by Mark Simonson of an old Macintosh bitmap font.
Regardless of how you feel about the Redmond software giant, Microsoft has come out with some great fonts recently (case in point, Segoe UI). With Consolas I’m cheating a bit because it’s not really free. However, if you have any recent version of Microsoft Office installed on your Mac or PC then you have Consolas installed too. Microsoft designed this font with programmers in mind.
Droid Sans Mono
Not to be outdone by Microsoft, Google has invested in typography too. One of the fruits of Google’s labor is the free Droid Sans Mono programmer font. It’s a nice font, but a big strike against it is its lack of bold and italic variants (those are available for a fee from Ascender’s DroidFonts site). Another strike against it is the lack of a slashed or dotted zero. Still, it’s a nice font and a programmer could do a lot worse than choose this.
Inconsolata is a testament to Consolas’ popularity. Inconsolata is an open source font that was inspired by Consolas with a dash of Avenir. This is sort of the Goldilocks of programmer fonts…not too rounded, not too upright, not too wide, and not too narrow. To my eye it has crystal clear legibility and it’s a joy to read all day long. (Note, this font seems to run a little smaller at the same point size relative to other fonts, so you might need to set your IDE’s font size a couple of points larger to compensate. All screen shots in this article were taken at the same font size.)
The folks at Red Hat licensed a font family from Ascender and named it Liberation. This is a nice clear font that’s easy on the eyes.
We’ve mentioned fonts from Microsoft, Google, and Red Hat. Apple’s foray into the world of programmer fonts is named Menlo. It’s derived from (and a gentle improvement upon) prior fonts in its family tree, including Bitstream Vera Sans Mono and Prima Sans Mono. This comes preinstalled on the latest versions of OS X and is also the default for Apple’s Xcode IDE. If you’re on a PC or Linux there is a very similar font called DejaVu Sans Mono (also derived from Vera). DejaVu Sans Mono is almost identical to Menlo.
Source Code Pro
Last but certainly not least we have Source Code Pro. Adobe, an 800 pound gorilla in the world of fonts, has thrown its hat into the ring with this beautiful and free programmer font. Adobe has deep experience designing attractive, well-thought-out fonts and it really shines here.
OKAY, THOSE LOOK GREAT BUT HOW DO WE CHOOSE?
When you look beyond just the basics (distinct characters, monospaced, etc.) you notice there are a few other features that are nice to have and which help a font rise above all other programming fonts.
For example, many fonts have a “raised” asterisk. This is great for folks writing a book report since they can use the asterisk as a marker for a footnote. Programmers, on the other hand, usually use the asterisk as a C pointer indicator, or as a multiplication symbol, etc. So a truly great programming font will have the asterisk centered on the line, not raised above it.
Another small detail that’s nice to have in a programming font are angle brackets that are sensibly sized. Math majors may appreciate a font with small angle brackets that are used as greater-than / less-than signs. However, programmers often enclose text in angle brackets (e.g., Java generics, HTML/XML markup, etc.), so it’s best to have angle brackets that approximate the size of a character.
Punctuation that’s distinct is another advantage for a programming font. Being able to easily discern a comma from a period can make a big difference while coding.
AND THE WINNER FOR “BEST PROGRAMMING FONT 2013″ IS…
None of the above are “must haves” for an outstanding programmer font, but in a close race they help decide the winner. So, which font goes above and beyond? Our winner is (drum roll please) … INCONSOLATA! This font is the current state of the art when it comes to programmer fonts. Runner up is Apple’s Menlo font, which gets everything right but just seems to lack a certain flair next to Inconsolata. Congratulations to Raph Levien who developed Inconsolata…and a hearty “thanks!” on behalf of all programmers.
To get Inconsolata, simply access Google Web Fonts here, then click the link “Open Inconsolata in Google Web Fonts”. Use the download link on the resulting page page. Once downloaded, simply install the font in the usual way for your OS, then set it as the font for your IDE and perhaps your terminal or console application too. This FAQ explains how to install fonts on Windows/Mac/Linux. Depending on your platform, you may need to restart your IDE and possibly your OS to see the changes.
By looking at the screen captures above it’s clear that many of the best current fonts are quite similar. In the end, a programmer’s choice of fonts is a personal one. All the fonts discussed here are good choices for programmers, so use whichever font appeals to you. You really can’t go wrong with any of the fonts above.
How about you? Do you have a favorite programming font that’s not in the list above? Let me know in the comments below.