Using GDI+ to draw text on glass:
graphics.DrawString(s, Length(s), font, MakePointF(x, y), brush);
You'll notice that the ClearType enabled text draws very poorly on glass:
But with glass disabled the text, of course, draw fine:
By way of comparison here is Anti-alias font smoothing:
And here is no font smoothing:
Note: No font smoothing looks better than it really does because StackOverflow resizes the images on your monitor.
How do i draw ClearType text on glass?
What Mark is suggesting is that you cannot honor the user's preferences for text rendering (i.e. "SystemDefault
". ClearType does not function on glass, and you cannot use it.
In other words, if you're rendering on glass you must override the text rendering with:
graphics.SetTextRenderingHint(TextRenderingHintAntiAliasGridFit);
Otherwise you should leave the TextRenderingHint
at it's default TextRenderingHintSystemDefault
.
The problem is inherent to the way drawing is performed. All of your text is being drawn on a black background, then composited onto a glass background; the semi-transparent font smoothing is being combined with black to make near-black.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With