We’ve recently noticed two different fonts aimed at programmers, each with a different approach to editor customization. The first, Fira Code, transparently converts common programming digraphs into single characters. For example, <- becomes an arrow and != (or <>) becomes a proper not equal sign. The other font, Hack (can’t argue with the name), aims to make commonly confused characters distinct. For example, the zero glyph has a very distinct appearance from the letter O.
It is pretty easy to understand how Hack works, but Fira seems a mystery at first. Your C++ compiler expects <- not an arrow, right? Fonts support ligatures–sequences of two symbols that run together (like æ). Clever use of these ligatures means that the compiler still sees -> but the screen displays an arrow.
Once you install the font, you still need to tell your editor to use the font, but that’s a setting in just about every IDE (even if you have to edit a configuration file somewhere). We have mixed feelings about Fira Code. It has a high cool factor, but it also feels like you are hiding the actual code and that doesn’t seem like a good thing.
If you want to roll your own, there are plenty of ways to create fonts. Naturally, you can even do it with a Web application (see video below). Of course, if you do we want to hear about it.
Thanks [k5rud] for pointing out Hack.
that fira code would be such a head fuck to get used to.
Nah, it’s pretty easy. Took about 5 minutes.
But why on earth would you want to? There are plenty of things that are easy enough to do, but even with a small effort you still need at least a small benefit to make it worthwhile.
What makes you think there’s no benefit? Without the ligatures, lots of characters are overloaded – they get used for multiple things. “-“, “=”, etc. since they’re used in digraphs. Joining them helps to make them more distinct to your eye, so once you get used to it, you’d expect that dumb mistakes (= instead of ==, etc.) would get easier to see. Not saying it will for everyone, but you could imagine it would.
Bingo. That’s exactly why I did it. Mistakes jump out a bit more.
I’ve run into languages where the combined digraph was the convention, both in print publications and the IDE. Fira Code would certainly be an excellent option in those cases, particularly if the developer wanted to break away from the language’s standard IDE. But yeah, it would take getting used to for conventional languages.
Hack looks like a nice font for terminals. Capitol i, lowercase L and 1 all look distinct.
I’m actually using it in my bash shell. It’s beautiful. But now that i know about FiraCode, i’m conflicted..
Editor support
Do not work:
Atom
SublimeText
Intellij Idea
XCode
iTerm 2
OS X Terminal.app
Emacs
gVim, MacVim
Eclipse
So that list makes this font useless to 95% of developers. Personally I use http://www.dyslexiefont.com/ as I find mistakes happen from long camelCase names and colins/semicolins most of the time.
Thank-you.
I would bet that more than 5% of devs using plain vim, which should work, so long as you’re using an appropriate terminal. Still, that font seems like a bad idea to me, it smells of obfuscation, and that is a terrible thing in a programming font.
How is it obfustication? If you are using the font, you know what is going on. If you aren’t using the font, a ‘!=’ is still a ‘!=’.
Us poor Latin alphabet people have had it easy on the text input end that the idea of wyswyg text input is the norm. I know that in many Asian text input systems this form of character replacement is the norm. This is could lead to less mistakes by providing visually unique glyphs for programming idioms
The last time I went searching for a good programming font, that had clearly distinguished oh’s/zeros, ones/l’s/i’s, (semi)colons, and comma/period, I ran across this:
http://tobiasjung.name/profont/
It works down to a pretty small point-size, and is available for multiple platforms in multiple formats.
I use to use this font and still do on anything low resolution as the blockyness makes it more legible. But for daily use it’s a bit brutal.
Here’s a couple of fonts I’ve tried out:
Liberation Mono (My current): http://www.fontsquirrel.com/fonts/Liberation-Mono
Input Mono: http://input.fontbureau.com
Hack: Lined to in the article
And here’s a list of some programming fonts:
http://www.slant.co/topics/67/~what-are-the-best-programming-fonts
I’m a little surprised that Source Code Pro (https://github.com/adobe-fonts/source-code-pro) hasn’t earned any mention. Been using it for a few years now, but I might try out Hack.
They all look terrible to me!
Whatever came as default in debian and nano uses suits me.
Good. Grief. What’s wrong with proper monospaced non-anti-aliased terminal fonts (http://underpop.online.fr/l/linux-console-fonts-for-windows-in-ttf-and-fon/).
Wouldn’t be without the 6×10 for my vim-in-putty ‘Windows’ work desktop…
the zero glyph has a very distinct appearance from the letter O.
That used to be the case for pretty much every pre-GUI computer system, usually with a slash through or a dot in the middle of the zero. Texas Instruments took a different path on their 99-4 and 99-4/A computers. The O and o had square corners while the 0 had the corner pixels left out to make them ’rounded’. (The 99-4 didn’t have lowercase so it was just O and 0.)
For me one of the most annoying font things is when the uppercase I and lowercase l are identical, like with what I’m typing right now. Some even use the same character for the numeral 1.
A pretty nice addition to the C/C++ standard could be to allow UTF-8 source code so that proper UTF-8 symbols could be used instead of , !=, etc. (Although I’m betting that there are non-obvious drawbacks to this which will kill that idea pretty quickly.)
The Ada language has had wide character support for many years. It does look weird to have things like ae ligatures in source code. John Barnes’ book “Programming Ada 2012” has some examples.
I don’t like this feature really because I suspect it means that the font you use in your editor becomes important, especially if certain fonts represent some of the more obscure characters in different ways. Wingdings is not recommended for writing Ada code :)
Input is a great font made for coding. You can customize your font when downloading http://input.fontbureau.com/download/?customize&fontSelection=whole&a=0&g=0&i=0&l=0&zero=0&asterisk=0&braces=0&preset=default&line-height=1.3&email=
I’ve used Dejavu Sans Mono in jEdit for many years, and I just can’t get away from it. The I is different from the 1 and l (haha that was a lowercase L) , the 0 and the O are different, the zero having a dot in the center etc. There really is something to the need of a good font. Some fonts would leave you fatigued after a whole day of looking at it.
The more I study it, the more I realize that Dejavu Sans Mono is nearly identical to Hack.
I would have to admit that those automatic ligatures would extremely annoy me. I tend to be annoyed by things like auto capitalization and auto correct such as that found in word processors. It’s a cool concept, and I’m favorable to anything that makes code more readable so I should give it a try.
One thing I didn’t like about DeJavu Sans Mono is the bold version sometimes (depending on font rendering) had different width with the normal version.
I’m a fan of Inconsolata http://www.levien.com/type/myfonts/inconsolata.html
+1 for inconsolata
The best font for terminal (at least for my eyes) is Terminus. On Debian based systems look for xfonts-terminus package!
Consolas is my pick:
https://en.wikipedia.org/wiki/Consolas
I’ve enjoyed the Anonymous Pro font for programming in the past, and still do on my personal machine. My current employer has our machines locked down so hard I can’t add a font.
I favor MonteCarlo bit map font from http://www.bok.net/MonteCarlo/
It has the same feaures, but is also very dense so I can see more code clearly on my screen at one time.
I’ve been using “Source Code Pro” for a while, and I like it. http://programster.blogspot.com/2014/09/ubuntu-install-source-code-pro.html
Came here to say this. I’ve been using Source Code Pro since the day it came out (showed up on HackerNews pretty much the same day). It’s now part of my dotfiles repo that I distribute to all my machines. Definitely worth the install.
Ah – was wondering if anybody would ever mention this! It’s also been my go-to font for coding since it came out.
+1 For Source Code Pro
I’m surprised no one has mentioned Monoid yet. It’s opne source and has similar features as Fira and more. They also use what the call Monoisome. http://larsenwork.com/monoid/
I have monoid installed for my text editor. Not the most beautiful font, but very readable. And no character confusion.
Nobody mentioned Fixedsys Excelsior yet
It’s a remake with a lot of unicode characters added in.
http://www.fixedsysexcelsior.com/
What’s wrong with the Monospace font?
After doing a quick comparison of monospace fonts already installed on my PC, Hack is pretty much indistinguishable from Source Code Pro and DejaVu Sans Mono. No idea what they were packaged with that brought them to my computer, but they are both free. Lucida Console by comparison lacks the dot in the zero to distinguish it from the letter O, and the lowercase L is slightly less intuitive. They’re all streets ahead of Courier New though.
Well, tried a few of my normal editors and none supported it, but then I tried babelpad and that did.
It’s a freeware (windows) editor focused on unicode support and not a coder editor.. Link for those that do not know it but are curious http://www.babelstone.co.uk/Software/BabelPad.html