Question

So I'm trying to take advantage of all the TextOptions introduced in SL5 (TextRenderingMode, TextHintingMode, TextFormattingMode) and get a nice uniform (performance minded) Segeo UI font throughout an app.

My problem lies in the fact that these don't seem to be getting inherited through all the controls. I set them as resources like;

<TextFormattingMode x:Key="THETextFormattingMode">Display</TextFormattingMode>
<TextHintingMode x:Key="THETextHintingMode">Fixed</TextHintingMode>
<TextRenderingMode x:Key="THETextRenderingMode">Auto</TextRenderingMode>

Then I have them set as setters on individual controls like TextBlock and TextBox like;

<Setter Property="TextOptions.TextFormattingMode" Value="{StaticResource THETextFormattingMode}" />
<Setter Property="TextOptions.TextHintingMode" Value="{StaticResource THETextHintingMode}" />
<Setter Property="TextOptions.TextRenderingMode" Value="{StaticResource THETextRenderingMode}" />

Except I'm seeing discrepancies between the controls still, example image below with "tt" taken as a screen shot from the same screen. The "tt" on the left is from a TextBox and the one on the right is from a TextBlock which both have the TextOptions.*Mode set the same.

enter image description here

What am I missing here? Why are they not identical? The text from the TextBlock ("tt" image on the right) appears sharper.

Était-ce utile?

La solution

Maybe different default colors in TextBlock and TextBox for Foreground and Background result in this effect when combined/overlapping.

Have you tried to set them both to Foreground="#FFFFFF" and Background="#000000"?

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top