ClearType and TextRenderingHint : Inconsistent behavior

ClearType and TextRenderingHint : Inconsistent behavior

Post by VEJvbG9 » Fri, 13 Feb 2009 00:00:00


Hi,

Please note that this question was basically posted in the msdn forums [1],
but regarding the methods involved (DrawString and TextRenderingHint), I've
found pertinent to cross-post here.

If you're okay with C#, you'll find all the details and code to reproduce
this bug on the thread mentioned.

This issue concerns the Graphics.TextRenderingHint property, when used in a
system with ClearType enabled, when switching from ClearTypeGridFit to
SystemDefault.

If I set ClearTypeGridFit explicitly before using DrawString, then set
SystemDefault and drawing another string, the second string is drawn aliased.
If I reverse the order (ClearTypeGridFit mode then SystemDefault, all is OK).
All seems to be related to the TextRenderingHint property, when switched back
from ClearTypeGridFit to SystemDefault, which seems to force aliased mode
(beside the fact that by default the Graphics object is initialized with
SystemDefault mode).

If you have any hint about how to handle this case, feel free to post it.
I'll answer all questions as possible.

Thanks,

[1]
http://www.yqcomputer.com/
 
 
 

ClearType and TextRenderingHint : Inconsistent behavior

Post by VEJvbG9 » Fri, 13 Feb 2009 00:00:01

Hi,

Please note that this question was basically posted in the msdn forums [1],
but regarding the methods involved (DrawString and TextRenderingHint), I've
found pertinent to cross-post here.

If you're okay with C#, you'll find all the details and code to reproduce
this bug on the thread mentioned.

This issue concerns the Graphics.TextRenderingHint property, when used in a
system with ClearType enabled, when switching from ClearTypeGridFit to
SystemDefault.

If I set ClearTypeGridFit explicitly before using DrawString, then set
SystemDefault and drawing another string, the second string is drawn aliased.
If I reverse the order (ClearTypeGridFit mode then SystemDefault, all is OK).
All seems to be related to the TextRenderingHint property, when switched back
from ClearTypeGridFit to SystemDefault, which seems to force aliased mode
(beside the fact that by default the Graphics object is initialized with
SystemDefault mode).

If you have any hint about how to handle this case, feel free to post it.
I'll answer all questions as possible.

Thanks,

[1]
http://www.yqcomputer.com/

 
 
 

ClearType and TextRenderingHint : Inconsistent behavior

Post by VEJvbG9 » Fri, 13 Feb 2009 00:29:01

(Sorry for the double post, but the ms web interface was throwing an error,
and the cache didn't show the message immediately).