Based on this answer about issues with blurry texts in WPF, I tried to use TextOptions.TextFormattingMode = TextFormattingMode.Display
, but it seems like it also changes the spacing between the letters:
TextFormattingMode.Display
leads to the z
and e
characters being blended into another:
while this "blending" does not happen using TextFormattingMode.Ideal
:
The differences become even more visible when scaling the texts up (TextFormattingMode.Display
on the left):
The behavior occurred only when using Segoe UI Semilight
and only at 12pt font size.
Why does that happen? Is this an issue with that particular font, the WPF rendering engine or is this actually wanted behavior?
EDIT: If you want to check for yourself, here is some ready-to-copy sample code:
<Grid>
<Grid.Resources>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="FontFamily" Value="Segoe UI Semilight" />
<Setter Property="FontSize" Value="12" />
</Style>
</Grid.Resources>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0"
Text="size"
TextOptions.TextFormattingMode="Display" />
<TextBlock Grid.Row="1"
Text="size"
TextOptions.TextFormattingMode="Ideal" />
</Grid>