Shareware Beach

Monday, 27 November 2006

The Consolas Font for Programmers

Filed under: Software Development — Jan @ 10:04

Windows Vista includes quite a number of new fonts. The Segoe UI font has received a lot of press, as that’s the new default font for dialog boxes, etc. But the Consolas font is the one that’s captured my geeky heart. It’s without a doubt the best TrueType font for programming I’ve ever come across.

Courier New and Consolas are the only two TrueType fonts that have a property that’s vital for programming in a modern syntax-highlighting text editor: they’re not just monospaced, but their bold and plain variants have the same width. This means that columns will always align perfectly when highlighting keywords etc. in bold, without the editor having to squeeze the bold characters or having to stretch the plain characters. Other popular monospaced fonts like Lucida Console and Andale Mono use wider characters for their bold variants. This means they’re only monospaced if you don’t mix the bold and plain variants.

Consolas is a sans serif font, just like Lucida Console, Andale Mono, or Arial for that matter. Most people find sans serif fonts easier to read on the screen. Serif fonts like Courier New or Times New Roman are better suited for print.

But the key benefit of Consolas is that it’s designed for ClearType. ClearType smoothes fonts by anti-aliasing them using pixels of various colors, taking advantage of the physical characteristics of LCD screens. (ClearType looks bad on CRT screens.) I never cared much for ClearType, because many fonts, including Courier New, actually become harder to read when they’re smoothed this way. Consolas, however, looks perfect when rendered with ClearType.

If you’re not using ClearType, then Consolas doesn’t look nearly as good as Courier New. It has too many black pixels that seem out of place. Consolas is clearly designed to be smoothed.

To top things off: the character for the digit zero has a slash going through it!

Consolas ships with all versions of Vista, including Home Basic. The screen shot below shows EditPad Pro running on Vista Home Basic. If you’re using Visual Studio 2005, you can download Consolas from Microsoft. If not, you still may be able to use the font, though your mileage may vary. I was able to install it on a Windows XP SP1 machine that doesn’t have any version of Visual Studio. This PC does have the Microsoft .NET Framework SDK which creates various “Microsoft Visual Studio” folders under “Program Files”. These may cause the Consolas installer to think I do have VS 2005. I got no error messages, and the font was instantly available in all applications. If your PC has an LCD screen (or two), I recommend you turn on ClearType (Control Panel, Display applet, Appearance tab, Effects button, Smooth edges checkbox) and give Consolas a try.

The next free minor update of EditPad Pro will use Consolas by default on Windows Vista.

EditPad Pro using the Consolas font on Windows Vista Home Basic

No Comments

No comments yet.

Sorry, the comment form is closed at this time.