我无法添加自定义字体。我按照这里所述的步骤进行操作,该页面引用了这个页面,但是字体仍未在我的应用程序中使用。
我已将字体添加到项目中
它们出现在我的设计视图中
打开Windows中的字体(以验证字体名称):
但是,当我引用它们时,它们仍未在我的应用程序中使用。我尝试了以下语法
<TextBlock
Grid.Column="1"
Text="{x:Bind Text}"
FontFamily="ms-appx:///Assets/Delphi-Soleto_Lt.ttf#Delphi-Soleto Light"/>
当我在设计师中选择字体时,设计师会将其填入。
<TextBlock
Grid.Column="1"
Text="{x:Bind Text}"
FontFamily="Delphi-Soleto Light"/>
或者就像这个网站所提出的那样。
<TextBlock
Grid.Column="1"
Text="{x:Bind Text}"
FontFamily="/Assets/Delphi-Soleto_Lt.ttf#Delphi-Soleto Light"/>
非常感谢您的帮助……!
将GIT存储库上传至:
https://github.com/basprins/CustomFontWinIot
我正在尝试在 BulletText.xaml
中使用 Delphi 字体:
<TextBlock
Grid.Column="1"
Margin="0, 13, 0, 0"
Style="{StaticResource Normal}"
Text="{x:Bind Text}"
FontFamily="{StaticResource DefaultFont}"/>
我在主页面上添加了“BulletText”控件,该控件将在应用程序启动时立即可见。
使用引用了不会显示的字体的空白应用程序更新git repo。
在我的电脑上,我没有将字体安装到Windows中。我只是将它们添加到了项目中。代码见github页面。设计师视图的截图。