I <3 Steve McConnell*
Coding Horror
programming and human factors
by Jeff Atwood

December 16, 2004

Progamming Fonts

Mike Gunderloy's book Coder to Developer suggests, as part of configuring your IDE, that you explore programming specific fonts. I was intrigued, because I hadn't ever considered that. I've been using Courier New 9 for years. A little searching turned up a few links:

Lists of fonts are all well and good, but a picture is worth a thousand words. Here are code snippets in each font, without ClearType:

Andale Mono 9 point

font_programming_sample_andale_mono_9.png

Anonymous 9 point

font_programming_sample_anonymous_9.png

Courier New 9 point

font_programming_sample_courier_new_9.png

Lucida Console 9 point

font_programming_sample_lucida_console_9.png

Lucida Typewriter 9 point

font_programming_sample_lucida_typewriter_9.png

Monaco 9 point

font_programming_sample_monaco_9.png

Pragmata 9 point

font_programming_sample_pragmata_9.png

ProFont (fixed size bitmap)

font_programming_sample_profont.png

Proggy Clean (fixed size bitmap)

font_programming_sample_proggy_clean.png

Vera Sans Mono 9 point

font_programming_sample_vera_sans_mono_9.png

I'm sure I missed some, but these seem to be the most popular ones. I am not listing a few I tested here and found so heinously bad in these conditions (9pt sans ClearType) that they didn't deserve any consideration.

I learned a few things in this experiment:

  1. I definitely have to have monospace fonts in my IDE. All of the above fonts are monospace.
  2. I don't care for anti-aliasing of any kind on a programming font. That goes for ClearType and plain old AA. Note that some fonts decide to antialias themselves even at 9 point!
  3. Bitmap fonts, such as Proggy, are very precise but don't scale. At all. So if you're programming on a large 1600x1200 or higher screen, that may be a factor. And the scalable fonts can look quite different at larger sizes!
  4. Proggy is my top choice for programming font, but it's fixed size and thus doesn't always work if I'm coding on a 1920x1440 display. If I need a scalable font, I like Lucida Typewriter and Pragmata.
  5. I don't recommend using Comic Sans as your programming font. Nor do I recommend dreaming up all new programming characters.

Posted by Jeff Atwood    View blog reactions

 

« My Database is a Web Service Interactive Xpath Expression Builder »

 

Comments

One tip: I like the built in Microsoft font TERMINAL for the command and output windows. It scales down to 6pt extremely well and fits tons of text in there.

Jeff Atwood on December 16, 2004 01:20 PM

I prefer the Proggy Square variant of Proggy myself, perfect 8pt font.

Funnily enough I also only started investigating something other than Courier after reading Coder to Developer. :-)

Ian on December 16, 2004 01:48 PM

I also stick with Courier New. On a CRT, I was ok without anti-aliasing, but LCD's have such high contrast that I need ClearType to read comfortably. (I hope this makes sense to people who prefer the opposite.)

Chris Lundie on December 16, 2004 05:37 PM

I've tried Lucida Console and some others, but keep returning to Courier New 9. I think it's (partly, at least) the fact that it's a serif font - all the others seem to be sans-serif and they just don't feel right!

Stuart Dootson on December 16, 2004 07:30 PM

> Lucida Console and Courier New remain my top choices for programming fonts

I agree with you. I've tried more than a few other fonts myself, but I still haven't found anything that was better for my eyes than CourierNew or Lucida.

Radi on December 17, 2004 05:06 AM

Thanks for that!

It prompted me to go find Andale Mono, which I like - it reminds me of the font I used to use on the Macs back in school. 'Course, it might have actually been the same one...

TristanK on December 17, 2004 09:30 AM

ther is a ultimate monospace font before consolas:
"lucida sans typewriter" -- a font distributed with java (located in \program files\java\jre1.x.x\lib\fonts)

it has higher x-heights than lucida console, a feature that significantly increases readability.

Veselin Ostojin on August 23, 2005 05:28 AM

Thanks Veselin--

I like Lucida Typewriter a lot. I added it to the list.

Consolas is great but useless unless you have ClearType on (which I never do):

http://www.codinghorror.com/blog/archives/000356.html

I would love to get a copy of Pragmata for evaluation. I'm not against dropping $100 on a font if it's REALLY good and becomes my permanent default.. but I can't tell that without trying it first, and all the font websites have a "no returns" policy.

If anyone reading this has a copy of Pragmata they will loan me for trial, please email me. I swear on scout's honor I'll buy it if it becomes my new default, and delete it if it doesn't.

Jeff Atwood on October 9, 2005 03:34 AM

One feature Courier New has which most "fixed width" or mono fonts don't is that ALL of its variants are the same width as the regular font. Many fonts, like Lucida Console, while monospace, aren't constrained in this way.

I do dislike Courier New and would like to find a mono font that has this property, preferably a sans serif one.

Jan Theodore Galkowski on October 10, 2005 08:15 PM

OK, never mind. I broke down and bought a copy of Pragmata. The jury is still out on this font, but that's definitely $108 I'll never get back :P

Jeff Atwood on October 13, 2005 02:50 PM

Yeah, I'm with those that prefer a serif font.

Haacked on October 15, 2005 01:14 PM

Dude, you are missing one of the best fonts ever. Bitstream Vera Sans Mono.

Christian Romney on October 17, 2005 09:14 AM

I'm an ID10T. Next time, read don't CTRL+F for Bitstream Vera Sans Mono, Christian.

Christian Romney on October 17, 2005 09:16 AM

What about Raize Font?

http://www.raize.com/DevTools/Tools/RzFont.asp

The Raize Font is a clean, crisp, fixed-pitched sans serif screen font that is much easier to read than the fixed pitched fonts that come with Windows. Ideally suited for programming, scripting, html writing, etc., the Raize Font can be used in any IDE or text editor.

The Raize Font supports the following sizes: 10, 12, and 14 points and is available for free.

Jim McKeeth on October 18, 2005 01:50 PM

Hmm. I definitely like that Raize comes in 10, 12, and 14 point. But to my eye it's vastly inferior to Proggy.

Jeff Atwood on October 18, 2005 03:05 PM

http://dp.rastko.net/faq/font_sample.php

for when you really need to track down '`´" 0oO iIl1 problems

simon on October 19, 2005 05:11 AM

Jibz has a very nice hand-edited variant of Proggy he calls "Dina":

http://www.donationcoder.com/Software/Jibz/Dina/index.html

This is definitely an improvement on an already great font. Very highly recommended; there's no reason to use Proggy when Dina is available. And he added 8, 9 and 10 point versions PLUS the bolded () [] versions.

Great job guys.

Jeff Atwood on October 20, 2005 03:40 AM

Jeff, what's the verdict on Pragmata?

Bill Tomlinson on January 24, 2006 03:34 PM

I like Pragmata a heck of a lot at 9 point, but it doesn't scale all that well to larger resolutions. It's a really tall font.

Jeff Atwood on January 24, 2006 03:41 PM

I've just purchased a 20" 1600x1280 TFT display. On my old CRT I used Andale Mono at 9pt for years and was very happy, however I've probably wasted more than 4 hours trying to find a font that will work with this new screen!

Ideally I would like a font that:

* Looks good at sizes 10pt - 12pt, anything else makes very small text at this DPI.

* Has a stroke width of more than 1 pixel at the 10-12pt size. The higher resolution of this screen makes single-pixel-width-strokes look very thin and spidery, especially against a white background.

* Looks good without Clear Type or Antialiasing enabled. I don't mind seeing pixels (they are so tiny now anyway!) because my eyes become fatigued less quickly when the characters are sharp.

I hope someone has a suggestion or two for high-res fonts, but if anyone else is in the same boat, the best thing I've found so far is probably Triskweline 10pt. It still has a 1-pixel strole width, so it's not perfect, but it is quite good.

Rick on March 18, 2006 09:35 AM

I've recently switched to consolas. I find it works well. Needs cleartype though, which I know alot of people don't like. It's a bugger to get hold of too.

[ICR] on March 18, 2006 02:01 PM

I've now had a few weeks to get used to this 1600x1200 resolution. Fonts that render to an adequate height (10 or 11pt) with 1-pixel width strokes still look a bit spidery to my taste, but 2-pixel-width strokes look far too fat and heavy so I've eventually settled on thinner fonts.

Triskweline 10pt is still good but I've found some others I prefer.

Bitmapped: Dina, Ti92Plus, PixelCarnage (a wee bit too much whitespace in this one though).

TTF: Lucida Sans Typewriter, Andale Mono. These are the only two I've found that are scaleable and look OK without antialiasing / ClearType.

I'd love to see how Pragmata looks without antialiasing but there's no way I'm paying that much to try it out!

Rick on April 16, 2006 08:13 PM

Email me directly if you want to try Pragmata.

Jeff Atwood on April 17, 2006 01:10 AM

Pragmata is a great font - I bought Pragmata from the official Fabrizio Schiavi Design website: www.fsd.it for 90 Euro's, which came to about £63. I am glad I spent the money on it as it looks great and has instantly become my new programming font of choice.

I took 5 minutes creating a small Wordpad document showing what Pragmata looks like when it's not anti-aliased at various sizes, please take a look at the following image:

http://i14.photobucket.com/albums/a324/azcn2503/pragmata_example.jpg

I hope this helps you.

Aaron Cunnington on April 22, 2006 04:17 PM

DejaVu mono for IDEs :)
dejavu.sf.net

Dentharg on August 2, 2006 11:50 PM

Who the heck uses non-anti-aliased fonts these days? sheesh! =)

sak on August 13, 2006 05:21 PM

Another vote for Bitstream Vera Sans Mono. Awesome font with Cleartype enabled, not so great without, but i work with cleartype all the time now. Consolas is number 2 in my books.

Mal on September 20, 2006 04:43 PM

That "dreaming up all new programming characters" font is hilarious. it is like the ultimate joke font.

Travis on November 15, 2006 07:18 PM

What's the type of font you see in those Ruby on Rails videos?

Richie on February 8, 2007 06:13 PM

I second the "DejaVu Sans Mono" vote. It's essentially the same as Bitstream Vera Sans Mono, but new and improved.

JMC on February 24, 2007 05:23 PM

I use http://fractal.csie.org/~eric/wiki/Terminus_font

Marshall on March 2, 2007 09:36 PM

I use proggy clean (TrueType, 12pt). C# looks alien in any other font

SealedSun on April 14, 2007 03:29 PM

Any chance of getting Envy Code R @ 10pt ClearType added to your samples?

http://www.damieng.com/blog/archive/2006/12/26/Envy-Code-R-programming-font--preview-available-for-download.aspx

[)amien

Damien Guard on April 26, 2007 06:28 AM

Hmm - Aaron, to be honest I am not that keen on Pragmata, from the demo page. Yes, the high x-height probably makes it more legible in smaller sizes, but it also means it has to have something of the appearance of a compressed font. Look at the lowercase "g" for example - not very pretty. But each to his own!
Although the conventional wisdom is that screen reading is the reverse of paper reading - making sans fonts better for body copy and serifs for headings - I am not so sure. Ol' Courier New may be boring but for me it works...!

John Bonavia on August 5, 2007 09:12 AM

I just use Emacs (and xterm, and Firefox) with a default black on white. My colleagues think I'm crazy for using the tiniest fonts I can get out of my X server on a dual 1920x1600 or some such. That's usually Courier inside Emacs (because it has a tolerable bold) and the very basic 5x9 or 6x10 in the xterms.

I'm kind of divided regarding serifs or not. The serifs in Courier tend to make the text look cluttered (maybe I should artificially add some more space between lines somehow?) but I also do email and documentation in Emacs, and there I vastly prefer legible word gestalts over those skimpy and but crisp individual letter renderings you get with a good sans-serif font.

Thanks for the tip to tweak down the white background to off-white; I did that once upon a time but I've been too lazy to do it across server upgrades etc. Actually in the xterms I start them up with a script which selects a light pastel background color which identifies which server it's running on. ... Time passes ... For Emacs I found (set-face-background 'default "seashell"), the greyish light colors are too close to the window decorations and the other lights are too strong for my taste, but this one is kind of nice.

Speaking of Emacs. Some of the syntax coloring packages I use want to use boldface for some things, so seeing font samples with a mixture of bold and plain would be nice. (Italics / oblique, too, I guess, although I've zapped those oblique styles where I have come across them, notwithstanding that I had basically decided to stop tweaking my settings.)

era on September 19, 2007 11:07 AM

I use Fixedsys. Classic.

http://en.wikipedia.org/wiki/Fixedsys

Zack on September 21, 2007 12:26 PM

Terminus ++

Also check out artwiz' smoothansi. Not so standard of a look, but I like it for some reason while programming and general terminal usage.

codemac on October 4, 2007 05:56 PM

i can't believe nobody has mentioned triskweline.

http://www.netalive.org/tinkering/triskweline/

i switched my environment (gray-on-black, mild syntax highlighting, vim) to it and never looked back.

it's a bit larger than the usual suspects which makes just right it for my 1920x1200 dell. might be too small for larger resolution but there's still the ttf version...

moe on October 4, 2007 07:23 PM

Font: Monaco, Consolas or Bitstream Vera Sans Mono.
Colorscheme: http://www.vim.org/scripts/script.php?script_id=1732

Radu on October 18, 2007 01:52 AM

Have a look at Terminus
There are .fon versions of it (or at least you can make them from the package) but each variant is a seperate file...

It is available in 6x12, 8x14, 8x16, 10x20, 12x24, 14x28 and 16x32.


The guy who made it:
http://www.is-vn.bg/hamster/jimmy-en.html
True Type versions:
(really bitmap, but inside a TrueType font, note not pseudo bitmap, there's no vectors)
http://chlamydia.fs.ei.tum.de/~corecode/unsorted/Terminus.ttf
http://chlamydia.fs.ei.tum.de/~corecode/unsorted/TerminusBold.ttf

Spudd86 on November 22, 2007 09:39 AM







(hear it spoken)


(no HTML)




Content (c) 2008 Jeff Atwood. Logo image used with permission of the author. (c) 1993 Steven C. McConnell. All Rights Reserved.