
Collection of the best fonts for programming - hbbio
http://slant.co/topics/67/~what-are-the-best-programming-fonts
======
yareally
I'm surprised Liberation Mono[1][2] (similar to the Deja Vu font) is not on
the list or the bitmap font, Dina[3]. I end up using Liberation Mono much more
nowadays (which is similar to Dina), since bitmap fonts don't have support in
a lot of development tools and Dina has no real UTF-8 support. However, Dina
was my first real "programming font" I used and still love it where I can use
it.

[1] <http://en.wikipedia.org/wiki/Liberation_fonts>

[2] <https://fedorahosted.org/liberation-fonts/>

[3] <http://www.donationcoder.com/Software/Jibz/Dina/>

~~~
StuieK
Hey man, feel free to add it! (the entire site is collaboratively written)

~~~
yareally
Will do :)

I just found it surprising no one else had added them already.

------
hmottestad
My favorite is Verdana.

Yes. A proportional font for programming. In the beginning I hated tabs and
white space, until I just got used to it. Now it's much easier to read my own
code. Words jump out of the text because spaces are spaces and "i" doesn't
make me doubt for a split second where the word starts and ends.

~~~
alcuadrado
Interesting, but how do you know if you passed the column 80? how do you work
when the coding standards mix tabs and spaces (like tab for indenting, spaces
for multi-line aligning)?

~~~
Stratoscope
Those are coding standards designed for monospaced fonts. They work poorly
with proportional fonts, but there is a simple solution: abandon those
standards.

With regard to indenting vs. column alignment, don't do column alignment. Code
is an outline. It's not a spreadsheet. Column alignment is not beneficial in
most cases, and it wreaks havoc with source control diffs. Is it really better
to code like this:

    
    
      double someFunctionName( int                 index,                 // counts things
                               SomeType            secondParamWithStuff,  // fancy object with stuff
                               SomeLongerNamedType third )                // whatever
    

instead of this:

    
    
      double someFunctionName(
          int index,  // counts things
          SomeType secondParamWithStuff,  // fancy object with stuff
          SomeLongerNamedType third  // whatever
      )
    

Now sure, the second version may look a bit sloppy if you're used to the
first, but it has several real advantages:

* Much less horizontal eye movement

* No eye tracking across wide swaths of whitespace

* Changing one name doesn't require reformatting the whole thing

* Since you don't have to reformat, it doesn't generate unrelated diffs

* It works equally well in proportional or monospaced fonts

Oddly enough, many years ago I switched to the second style, not because I was
using a proportional font at the time, but because I was _really_ tired of
reformatting multiple lines of code just because I'd refactored one variable
or type name.

And then some time later I tried a proportional font. My code looked fine in
the proportional font, and it was still just as readable in a monospaced font.

WRT 80 columns or whatever your limit is, I just don't worry about that. I
generally keep my lines quite a bit shorter than that, but if a particular
piece of code is more readable with a longer line, I don't sweat it.

~~~
jussij
> Code is an outline. It's not a spreadsheet. Column alignment is not
> beneficial in most cases

But there are many cases where code works best as a spreadsheet.

For example any time you need to initialise an array of structures, that is
best viewed using a grid like pattern.

> but because I was really tired of reformatting multiple lines of code just
> because I'd refactored one variable or type name. Any decent editor with
> smart indenting should eliminate most of that effort.

Also if the editor is scriptable editor, it should be possible to create a
simple script to semi-automate the task.

~~~
Stratoscope
> But there are many cases where code works best as a spreadsheet.

Indeed, that's true, and I don't mean to be _too_ much of a proportional font
fanatic. Even if I try to avoid coding styles that require monospaced fonts to
be readable, there are always cases where it helps to get a monospaced view of
the code.

One feature I really like in an editor is an easy way to switch between
proportional and monospaced views. The best support I've seen for this is in
Komodo [1]. Like many editors, Komodo supports multiple themes of font
face/size/colorization/etc. What it does differently, though, is that each
theme has _two_ font selections, a proportional font and a monospaced one. So
you can pick your favorite for each, and then choose whichever works best for
the particular code you're looking at right now.

Oddly enough, out of the box Komodo doesn't give you a keyboard shortcut to
switch between proportional and monospaced, but it's easy enough to add a
keyboard shortcut for this. (In the Key Bindings dialog, look for User
Interface: Use Fixed/Proportional Font.) I have this set to Alt+O which is
unused in a default Komodo installation on Windows, and it's easy to remember
because "proportional/monospaced font" has a heck of a lot of "O"s in it. :-)

But when I do use an editor that only offers monospaced fonts, it's not a
terrible thing. I use your excellent Zeus IDE [2] for my Go coding and it's a
pleasure to work with. Sure, I miss my proportional fonts, but having the
integrated debugger and other goodies for Go makes it well worth it.

[1] <http://www.activestate.com/komodo-edit>

[2] <http://www.zeusedit.com/>

~~~
jussij
> I use your excellent Zeus IDE [2] for my Go coding and it's a pleasure to
> work with.

Funnily enough I'm the author of the Zeus editor. Glad to read you like using
it :)

> Sure, I miss my proportional fonts, but having the integrated debugger and
> other goodies for Go makes it well worth it.

Over the years many Zeus users have asked for _proportional fonts_ so you’re
not the only user who misses them.

The reality is many years ago, Zeus was designed with only mono-spaced fonts
in mind.

At that time, the simple rule of knowing all characters are the same width and
height seemed to greatly simplify the design of the editor.

And once that design decision was made it's amazing how many places in the
editor code that rule then ends getting coded, making it very difficult to
change :(

Given the time again I think the underlying design would be different.

~~~
Stratoscope
Ah yes, I know how that goes. Very hard to undo a fundamental design decision.
Well, proportional or monospaced, Zeus is great either way. :-)

------
shakesbeard
Recently switched from Consolas to Bitstream Vera Sans Mono. Has been a good
experience so far.

<http://i.imgur.com/qNlpYvn.png>

<http://www.dafont.com/bitstream-vera-mono.font>

~~~
georgebashi
There's a fork of Bitstream Vera called DejaVu, which adds support for a huge
range of characters:

<http://dejavu-fonts.org/wiki/Main_Page>

~~~
lobster_johnson
+1. That has been my perfect mono font for the last 1-2 years.

------
osener
My favorite fixed-width font is Akkurat Mono. It is by far the best font I've
ever used but unfortunately it is quite pricey.

Here's how it looks on my system: <http://ozansener.com/images/github-browse-
file-1.png>

Homepage:
[http://lineto.com/The+Fonts/Font+Categories/Text+Fonts/Akkur...](http://lineto.com/The+Fonts/Font+Categories/Text+Fonts/Akkurat+Mono/)

~~~
lobster_johnson
Looks almost indistinguishable from DejaVu Sans Mono [1]. Screenshot here:
<http://i.imgur.com/MYB1i5N.png>

[1] <http://dejavu-fonts.org/wiki/Main_Page>

~~~
osener
IMO they are far from indistinguishable (maybe you are thinking about Menlo?).
I find Akkurat Mono more pleasant to use. DejaVu Sans Mono looks too dense
compared to Akkurat Mono's softer looks.

Here is a side by side comparison: <http://cl.ly/image/1j030D031g0U/o>

Since people seem to care about it, I should also note that it has a nice
slashed zero you can see on line 6 which I prefer to DSM's dotted counterpart.

Edit: Here's how it looks like when I adjust DSM's line-spacing to match
Akkurat Mono's default, it still has that busy look:
<http://cl.ly/image/1z3Z393x1s3l/o>

~~~
lobster_johnson
Busy look? Akkurat Mono is simply more squat and tight; look at the "a" and
"e", for example. For me, it gives a gnarly, squinting kind of look
reminiscent of Courier New, compared to Deja's more rounded openness.

Here's an animation comparing them (Deja is the bigger one, Akkurat the squat
one): <http://i.imgur.com/lkOzDWN.gif>

I really dislike Akkurat's bloated commas and semicolons, the exaggerated "+"
(which has not enough spacing, either), and the shallow braces are not good,
they look like parantheses.

The only thing I like about Akkurat, I have to say, is the less classical "&".
Deja uses the "et"-style ampersand, which looks unfinished at the kind of code
sizes used for programming.

But each to his own, I guess.

And that slashed zero is an Ø [1], my friend, not a zero. :-)

[1] <http://en.wikipedia.org/wiki/Ø>

~~~
osener
Fair points all around (though I disagree with all of them except "+" being
exaggerated). DejaVu's characters are a bit too tall for my taste, a clear
example of this is the oval 'o' character. I also like to have a pronounced
difference in the height of lower case and upper case letters.

Since we are doing character by character comparison I find "="s of DejaVu too
wide (which causes "===" to look bad). It's "<" and ">" are too tight which
makes it look bad when used as angle brackets. Backticks are slimmer, lower
case "L" looks out of place and (apparently) it doesn't have an italic "*" (I
don't know if Akkurat Mono is supposed to have it but it looks nice).

I don't get the point you are trying to make about slashed zeros.
<https://en.wikipedia.org/wiki/Slashed_zero>

It all boils down to personal preference, thanks for stating yours :). You
might also like Liberation Mono, which is my second favorite.

~~~
lobster_johnson
I guess you pinpointed one reason I like Deja so much: The x height of its
lowercase letters is slightly higher than the median line.

In other words, the x height is higher than the middle stroke in capital "E"
(or "F", "A", etc.). The reason I like this is because code uses mostly
lowercase letters (unless you write COBOL), and if you keep the x height
classically aligned, the font ends up looking squat and gnarly, like Akkurat.

Deja exaggerates the x height by (in display terms, at the point size that I
use) two pixels, which evens it out and "fills out" the line height more
nicely, making for a more harmonic flow, even though this also means the
middle strokes of some capital letters don't line up with the tops of the
lowercase letters. (This is not a violation of typography rules, by the way.)

Fonts like Akkurat, with classical x heights, look more sparse because lines
with only lowercase letters leave more room above the x height, and the
difference in height between lower and upper case is more pronounced.

Anyway.

I agree that Deja's angle brackets are a bit too angled. Akkurat's is better.

The problem with Deja's "=" is not the length but the spacing. It has the same
spacing issue as Akkurat's "+".

However, I categorically reject your criticism of Deja's lower-case "L". It's
perfect because it looks precisely like the character L, whereas Akkurat's "l"
looks like the number 1. (It's also consistent with the overall shape of the
font, matching the arcs in characters such as f and j.)

I was jesting about the 0/Ø. I don't care whether there is a center dot or a
slash myself.

Looked at Liberation, but it's not for me. Too... squished.

~~~
osener
> The problem with Deja's "=" is not the length but the spacing. It has the
> same spacing issue as Akkurat's "+".

Doesn't it become a length problem when we are talking about a fixed-width
font though?

Thanks for elaborating, you obviously know more about typography than I do! I
don't have much reasoning behind my choice of font apart from personal taste.

I just took another look at Liberation Mono for the first time in years and it
is eerily similar to Akkurat Mono which probably explains why I like both of
them so much.

~~~
lobster_johnson
> _Doesn't it become a length problem when we are talking about a fixed-width
> font though?_

When drawn on its own with a space before and after, the length itself is not
the problem, but of course in a monospace font, character_spacing =
(character_width - actual_width_of_glyph), so you are right in that respect.
Semantics. :-)

------
platz
When did Monaco fall out of favor? What don't people like about it? I kind of
like it's angularity.

~~~
peterhil
These newfangled Mac OS X users have not used it enough to appreciate it’s
pixel-perfected beauty. I’ve been using it as my monospaced font of choice
since 1996 when I started to use Macs.

------
brianpgordon
These have some poor screenshots. Compare their Terminus screenshot with mine:

<http://i.imgur.com/4NhZ3h2.png> <http://i.imgur.com/yaCGIWG.png>

~~~
qu4z-2
Agreed. As someone who uses Terminus I opened the link and said "What?! That's
not what Terminus looks like!"

------
danjessen
Currently use Pragmata Pro ... It's different, and thats proberbly why I'm
trying it out for a while.

I use it with Sublime Text 2 and the scheme called Big Duo

<http://cl.ly/image/3M413B322I1O>

------
b3b0p
On Windows I have been using Envy Code R

[http://damieng.com/blog/2008/05/26/envy-code-r-
preview-7-cod...](http://damieng.com/blog/2008/05/26/envy-code-r-
preview-7-coding-font-released)

or Source Code Pro

<https://github.com/adobe/source-code-pro>

On Mac, I use Source Code Pro or Menlo.

~~~
PavlovsCat
I'll second Envy Code R; I use it in bold for better readability at small
size.

------
n1c
As a lover of Inconsolata I never felt the 1/l was all that similar (re:
Inconsolata-g).

~~~
itafroma
The 1/l distinction isn't that bad, but the curved quotation marks and
apostrophe were enough to warrant a variant, Inconsolata-dz[1]. Looks like
Inconsolata-g is actually built upon the -dz variant because it includes the
straight quotation marks and apostrophe.

[1]: [http://nodnod.net/2009/feb/12/adding-straight-single-and-
dou...](http://nodnod.net/2009/feb/12/adding-straight-single-and-double-
quotes-inconsola/)

------
oofabz
I like serifs so I use Luxi Mono. It used to be the RedHat console font and it
was inspired by the Sun console font. On Debian it's in the ttf-
xfree86-nonfree package.

~~~
mbq
+1 For Luxi Mono; technically it is terrible for programming (0&O and 1&l
pairs look almost the same), but I'm somehow addicted to it. So I really hope
one day someone will make open source "Luxi Mono-g" clone...

------
cpeterso
If you'd like to see tiny fonts taken to the extreme, check out "The Bee’s
Knees", a font with x-height of 3 pixels but surprisingly legible because it
uses subpixel rendering:

<http://www.sitepoint.com/two-teeny-tiny-fonts/>

------
walshemj
Why do none of them have slashed zeros and german style 7's and Z with a slash
which are 3 things I want in a font designed for programming.

~~~
igravious
What's so important with having slashes on 7s and Zs?

~~~
kd0amg
I do it in handwriting to make them easier to distinguish from 1 and 2, though
in typed text, they tend to look different enough for me.

------
herge
Nobody has mentioned mensch! (<http://robey.lag.net/2010/06/21/mensch-
font.html>) Mostly like Menlo except with really big angled brackets and a
more conventional l.

~~~
Splendor
Those giant angle brackets make lambdas look too weird for me.

------
dschuler
The instructions for the Consolas font on Mac OS include downloading an Office
update for Mac and extracting the font. I just realized that I already have
the font installed, since I also have a copy of Office installed :)

------
chj
I used Inconsolata and thought I would never switch again. Now I am finding
myself using Ubuntu Mono. It's not that Inconsolata is bad or something, I
guess you will get bored anyhow after one or two years.

------
edwintorok
My favourite is Linux Libertine Monospaced, available since v5.3.0:
[http://www.linuxlibertine.org/index.php?id=2&L=1](http://www.linuxlibertine.org/index.php?id=2&L=1)

You can try it out if you select Monospaced from the dropdown here:
[http://www.linuxlibertine.org/index.php?id=86&L=1](http://www.linuxlibertine.org/index.php?id=86&L=1)

Other than that from that list of fonts, Source Code Pro looks quite good too.

------
jongold
Offbeat suggestion (and definitely not free or readily available) - LineTo
Akkurat Mono. I've always been a little bit obsessed with monospace type &
this is definitely my favourite. I use it in Sublime, Vim & iTerm 2 - hate
using Macs that don't have it installed.
[http://lineto.com/The+Fonts/Font+Categories/Text+Fonts/Akkur...](http://lineto.com/The+Fonts/Font+Categories/Text+Fonts/Akkurat+Mono/)

------
reillyse
The site needs to make it clearer which font is the best, it looks initially
like it's a countdown from 50 of the best fonts (the second font has 49) and
then when I get to the bottom there is a ton of them on 0 so I presume now
they are votes.. pretty confusing

~~~
subsection1h

        The site needs to make it clearer which font is the best
    

There is no best font.

------
hfz
So I browsed around for a free alternative of Nitti, most popularly known as
iA Writer's font. Someone recommended an alternative: Cousine.
<http://www.fontsquirrel.com/fonts/cousine>

It's my new favorite now.

------
rbanffy
I still prefer the 3278 feel of <https://github.com/rbanffy/3270font> (which
is why I did it).

Love the retro touch it gives my terminal. Now, if only Gnome Terminal
supported phosphor persistence...

~~~
qznc
He lp, the kerning in your eva lua t ion screenshot looks terrible. I prefer
other Op t ions. ;)

~~~
leephillips
It's a fixed-width font. It doesn't have kerning.

------
adregan
It's not free, but iA's writer got me hooked on Nitti:

<http://www.boldmonday.com/en/nitti>

I love working in that typeface and have it set to default in Sublime Text and
Terminal.

------
Freaky
You'll claw Misc Fixed SemiCondensed 6x13 out of my cold dead hands. Nothing
beats a good bitmap font for crisp rendering at smaller sizes.

<http://i.imgur.com/afWazoB.png>

<http://en.wikipedia.org/wiki/Fixed_(typeface)>

<http://www.cl.cam.ac.uk/~mgk25/ucs-fonts.html>

<http://www.twoevils.org/html/files.html> (TrueType version)

------
q_revert
moved around a fair bit between DejaVu Sans Mono/Inconsolata/Consolas etc
before eventually settling on Ubuntu Mono, which really holds up extremely
well at smaller sizes (7/8 pt)

------
rhengles
It's a shame Lucida Console is at last position, I like it a lot.

~~~
eterm
Really this site should have randomised the order in which the font samples
appear.

Right now, votes are directly influenced by page order, which I suppose is
indicative that people don't feel strongly about their fonts.

~~~
T-R
Thanks for the feedback!

We'll definitely be iterating on how we rank and present viewpoints to try to
reduce bias. We don't want to remove indicators of popularity entirely,
though, since that would reduce the utility of the site for readers who are
still trying to decide. We do intend, though, to at least provide enough
information for users to judge where there may be bias for themselves, and
we'll try to eliminate it where we can.

------
wahnfrieden
Menlo

------
jimmahoney
Anonymous Pro

------
StuieK
Site is getting hugged to death by you guys, working on getting it back up.
Sorry!

------
antihero
Can't do without Tamzen. An efficient use of pixels, and big enough for me to
read.

If you have even a mildly decent display (1920x1080 at 15.6"), pixel fonts are
beautiful and readable.

------
ryanhorn
Awesome, I've been looking for something like this. Would be even more awesome
if the fonts were embedded with a syntax highlighted editor ;)

------
chiph
ProFont wasn't mentioned. It's a monospace truetype font designed to look it's
best at 9 points size, so you get more code on the screen.

~~~
creaktive
Just added the ProFont: [http://slant.co/topics/67/viewpoints/29/~what-are-
the-best-p...](http://slant.co/topics/67/viewpoints/29/~what-are-the-best-
programming-fonts~profont)

------
account_taken
Why did he color certain characters? It makes those chars standout which
defeats the purpose of choosing a font for distinct shapes.

------
flyinglizard
I'm using a font called zevv-peep, like it a lot.

<http://zevv.nl/play/code/zevv-peep/>

------
kurrent
I'd like to mention the font ProggyClean. After trying several fonts, this was
the winner for me.

------
bliker
I think it is worth mentioning that font-smoothing can be a great improvement
on windows.

------
fernly
So which of these have a good complement of Unicode points?

~~~
fernly
So to reply to my own question, a minimal standard would be the first four
code blocks, plus Greek, math operators, and box drawing symbols. Anonymous
Pro and Andale Mono reach this standard, Inconsolata doesn't.

A higher standard would be Menlo and Courier New, both having all those plus
the Greek Extended (with accents), Cyrillic, Hebrew and Arabic sets, and a
mess of other symbols. Deja Vu Sans Mono is missing the Hebrew, at least the
version I have, but adds a bunch of dingbats and miscellaneous symbols.
Everson Mono (not mentioned in the subject article and not a great programming
font) has even more, all the odd-ball language support like Lao and Gothic.

Edit after checking the others mentioned: Only Menlo, Courier New, and
Liberation Mono have Hebrew, a bit of a surprise given how much software is
done in Israel. Those three have the largest complements of glyphs, and
Liberation Mono is open and free.

------
rshm
no mention of liberation mono here. I find it like verdana of monospaced
fonts.

<http://i.imgur.com/ejCs0nG.png>

------
Marazan
monofur for life. It's a pretty quixotic font but I haven't seen one that has
better clarity of distinguishing between characters as it.

------
alcuadrado
11pt in the demos? Real programmers use 10pt!

------
codex
No Pragmata or Akkurat Mono? Amateurs.

------
alexvr
Consolas & Monaco <3

------
Qantourisc
Warning: after clicking on vote you get a facebook-login pop-up.

------
the1
i thought better fonts make me a better programmer. i was wrong.

------
drivebyacct2
Source Code Pro looks way, way better on my machine. I hate what Macs do to
fonts. <http://i.imgur.com/DRywIsw.png>

