Problems with DrawString and edge smoothing fontsettings in Windows XP

  • Thread starter Thread starter David Lindgren
  • Start date Start date
D

David Lindgren

Hello!

I am using Graphics.DrawString to draw some text on my usercontrols and I
have discovered that when I turn on edge smoothing in Windows XP some of my
drawn text appears as if it was bold. Not all text is affected though. It
seems that only text that is drawn on a transparent surface (Bitmap) gets
messed up.

For better understandning of my problem take a look at these screenshots:

This is what it should look like:
http://www.lowrad.net/files/screenshots/Standard.jpg

Change the setting for smooth edges from "Standard" to "ClearType" :
http://www.lowrad.net/files/screenshots/Settings.jpg

This is how it looks with ClearType:
http://www.lowrad.net/files/screenshots/ClearType.jpg

As you can see, the text that is drawn on the orange colored surface is only
slightly affected, while the text that is drawn on the transparent surface
looks like it is bold.

My question is: Can I do something to prevent the ClearType smothing from
affecting my drawing beside from stop drawing on transparent surfaces?

Thanks for you help!

/David.
 
They certainly do appear more blurred than usual. My experience is the
cleartype doesn't really make it much clearer. You get higher contrast,
but more blurred text. Not sure what causes the excess blurring, but I
woudn't be surprised if the transparancy confuses the algorithm as it
doens't know the background color. Maybe setting the background color to
something draw text, then set it transparent (could give ugly flashing
results).
 
You can override Windows font smoothing by seting the
TextRenderingHint property of the Graphics class.
 
Back
Top