New WPF Features: TextFormattingMode for clear text
This is part of a series on New WPF Features
Now there has been feedback since 3.0 that the WPF text doesnt render clearly when the fontsizes are smaller. So for .NET 4 we forked on this issue and fixed it by introducind the property TextOptions.TextFormattingMode. The default value is ideal which is what we have currently. The other option is Display and it makes small text look crisper and clear.
Lets see it in action
<StackPanel xmlns='https://schemas.microsoft.com/winfx/2006/xaml/presentation'
xmlns:x='https://schemas.microsoft.com/winfx/2006/xaml'>
<TextBox TextOptions.TextFormattingMode="Ideal" FontSize="10">HELLO WORLD</TextBox>
<TextBox TextOptions.TextFormattingMode="Display" FontSize="10">HELLO WORLD</TextBox>
<TextBox TextOptions.TextFormattingMode="Ideal" FontSize="15">HELLO WORLD</TextBox>
<TextBox TextOptions.TextFormattingMode="Display" FontSize="15">HELLO WORLD</TextBox>
</StackPanel>
See the difference :) ... also for asian characters the difference is very evident ..
Guidelines for this property
Scenarios |
Recommended Mode |
Large Text (15pt+) |
Ideal \ Display (users preference) |
Transformed Text |
Ideal |
Zoomed Text |
Ideal |
Design Scenarios |
Ideal |
Small Text |
Display |