Text clarity in Visual Studio 2010 has been a hot topic throughout the product cycle. Each time we talk or write about it, we seem to invite yet another round comments, some of them quite emotionally charged. We take such feedback very seriously because, whether the comments are completely justified or not, there’s always some nugget of customer discontent at the heart of it. So, risking the same result here, I want to tackle the topic one more (last?) time.
Turning off ClearType
Following Brittany’s post earlier in the week regarding improvements we’ve made to ClearType text clarity in time for Visual Studio 2010 and .Net 4 RTM, several people indicated in the comments that they would rather not use ClearType at all. I was going to reply in the comment stream, but a full response needs some pictures and more space than the comments would allow.
To address Brian Henry’s comment directly, Visual Studio 2010 uses WPF 4’s TextRenderingMode.Auto setting; or rather – it doesn’t change the default. This means that, if you turn off ClearType for your desktop, then Visual Studio 2010’s text will respect that choice. ClearType is designed for LCD screens and other flat panels which arrange their pixels in vertical stripes of red, green and blue. It’s not ideal for CRTs or for displays with different pixel geometry, for example a rotating flat-panel display that is turned to portrait mode. Apart from that, some people (perhaps between 5% and 45%) simply prefer non-ClearType rendering, even if their display supports it.
Adjust font smoothing on Windows XP and Windows Vista
On Windows XP and Windows Vista, ClearType may be turned off by first going to the Display Properties settings from the Control Panel. Select “Appearance” and click “Effects…” and uncheck the box that says “Use the following method to smooth edges of screen fonts:”.
Note that there are three settings: No font smoothing (unchecked), Standard font smoothing and ClearType. Click OK when you have made the selection and then Close the Display Properties dialog to apply the new setting.
ClearType Tuner and Visual Effects option on Windows 7
In Windows 7, you can turn off ClearType using the built-in ClearType Tuner. Type “ClearType” into the Windows search box and select “Adjust ClearType text”:
On the first screen, uncheck the box that says “Turn on ClearType”
Run through the rest of the ClearType Text Tuner Wizard and now Visual Studio 2010, and other applications, will use standard anti-aliasing instead of ClearType for text rendering. To turn off font smoothing entirely, you need to dig a little deeper. Type “Appearance” in the start menu and select “Adjust the appearance and performance of Windows”:
On the “Visual Effects” tab of the “Performance Options” dialog, scroll down to “Smooth the edges of screen fonts”, uncheck it and click “OK”.
You shouldn’t need to restart Visual Studio 2010 for this to take effect. This works in the Visual Studio 2010 Release Candidate too; you don’t have to wait for RTM to see it. The following screenshots are from Visual Studio 2010 RC.
|Segoe UI, ClearType on|
|Segoe UI, ClearType off, Standard font smoothing (grayscale)|
|Segoe UI, No font smoothing (bi-level rendering, aliased)|
(Hint: If you’re using Windows 7, and you want to see a zoomed-in view, don’t “zoom” your browser because that results in a bilinear stretch. Instead, use the built-in magnifier tool. Type “Zoom” in the Windows search box or, for a keyboard shortuct, hold the Windows key and press the plus key.)
If you’re writing your own WPF 4 application, make sure you are using “Display” mode for text (instead of the default, “Ideal”). In Display mode, WPF will follow the user’s choice of ClearType on or off. The choice may be overridden by using other values from the TextRenderingMode enumeration (ClearType, Grayscale or Aliased).
Consolas always uses ClearType
Even if you turn off font smoothing entirely, the Consolas font will be rendered using ClearType in Visual Studio 2010. This is an intentional decision for Visual Studio 2010 and applies only to Consolas. Consolas, the default font for the Text Editor in Visual Studio 2010, is part of the ClearType Font Collection and was designed specifically for use with ClearType.
You may, of course, select a different font for the Text Editor by using the “Fonts and Colors” dialog in Visual Studio’s Options. Anything other than Consolas will respect the system’s font smoothing options.
If you want to continue to use Consolas, but without ClearType, then you may be interested in the “TextSharp” extension by Sergey Vlasov. TextSharp has the option to set the text rendering mode to “Aliased” for all text editor views.
Changing the Environment font
One commenter indicated that he prefers to replace the default “Segoe UI” font for menus and toolbars with “Microsoft Sans Serif”. Here’s how to do that.
- Launch Visual Studio 2010
- Select “Options…” from the Tools menu
- Select the “Fonts and Colors” page from the Environment group
- In the “Show settings for” dropdown, select “Environment Font”
- In the “Font” dropdown, select the font you want.
- Click “OK”
And here’s what Microsoft Sans Serif looks like on Windows 7 with ClearType turned off:
Note: Microsoft Sans Serif does not have anti-aliased hinting, so it looks the same whether “Smooth edges of screen fonts” is on or off.
For the Text Editor, instead of Consolas, try 9 point “Lucida Console”. Again, use the Fonts and Colors dialog, but this time choose “Text Editor” from the top dropdown.
Paul Harrington – Principal Developer, Visual Studio Platform Team
Biography: Paul has worked on every version of Visual Studio .Net to date. Prior to joining the Visual Studio team in 2000, Paul spent six years working on mapping and trip planning software for what is today known as Bing Maps. For Visual Studio 2010, Paul designed and helped write the code that enabled the Visual Studio Shell team to move from a native, Windows 32-based implementation to a modern, fully managed presentation layer based on the Windows Presentation Foundation (WPF). Paul holds a master’s degree from the University of Cambridge, England and lives with his wife and two cats in Seattle, Washington.