Thursday, August 30, 2007
Debates about the fonts and colors that programmers use tend to get out of control very quickly. While studies on the readability and eye fatigue of various font and color schemes exist, it very much remains a matter of personal preference. However, one detail that many programmers seem to agree on is that the default scheme presented by Visual Studio is less than ideal. Standard 10 point Courier New is simply difficult for most people (at least most people that care about this sort of thing—except Rick Strahl) to look at all day.

VS 2005 Default with ClearType

A common solution—especially for high-resolution displays—is to increase the font size in the editor. Personally, I'm a big fan Microsoft's Consolas font, and as Scott Hanselman points out, I really feel that it looks best at 15 point.

VS 2005 with Consolas and ClearType

This is well-covered territory in the blogosphere, but I want to discuss a point that frequently is overlooked. While many of us strive for the perfect font and color scheme in the text editor, we neglect the opportunities for improvement in other windows. For example, I may feel good about using 15-point Consolas to decrease my eye strain, but I haven't done anything to improve my experience with IntelliSense.

VS 2005 Intellisense

(Public speakers are often the biggest culprits of this. Helpful presenters will increase the size of their editor font, but few will adjust other areas such as IntelliSense, debugging windows, etc.)

Fortunately, Visual Studio 2005 makes changing the fonts and colors of much of the IDE easy. The "Show settings for" combo box on the Fonts and Colors page of Visual Studio's Options dialog provides the ability to customize many areas of the IDE, in addition to the text editor. For example, the default font setting for the statement completion window is definitely too small when compared to the 15-point font size that I use in the text editor.

Statement Completion options

One simple trick to improve the readability of the statement completion window is to use exactly the same font and point size as the text editor. Logically, if I'm searching for a class or method name in IntelliSense, it might be easier to find if it looks exactly like it will when inserted into the text editor.

IntelliSense with Consolas

A similar effect can be achieved by adjusting the font of the editor tooltips. Compare the default setting...

Editor Tooltips

...to the adjusted one.

Editor Tooltips with Consolas

Other good candidates for similar adjustment are:

  • DataTips – These are the cool expandable tooltips that appear when identifiers are moused-over in debug mode. Making these easier to read is a must.
  • [All Text Tool Windows] – This is actually a font and color group that controls several settings. When selected, any adjustment made affects the Command, Disassembly, Find Results, Immediate, Memory, Output and Registers windows.
  • [Watch, Locals, and Autos Tool Windows] – As the name suggests, this group handles adjustments for the Watch, Locals and Autos windows.

Remember: when your goal is to improve readability and reduce eye fatigue, adjusting the font in the text editor isn't enough. Pay attention to the font in all areas of Visual Studio.

posted on Thursday, August 30, 2007 1:15:54 PM (Eastern Standard Time, UTC-05:00)  #    Comments [6]

kick it on DotNetKicks.com
Thursday, August 30, 2007 1:52:15 PM (Eastern Standard Time, UTC-05:00)
how strange, i find the default courier new 10pt to be too big and always reduce it to 9!
gareth jones
Thursday, August 30, 2007 2:05:47 PM (Eastern Standard Time, UTC-05:00)
Yeah, I knew that I would get in trouble right away for saying "most people." :-)

The truth is, people have different agendas. For example, some people prefer to simply fit more on screen. In addition, differing monitor resolutions and sizes come into play. 9 pt Courier New is ridiculously small on my monitor.
Thursday, August 30, 2007 3:38:31 PM (Eastern Standard Time, UTC-05:00)
Another thing that can be done to improve the legibility of code on the screen is to abandon fixed-width fonts, entirely, as argued in Section 1.1.1 of Bjarne Stroustrup's/The C++ Programming Language (Special Edition).

Fixed-width fonts are (essentially) a vestigial organ of the days when our computers and printers could *only* display fixed-width fonts; numerous studies have shown that a well-designed variable-width font is easier to read than a fixed-width font in any context and on a computer screen, that sans-serif fonts are generally easier to read than serifed fonts.

It feels incredibly weird when one first switches to a variable-width font for reading code, but most people adjust to it quite quickly. If you're serious about reducing eye-strain, I highly recommend that you give it a shot. Most of my colleagues use Verdana, while I prefer Calibri.
Thursday, August 30, 2007 5:22:30 PM (Eastern Standard Time, UTC-05:00)
I started using this a while ago and I really like it. Specifically like how lowercase "L" is very distinguishable from the number one (1):

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



Thursday, August 30, 2007 11:04:34 PM (Eastern Standard Time, UTC-05:00)
Good tips, thanks, Dustin! I hadn't taken advantage of changing the size of Intellisense and the other items you mentioned other than the basic editor text size.

Another place to change display settings that affect Visual Studio is in Windows itself. I increased the size of the font used in Visual Studio's menus, among other things, here (in Windows XP): Control Panel | Display | Appearance tab | Advanced, then on the Advanced Appearance tab that appears, go through the items in the Item dropdown, and for the ones that have a font size setting (the Font Size dropdown on the dialog will become enabled), set the font size to your liking.

(Even though there is text on the Advanced Appearance dialog that warns that settings won't affect newer applications if you have a "windows and buttons" setting other than Windows Classic selected, my Windows XP is set up to use the default Windows XP style, and settings on the dialog take effect anyway. *shrug*)

I'm also a member of the "dark background" faction -- I prefer a dark blue page background rather than the default bright white. Unfortunately, getting that set up is much more involved as far as setup than changing the font face or size; once I've set my dark blue background, I need to go through and change *all* of the foreground colors settings to light colors rather than dark colors. At least it only needs to be done once!
Friday, August 31, 2007 10:09:45 PM (Eastern Standard Time, UTC-05:00)
"The truth is, people have different agendas. For example, some people prefer to simply fit more on screen. In addition, differing monitor resolutions and sizes come into play. 9 pt Courier New is ridiculously small on my monitor."

Actually, that means that you and most people have your display settings set incorrectly. 9pts means a physical real size in the real world. Remember point size on typewriters? Set your DPI settings to what they are in the real world. Yes, get out a ruler and measure the display that windows gives you for a custom DPI setting.

I prefer my consolas at 6pts on my 148 DPI laptop display. I'm always sitting very close to the screen. Thank you very much.

I also have better than 20/20 vision, so maybe that is part of it.
Comments are closed.