I have been having this issue with blurry text in WPF. I know that there are these TextFormatting="Display"
options and I've been googling a lot, but the thing is that it's still not right. Let me demonstrate:
The left side is what I see in Visual Studio 2011 Developer Preview's "preview mode", and the right side is what I see when I actually run the program. What I want is the left ClearType which is by far the nicest, but none of those options in actual program running mode look good.
This is the code:
<StackPanel TextOptions.TextFormattingMode="Display">
<TextBlock>Hello World ... ClearType</TextBlock>
<TextBlock TextOptions.TextRenderingMode="Grayscale">Hello World ... Grayscale</TextBlock>
<TextBlock TextOptions.TextRenderingMode="Aliased">Hello World ... Aliased</TextBlock>
</StackPanel>
How do I render text the way it is rendered in the preview mode right inside Visual Studio?
EDIT: I found out that the reason that causes this problem is because I use WPF Shell Integration Library with the Glass style. This glass style somehow makes WPF to not use ClearType.
Try writing the following way:
<TextBlock Text="ClearType ENABLED." RenderOptions.ClearTypeHint="Enabled"/>
You can read about ClearTypeHint at MSDN
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