Ich habe Googles Material Design-Symbolschrift in mein WPF-Projekt eingebettet, indem Sie es in Projektressourcen eingefügt haben.wpf eingebettete Schriftart wird beim Ausführen nicht angezeigt
Die Schriftart wurde in Visual Studio-Designer korrekt angezeigt, zeigte aber nur tofus (etwas wie
) während des Betriebs.
Was mache ich falsch?
Hier ist, was in App.xaml
Code:
<Application.Resources>
<FontFamily x:Key="MaterialIcon">/ExampleProject;component/Resources/#Material Icons</FontFamily>
</Application.Resources>
Und hier ist, wie ich den Knopf erklärt:
<Button x:Name="ExampleButton" Content="" FontFamily="{DynamicResource MaterialIcon}"/>
Screenshot: