Situation
You’re building a WPF application.
Problem
Some text is rendered blurry or pixelated.
Solution
Modify the text render options corresponding to your needs.
Properties you can set on any UIElement:
- TextOptions.TextFormattingMode
- TextOptions.TextRenderingMode
- TextOptions.TextHintingMode
A settings that has worked for me very well is TextOptions.TextFormattingMode=”Display”.
These settings are inherited by all sub-elements so it’s okay to just set them on the root element of every control.
Sources
- http://msdn.microsoft.com/de-de/library/system.windows.media.textformattingmode.aspx
- http://msdn.microsoft.com/de-de/library/system.windows.media.texthintingmode.aspx
- http://msdn.microsoft.com/de-de/library/system.windows.media.textoptions.textrenderingmode.aspx
- http://karlshifflett.wordpress.com/2009/10/22/much-improved-net-4-0-wpf-text-rendering/
Leave a Reply