使用自定义字体引用其他项目中的自定义视图 [英] Reference custom view in other project with custom font
问题描述
我正在制作WPF程序.我有一个项目,其中有带有自定义字体(超赞字体)的自定义TextBlock控件,我将此项目添加到另一个项目的引用中,并将此自定义控件添加到这个新项目中,但是未显示该字体.它只是正方形.我已将构建操作设置为资源",并且不将其复制到输出目录.我究竟做错了什么?这两个项目都是类库.我在其他项目中使用了它们(所有这些都是为Prism完成的)
I am making WPF program. I have project where I have custom TextBlock control with custom font (font-awesome), I add this project in references of another project and add this custom control in this new project but the font is not shown. It is just square. I have set build action as Resource and Do not copy to output directory. What am I doing wrong? Both projects are class libraries. And I use them in other project (all these done for Prism)
推荐答案
请确保将字体的 Build Action 属性设置为 Resource ,并且您引用了此处建议使用包URI的自定义字体:
Make sure that the Build Action property of the font is set to Resource and that you reference the custom font using a pack URI as suggested here:
在WPF应用程序中使用自定义字体:
请参阅链接以获取更多信息. Please refer to the link for more information. 这篇关于使用自定义字体引用其他项目中的自定义视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!