Visual Studio Designer does not display an embedded font

I use some custom fonts in my C # WPF.NET 4.0 application (Open Sans and FontAwesome in particular) with Visual Studio 2013.

I have:

  • Added FontAwesome.otf and OpenSans-Regular.ttf to my project (not as a link) under / Fonts.
  • Make sure that both fonts are set to Resource.
  • Both fonts are installed locally (Windows 8.1).
  • New styles have been created in my resource dictionary (which contains many other parts, so I'm sure it works).
  • Restart VS2013.

Here is a snippet of the style that I created in my resource dictionary:

<Style x:Key="OpenSans">
    <Setter Property="TextElement.FontFamily" Value="pack://application:,,,/Fonts/#Open Sans" />
</Style>

<Style x:Key="FontAwesome">
    <Setter Property="TextElement.FontFamily" Value="pack://application:,,,/Fonts/#FontAwesome" />
</Style>

Now, in the new user control that I created to check the constructor, and these fonts were included correctly, I wrote the following XAML:

    <TextBlock Style="{StaticResource FontAwesome}" FontSize="64" Text="&#xf085;" />
    <TextBlock Style="{StaticResource OpenSans}" FontSize="48" Text="the quick brown fox jumped over the lazy dog." />
    <TextBlock FontFamily="Open Sans" FontSize="48" Text="the quick brown fox jumped over the lazy dog." />

FontAwesome FoneAwesome.

OpenSans , , Open Sans.

Open Sans FontFamily , Open Sans ().

, , , . , , FontAwesome , Open Sans. , , , FontAwesome Open-Type, Open Sans - True Type.

- , - , , , OTF TTF VS Designer?

+4
1

, Open Sans VS Designer. , , Open Sans ( , ), , .

FontAwesome , , VS, .

, (, ?) , WPF:

FontFamily WPF , :

<Style x:Key="OpenSans">
    <Setter Property="TextElement.FontFamily" Value="Open Sans, /<project name>;component/Fonts/#Open Sans" />
</Style>

, "Open Sans", - URI , . ( , "" " " ( Font .))

WPF , , , .. .

() , , ( , Open Sans) . , , , .

:

  • VS Designer Open Sans ( ), , .

  • , , . , , , .

, , Open Sans ( ), - VS Designer, .

+5

All Articles