0

I don't understand. I am going crazy - no matter what I do, the text in my WPF application is blurry. Well, some of it - one of the text elements is focused, and so are the close/minimize buttons. I have applied the TextOptions.TextRenderingMode="ClearType" and TextOptions.TextFormattingMode="Display" to the elements directly, and I have also tried applying it to the MainWindow.xaml, which is created by default using the ModernUI for WPF framework.

I'm going nuts - all the literature I find says this was fixed, but I'm still dealing with the issue. (I've changed the font to Calibri/Consolas and also played with the size and weight - still blurry.)

How can I fix this?

Edit: If I use the monitor I have at work (resolution 1920x1200) with standard DPI settings, I'm not so sure I have the issue. On the laptop display I am using I have a very high resolution (2880x1620) with the text scaling set to larger. On this display is where I'm currently seeing the text as "not crisp". I should also note that in the designer, the text appears fine. It is when the application runs that the text looks terrible.

An example of the blurry text.

Cody
  • 8,686
  • 18
  • 71
  • 126
  • what do you mean blurry ? is this the different color we are talking about here or the actual text in itself is blurred ? – Muds Apr 08 '15 at 15:00
  • No, the actual text itself is blurry. Even text that is black on other pages still appear blurry and not **crisp**. – Cody Apr 08 '15 at 15:03
  • there are lots of reasons of this, right from dirty screen to supressed graphics engine. Do you see it randomly? like some text blurred some times and sometimes not ? – Muds Apr 08 '15 at 15:04
  • Well, I believe if I use the monitor I have at work (resolution 1920x1200) with standard DPI settings, I'm not so sure I have the issue. On the laptop display I am using I have a very high resolution (2880x1620) with the text scaling set to larger. – Cody Apr 08 '15 at 15:08

3 Answers3

1

So, I found out my issue is specifically with the Modern UI Framework. I'm not sure why. I switched over to using MahApps.Metro and I have no issues with font clarity.

Cody
  • 8,686
  • 18
  • 71
  • 126
0

to start with you can try with

<TextBlock Text="Am I Still Blurry." RenderOptions.ClearTypeHint="Enabled"/>

you might wanna have a look at this post for clearer understanding

Community
  • 1
  • 1
Muds
  • 4,006
  • 5
  • 31
  • 53
  • I have tried this as well, but it does not have an effect. I made an edit to my post to further clarify the display I am using and how the text appears fine in the designer. – Cody Apr 08 '15 at 15:11
  • I have had this issue, but it wasn't consistent.. and later on it was to do with graphics engine .. is yours consistent ? – Muds Apr 08 '15 at 15:12
0

It is by Design. Those different set of controls and they have different styles of font color. For Example Settings and Help in the Top right of the window they are using the style SystemButtonLink which is defined below

<Style x:Key="SystemButtonLink" TargetType="ButtonBase" BasedOn="{StaticResource SystemButtonBase}" >
    <Setter Property="Foreground" Value="{DynamicResource LinkButtonText}"/>
    <Setter Property="Width" Value="NaN" />
    <Setter Property="Height" Value="NaN" />
    <Setter Property="FontFamily" Value="Segoe UI" />
    <Setter Property="FontSize" Value="11" />
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type ButtonBase}">
                <Border Name="Chrome"
                            Background="{TemplateBinding Background}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            SnapsToDevicePixels="true">
                    <TextBlock DataContext="{TemplateBinding Content}"
                               Text="{Binding Converter={StaticResource ToUpperConverter}}"
                               Margin="{TemplateBinding Padding}"
                               VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                               HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                               SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                </Border>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
    <Style.Triggers>
        <Trigger Property="IsMouseOver" Value="True">
            <Setter Property="Foreground" Value="{DynamicResource LinkButtonTextHover}"/>
        </Trigger>
        <Trigger Property="IsPressed" Value="True">
            <Setter Property="Foreground" Value="{DynamicResource LinkButtonTextPressed}" />
        </Trigger>
        <Trigger Property="IsEnabled" Value="false">
            <Setter Property="Foreground" Value="{DynamicResource LinkButtonTextDisabled}" />
        </Trigger>
    </Style.Triggers>
</Style>

If you refer the three colors used in the style for Mouse hover, Pressed and IsEnabled. More code can be refered in the site. https://mui.codeplex.com/SourceControl/latest

Ayyappan Subramanian
  • 5,348
  • 1
  • 22
  • 44