我正在尝试将自定义字体作为应用程序资源添加。 我在应用程序中有一个名为“CustomFont”的目录,并且其中的所有字体都设置为“Resource”。
<Window.Resources>
<Style x:Key="Gotham-XLight">
<Setter Property="TextElement.FontFamily"
Value="/CustomFonts;Component/#Gotham-XLight" />
</Style>
</Window.Resources>
然后在我的TextBlock上,我有这个东西:(在网格中)
<TextBlock x:Name="TimeTextBlock" Style="{DynamicResource Gotham-XLight}"
TextAlignment="Center" FontSize="25" FontWeight="Bold"
Foreground="White" Text="TextBlockTimer"
Margin="105,242.974,0,226.975" HorizontalAlignment="Left"
Width="221.919" />
但是我没有看到其他人说的那种字体。我做错了什么吗?