开发者

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

I have otf font called "Houschka Rounded". In notepad, word or any WinF开发者_运维知识库orms app it looks like this:

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

- 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:

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

- this is bad

Anyone know why it's happening?


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜