Monday, April 19, 2010

Programming font for VS2010

So, Visual Studio 2010 shipped. Now I have a problem: what font to use? My old standby, Dina, is a bitmap font so it doesn't work with the WPF text editor in VS2010.

Some things I look for in a programming font:

  • High information density - vertical height in particular. For example, I use Dina at 8pt.
  • Crisp, even lines
  • Strong distinction between bold and regular (for lexical highlighting)
  • Clearly unambiguous letters: l,1,0,O, and the like.
  • Balanced operators - good placement for <, >, {, }, etc.

Here's Dina 8pt in VS2008:

Here's Consolas at 8pt in VS2010:

(At least, I think that's 8pt. I have zoomed the editor in and out a little with Ctrl+Mouse Wheel, but there doesn't seem to be a zoom reset...

Here's Consolas 9pt in VS2010:

Consolas is quite constrained on the horizontal. It looks horrible at 8pt, and is still slightly taller than Dina 8pt. Even at 9pt though, to my eyes, it suffers quite badly with comparison to Dina. The bold of the comment and digits is almost unnoticeable. 'M' and 'm' are very weak, probably because of the narrowness. The vertical on the 'F' of 'Func' is weak, as is the vertical on 'r'. These are in part properties of ClearType subpixel rendering, which looks slightly different from monitor to monitor and depending on configuration, but even with the configuration selected for its heaviest rendering, it looks poor on my system. Overall, the effect is washed out and slightly blurry.

Proggy Fonts are another contender. These have TTF hinted versions of what amount to bitmap fonts, so they try and sneak older rendering in through the back door. Here's Proggy Clean Slashed Zero with Bold Punctuation (Visual Studio can bold operators (and I do - and make them white, to stand out even more), but it doesn't include [], {}, () as operators, unfortunately):

This is probably the most palatable option for me, but it's still not quite as good as Dina. It's the same height, probably because Dina was based on Proggy; but the things I don't like about it most are things that Dina fixed, in particular the oddly elongated < and >, the lazy looking 's', and the "gappy" look of the bold - contrast the comment in Proggy vs Dina. Other differences incude the leg on the 'R' and the general way the capitals are slightly overly broad. Another oddity is however ClearType has interacted with its hinting, the font has ended up tinted with green.

Proggy Clean SZBP is the font I'll stick with for the moment, until I see a better option, or a better translation of Dina to TTF than this one, which is tuned for 10pt Dina, not the size I use.

16 comments:

Anonymous said...

I'm using DejaVu Sans mono (look here: http://dejavu-fonts.org ). Ok i'm using 10pt, but even in 8pt it's worth a look, i think :-)

Bye, Peter

Anonymous said...

You might like Sheldon; but for me, 12pt Consolas.

David Heffernan said...

I can't take Consolas in anything less than 11pt. Mind you I'm using Delphi 6 so I'm not sure how that differs in its rendering from VS2010.

Steven said...

As a side question, what font do you use with Delphi 2010? (I'm currently using ProggyClean)

Barry Kelly said...

I use Dina for all programming, including Delphi, terminal windows, text editors, etc.

Xepol said...

Jeff Atwood has a good set of screenshots at

http://www.codinghorror.com/blog/2007/10/revisiting-programming-fonts.html

And there are a pile of fonts listed at

http://keithdevens.com/wiki/ProgrammerFonts


But any search for the terms [programming font] should turn up a million people saying programmers are need very specific things out of fonts, and then only agree that new courier is ugly - after that there is zero consensus.

After trying all the fonts each time this comes up, I keep coming back to new courier - although Raize might get a fair look this time!

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

Javier said...

Same here, Dina rocks, and when I must choose a TTF I usually end with Consolas.

Warren said...

I like EnvyR:

http://damieng.com/blog/2008/05/26/envy-code-r-preview-7-coding-font-released

Anybody who needs to telnet/ssh into a unix/linux box and use miniterm, or edit/compile ancient Pascal-for-dos will appreciate the dos-style line-drawing characters. Can your font do that? :-)


W

Foersom said...

I use Lucida Console size 9. I selected that one back in the days of Win NT4, mainly because it was the best of the standard Windows font ;-).

Jolyon Smith said...

BitStream Vera Sans Mono FTW!

http://www.gnome.org/fonts/

Unknown said...

May I suggest Anonymous. I tried it a few years ago, and now I swear by it.

http://www.ms-studio.com/FontSales/anonymouspro.html

stanleyxu (2nd) said...

DejaVu sans mono is recommended for Linux. It renders different (ugly) in Windows. Consolas 10px is my choice. I am sure, you will love it sooner or later

Unknown said...

RE zoom level, in the lower left corner of the code window in VS 2010, I have a small dropdown list showing the current and available zoom levels. It looks similar to the zoom dropdown list in the lower right corner of IE.

Unknown said...

I use Liberation Mono.

Eduard said...

I use this Dina TTF variant in VS2010 and SharpDevelop 4 at size 8:
http://chrisrickard.blogspot.com/2010/03/dina-font-for-visual-studio-2010.html

Leus said...

Of course everybody is wrong, except those of us who use Monaco.