I'm using some custom fonts in my C# WPF .NET 4.0 application (Open Sans and FontAwesome, specifically) with Visual Studio 2013.
I have:
- Added FontAwesome.otf and OpenSans-Regular.ttf to my project (not as a link) under /Fonts.
- Made sure both fonts are set to "Resource".
- Installed both fonts locally (Windows 8.1).
- Created new Styles in my Resource Dictionary (that contains many other pieces, so I'm confident it's working).
- Restarted VS2013.
Here is a snippet of the Style I've 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 a new User Control I created purely to test the Designer and these fonts being included properly, I have written the following XAML:
<TextBlock Style="{StaticResource FontAwesome}" FontSize="64" Text="" />
<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 works in the designer and when run, on both my PC and another PC without FoneAwesome installed.
The OpenSans Style does not display in the designer, but does when executed, including on another PC without Open Sans installed.
The Open Sans FontFamily selection displays in the designer, but does not display on another PC without Open Sans installed (expected).
Problem
I want to be able to use the Designer to see in design-time what the UI looks like given the provided Fonts I'm using. Leveraging the Styles I've created, I'm able to see the FontAwesome icons in the Designer, but not the Open Sans font. The only difference I can tell between the two is that FontAwesome is an Open-Type Font, whereas Open Sans is an True-Type Font.
Does anyone have an idea if I've overlooked something simple, or perhaps if there are obscure issues between OTF and TTF in the VS Designer?
ttf
flavour, what happens when you use that instead? Does it work? (if so, you might be using an obsolete shaping engine instead of a modern one) – Pattiepattin