bizon
bizon

Reputation: 2414

Font in WPF application looks different in notepad or any other application

I have otf font called "Houschka Rounded". In notepad, word or any WinForms app it looks like this:

alt text - this is ok

Code:

<TextBox Text="asdf www w er AAs" FontSize="16" FontFamily="Houschka Rounded" Height="23" HorizontalAlignment="Left" Margin="12,12,0,0" Name="textBox1" VerticalAlignment="Top" Width="317" />

In WPF 4.0 it looks like this:

alt text - this is bad

Anyone know why it's happening?

Upvotes: 1

Views: 511

Answers (1)

bizon
bizon

Reputation: 2414

It turned out that otf font has featureas which can change the look of font. In my case I set ContextualAlternates=false.

<TextBox FontFamily="Houschka Rounded" Height="23" HorizontalAlignment="Left" Margin="12,12,0,0" Name="textBox1" VerticalAlignment="Top" Width="317">
    <Run Typography.ContextualAlternates="False" >
        asdf www w er AAs
    </Run>
</TextBlock>

For details see: http://msdn.microsoft.com/en-us/library/ms745109.aspx

Upvotes: 4

Related Questions