Font Smoothing Problem

D

Don

I have a vb.net application that I've been working on for many months
and I recently noticed that fonts are no longer appearing antialiased
when the app is running. The text looks nice and smooth when I look
at all the forms and UI components in the IDE at runtime, but when the
program is running, all the text turns blocky. This holds true both
for built-in controls (e.g. Label) and custom controls which use
Graphics.DrawString (with the appropriate TextRenderingHint set) to
draw text. Everything used to draw just fine for a long time, then,
sometime in the recent past it just stopped.

I can't imagine what change I may have made to the code to somehow
"turn off" font smoothing in the one application alone only when it's
executing. Has anyone come across something like this before? Anyone
know what the heck is going on? Could a recent Microsoft Update maybe
wrecked things?

- Don
 
O

Onur Güzel


Hi,

Without seeing your code, you can first try this if it works:

' Try that execution order to draw text on form
' except on Form_Load event.
' Because on Form_Load drawstring doesn't work
' maybe because of an timing issue
Dim g As Graphics = Me.CreateGraphics
Dim font As New Font("Arial", 20)
g.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAlias
g.DrawString("Hello World", font, Brushes.Blue, 100, 100)

Secondly, as just a guess though you set proper TextRenderingHint
value, did you turn off ClearType? Anyway, Though if you have
ClearType off, TextRenderingHint parameter still should work.
Optionally, you can try to install and launch ClearType Tuner PowerToy
here to see if its related:

http://www.microsoft.com/typography/ClearTypePowerToy.mspx

HTH,

Onur Güzel
 
D

Don

I think I see what happened now. The behavior of the SystemDefault
TextRenderingHint may have been altered to no longer antialias text.
Either that, or my TextRenderingHint properties were changed to
SystemDefault at some point.

All is well.
 
D

Don

I think I see what happened now.  The behavior of the SystemDefault
TextRenderingHint may have been altered to no longer antialias text.
Either that, or my TextRenderingHint properties were changed to
SystemDefault at some point.

All is well.

Also, this problem illuminated an interesting fact: the SystemDefault
TextRenderngHint behaves differently at runtime than it does it design
time. Odd...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top