# .NET and More > WPF, WCF, WF >  Blurry text when scrolling items in listbox (even after scrolling has stopped)

## chris128

Apparently there is a massive problem with WPF's text rendering in general, in that it makes all text appear quite blurry. However I have to say I have not noticed this at all until now, but I only see it when when scrolling or animating text.

For example, here is a screenshot of some items in my listbox before I scroll:


and here is one from after scrolling down a little (look at the selected item in particular)


You probably cant see it that clearly from the screenshots but trust me when you are actually using the app it is very noticeable.

I have SnapToDevicePixels turned on and have tried specifying larger fonts etc but nothing seems to help and I just wondered if anyone had any suggestions?

Cheers
Chris

----------


## DeanMc

Have you tried a different font?

----------


## chris128

Yeah I tried Calibri as well and same result

----------


## Pac_741

I have the same problem, but it only happens while animating, but i see it as no big deal.

----------


## chris128

it wouldnt be a big deal if I was just making an app that people only use every now and then but the app I'm making is something that me and my colleagues will be using for several hours every day at work and there will be a fair amount of text in the app so having it blurry is just going to annoy people (and strain their eyes)

EDIT: I found that apparently it is going to be resolved in.NET 4.0 but as thats not coming out this year even then I'm still looking for other solutions  :Frown:

----------


## Pac_741

Well, good luck, let's hope .net 4.0 solves the problem

----------


## mendhak

It's a font caching thing.  Windows Presentation Foundation Font Caching... storing glyphs in video memory.  It's apparently a performance feature.  What happens when you increase hardware acceleration? (You know what I mean, the three levels)

----------


## chris128

I dont think its anything to do with caching, have a read through this thread
http://social.msdn.microsoft.com/for...-69865b6dc401/

Here's an excerpt from that thread, apparently quoted from the Microsoft Connect case that relates to text blurriness:




> We are replacing WPF's text rendering stack in WPF 4.0, and this should allow you to render text with comparable sharpness to what you're used to with GDI. The reason the existing text stack in WPF looks blurrier than GDI's is that GDI text is typically rendered with Compatible Width Layout, whereas WPF's existing text stack always uses Ideal Width Layout. Compatible Width Layout snaps glyphs to pixel boundaries, Ideal Width does not, which is why WPF's text looks blurrier than GDI's. WPF's existing text stack also does not support use of the embedded bitmaps that are included in many fonts and are intended to be used when rendering at smaller sizes.
> 
> The new text stack in WPF 4.0 will allow Compatible Width Layout, and it will also support embedded font bitmaps. We believe this will solve all of our text blurriness issues.

----------


## mendhak

All the apps I have running on this machine show blurry images when I end the PresentationFontCache. When I re-enable the service, it goes back to being alright. I had to assume it's that.

----------


## chris128

Hmm thats interesting, I didnt even know about that service.
The service is set to Manual startup type though so surely the first time my app starts the text should not be blurry (if indeed it is to do with this font caching thing), I will test that theory out tonight

----------

