WPF Text Clarity Improvements

WPF Text Clarity Improvements

Rate This
  • Comments 19

As most of you know, we’ve rebuilt the editor and much of Visual Studio using WPF for Visual Studio 2010.  This allows for a wealth of new visualizations and enables many new extensibility scenarios, often making previously impossible tasks possible and previously difficult tasks much easier.  Unfortunately, the WPF text team has been plagued with complaints of text blurriness in all WPF applications, including VS 2010.  They’ve been working hard to fix text rendering issues, and less than a week ago they announced additional WPF text clarity improvements for WPF 4.0.  These improvements are not in the VS 2010 RC but will be included in RTM, and they’ll also benefit any application using the final release of WPF 4.

Take a look at the following side-by-side comparison of the default Visual Studio color scheme in VS 2008, left, and an internal VS 2010 RTM build, right, using Consolas (originally published by the WPF text team on their blog).  Can’t tell the difference?  That’s the idea.  If you compare your own installation of the VS 2010 RC against the VS 2010 RTM image, you should see a noticeable difference, and RTM should look crisper.

[Note:  Please click on the following screenshot to see the full-sized image.]

SxS 2008 and 2010 RTM, black on white

The WPF team also received feedback that light text on a dark background was particularly problematic.  To see the difference pre- and post-fix, check out this enlarged comparison of VS 2008, VS 2010 RC, and VS 2010 RTM (originally published by Scott Hanselman on his blog):

SxS VS 2008 and VS 2010, light on dark, enlarged

Again, these changes are not specific to Visual Studio and will benefit any WPF 4 application.  But because we’ve had questions in this blog’s comments about the impact of this fix on other pieces of VS 2010 UI, here are a few “before and after” screenshots with side-by-side comparisons of the VS 2010 RC and a more recent internal VS 2010 RTM build*:

Tool window tabs, horizontal:

Tool window tabs, horizontal, VS 2010 RC

Tool window tabs, horizontal, VS 2010 RTM

Tool window tabs, vertical:

Tool window tabs, vertical, VS 2010 RC      Tool window tabs, vertical, VS 2010 RTM

Extension Manager:

Extension Manager, VS 2010 RC

Extension Manager, VS 2010 RTM

New Project Dialog:

New Project Dialog, VS 2010 RC

New Project Dialog, VS 2010 RTM

For more images of the text editor, please take a look at the WPF text team’s original blog post on this topic.  To give feedback on these changes, feel free to leave a comment for WPF or e-mail their team directly via their blog’s contact link.  And if you have any Visual Studio-specific questions, comments, concerns, etc., you can always leave a comment here.

Brittany Behrens
Program Manager, Visual Studio Editor Team

* Special thanks to Paul Harrington, author of the Visual Studio Blog’s WPF in Visual Studio 2010 series, for the non-editor screenshots in this post.

clip_image002I’m Brittany, a Program Manager on the Visual Studio Editor team.  Some of you may recognize me from Connect bugs or as the main voice of @VSEditor on Twitter, and I’m responsible for a variety of Editor features.  I love hearing from customers, so please let me know what you think!

Leave a Comment
  • Please add 6 and 6 and type the answer here:
  • Post
  •  One thing to note, if you click on the first side-by-side comparison your browser will likely try to fit the entire image in the viewing area.  If your screen isn't large enough this may entail some image resizing/resampling, which tends to lead to blurry images in this case.  If you notice the "+" magnifying glass when hovering over the image make sure you click it to show the image at its true full size, at least for me this makes the text go from 'still looks blurry' to 'nice and crisp'.

    Ryan

  • I'm a Windows 7 and VS2008 user, and have disabled ClearType and replaced Segoe UI with MS Sans Serif. The result looks very sharp, much like Windows XP with the "Standard" aliasing method (which doesn't alias fonts like Verdana below a certain px).

    VS2008 respects my settings and renders correctly using the system-wide Standard aliasing. VS2010 RC does not and tries to force its internal aliasing mechanism, resulting in blurry fonts.

    Please, before shipping VS2010 RTM, consider respecting the user's choice with regards to ClearType. And no, I'm not going to use Consoleas -- I'll stick with Lucida Console which renders nicely when ClearType is off. In short, I want WPF to respect the system-wide aliasing preferences, or even better -- offer the user an option to disable WPF entirely and use WinForms instead.

  • >offer the user an option to disable WPF entirely and use WinForms instead.

     That isn't really feasibly an option since that would mean replacing the new editor written with WPF for one that was able to render using WinForms.  Such an editor doesn't exist.

    Ryan

  • Christophe:

    I've seen this request before while following this issue since it was first reported and MSFT insisted that blurry text in WPF didn't exist.  The response from the beginning has been something like this, albeit more professional:

    "WPF's text renderer uses ClearType.  Period.  You can't turn it off.  Even if your computer has a super-low-tier graphics card and a monochrome monitor, WPF is going to try to alias your text using ClearType.  It's advanced.  You want it."

    From what I gather, in WPF 4 the text rendering stack has been rewritten, but it looks like the "all users must use ClearType" requirement wasn't scrapped during this rewrite.  So if you're one of the people that doesn't want ClearType, you'll have to wait for *another* rewrite of the text rendering stack, and it's clear that non-ClearType users are not really a priority in WPF.

  • @Owen

    I'm not an editor wonk, so I don't know all the gory details of text rendering and ClearType and all that jazz.  The statement 'in WPF 4 the text rendering stack has been rewritten' is correct in some regards.  The text rendering in WPF now utilizes DirectWrite (http://msdn.microsoft.com/en-us/library/dd368038(VS.85).aspx).  As for if that technology 'requires' that all users use ClearType or looks horrible without it, I don't know.  Are you saying the above screen shots that show the comparison with 2008 are still too blurry for your liking?  Or that you fear in your actual use environment it will still look blurry (regardless of all the work done)?

    Ryan

  • @Christophe @Owen: you can turn off cleartype in WPF4, see TextRenderingMode.Aliased (http://msdn.microsoft.com/en-us/library/system.windows.media.textoptions.textrenderingmode(VS.100).aspx), and the screenshots of this in the WPF text blog: http://blogs.msdn.com/text/archive/2009/08/24/wpf-4-0-text-stack-improvements.aspx.

    It would also be pretty easy to write a VS extension that changes the text rendering mode for all editor windows to aliased.  If that is something you'd be interested in using, can you send me an email (noahric at MS) and I'll build you something?

    (There was such an extension up on the gallery previously, but the author must not have updated it for the RC).

  • +1 to be able to turn off Cleartype completely.

    Especially useful for those of us who use monitors in portrait mode where even the best cleartype isn't really, eh "clear"

  • @noahric: but is there any reason that this functionality isn't already in vs2010? On the WPF text blog it states that as long as text is set to "display" mode it should automatically render aliased text according to system settings:

    "Auto – This mode will use ClearType unless system settings have been set to specifically disable ClearType on the machine."

    Contrary to what Owen Pellegrin and Ryan Molden said in the comments above, WPF4 apparently fully supports aliased text. This would appear to have taken significant effort form the text team to implement and i can't think of anyone who would want this feature more than IDE users. I find the fact that it's not even natively supported in the IDE a bit bewildering.

  • Actually, I found out a plugin for VS2010 that allows turning off aliasing entirely. However going back to the "Standard" aliasing model is not supported atm.

    @Ryan: thanks for the reply. I know this is probably not feasible before VS2010 is released, but would it be possible to offer the user a choice between the "classic" VS2008 editor and the newer WPF4 editor ? That would be awesome. Maybe in the form of a plugin or patch.

    Incidentally, I believe giving the user more choice is generally a good thing. Hence my dislike at Vista/7 to force the use of Segoe UI everywhere in the interface (Office 2007 also does that).

  • [WARNING:  All postings that prognosticate future events or explain current decisions represent my own opinions/views and do not necessarily represent the opinions/plans of my employer.  Nothing said in any posting should be taken as an official statement 'from Microsoft']

    @Brian

     I don't believe I ever said that WPF 4 does/doesn't support aliased text, I simply asked if the above screen shots were still too blurry or if the concern was that with different fonts/different color schemes it would be too blurry.  I personally find the text in the IDE perfectly suitable for my daily use especially after the latest WPF fixes.  However, not everyone sees this the same way, people's eyes/monitors/choices of fonts/colors are different and what is perfectly fine to one may be blurry or headache inducing to another.  Anytime we must make a decision as to which way to go 'by default' we will undoubtedly upset some people.  As for the IDE's general settings here, we set to Display mode everywhere I am aware of, I believe the editor may switch to Ideal mode when the editor is zoomed (per the suggestions of the WPF text folks).

    @Christophe

     No, offering both editors won't happen.  The new editor introduces a MUCH different extensibility model which wouldn't work with the 'old' editor at all.  Many/most components that rely on editor extensibility points were updated to use the new interfaces in Dev10, if there were some 'patch' to put the old editor in place all of these things would immediately stop working (language coloring, intellisense, refactoring, etc..).  Further, at least part of the motivation for moving to WPF was to move beyond the old, hard to maintain/extend, Win32 code of the old editor and shell.  This is done for a number of reasons but the most important (from my perspective) is the greater flexibility it gives to change/update the UI in shorter time spans with less churn and risk, and the greater flexibility we can expose to third parties in terms of changing the UI as well.  The 2008 editor is/was a good editor, and it is still available, in 2008 :)  The new editor is what is available in 2010 and going forward it is where I would imagine the lions share of the editor team's focus is likely to be directed.  

     While I agree more choice is good, maintaining two distinct, separate editors is a HUGE cost.  It would involve twice as much work from DEV, QA, PM, UE, UX, bug investigation/fixing support, answering questions about extensibility, working with partner teams so some new piece of technology they want to enable would work on both editors, etc..  I can't think of a single large product that has ever undergone a major UI shift and offered the old UI as an option, it is simply too costly/problematic to do.  That said the editor team is very open to feedback and hearing about pain points, work never stops (even at ship-time) so any pain from the current editor should be raised so the editor team is aware of it and can address it in future releases, unless the feedback is 'go back to the old editor' which as I said, won't happen :)

    Ryan

  • @Brian: It should, as long as your font isn't Consolas.

    The problem is the combination of two things:

    1) Consolas looks really bad when ClearType is turned off

    2) Over remote desktop, most people have ClearType turned off without knowing it, because it isn't one of the default options (with nearly all the connection speed settings).

    The intent, as far as I understand it, was that if Consolas is set as your font, the editor would always use ClearType, and that if anything else was your font, the editor would default to your system settings.  Are you finding this isn't the case?  If so, I'll take a look and see if there is a bug to be filed and addressed.

    The only other special casing, as Ryan said, is that the editor uses Display mode for text rendering at 100% zoom and Ideal mode at every other zoom level.

    -Noah

  • I've tried to address some of the comments on non-ClearType rendering here:

    http://blogs.msdn.com/visualstudio/archive/2010/03/15/visual-studio-2010-text-clarity-cleartype-and-aliased-fonts.aspx

  • @Brian: I was mainly referring to the request to turn ClearType off and use standard aliasing.  The screenshots look fine to me, and on my current monitors WPF4 looks great.

    When I was initially bothered by horrible blurry text in WPF I used CRT monitors and ClearType looked awful on these monitors.  I used standard aliasing, and this worked fine for most fonts (Consolas looked wonky, but it wasn't designed for non-ClearType rendering so it's excused.)  At that point in time, the word I saw on MSDN forums was that WPF used ClearType period, and if SnapToDevicePixels didn't fix the problem the solution was essentially "buy a better monitor".  Now I'm on LCD monitors and previous versions of WPF look much better (though still slightly blurry) and WPF4 looks very good.  I don't have the CRT monitors to make the comparison anymore.

    Not all fonts are designed for ClearType, and these can look really bad in WPF when ClearType is used.  My understanding is that in previous versions of WPF, ClearType is always used so these fonts are just going to look bad in WPF.  If WPF4 responds to the system settings and uses whatever you have configured, I'm happy.  I don't have any monitors that I need to avoid ClearType for anymore, but it's good to know that if I find myself in that situation again I won't be forced to feel like I've had a couple of beers while working with WPF.  I thought I had seen that WPF4 would always use ClearType somewhere, and it's good to see that was incorrect.

    I didn't know about the ability to turn ClearType on and off in Remote Desktop that noahric mentioned; that should solve some problems I've had.

  • I am somewhat concerned i have not seen any blurred screenshots as bad as mine yet:

    http://www.mpdreamz.nl/vs2010RC-blur.png

    Looking forward to the RTM i can't use VS2010RC as it is now.

  • @Martijn:

    Any chance you've got antialiasing forced on in the video driver settings? That would probably mess up WPF rendering in the way that your screenshot is showing.

Page 1 of 2 (19 items) 12