问题
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)
回答1:
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:
Using custom font in WPF application: http://geekswithblogs.net/Martinez/archive/2010/01/29/custom-font-in-wpf-application.aspx
<TextBlock FontFamily="pack://application:,,,/Folder1/#Katana">Text</TextBlock>
Please refer to the link for more information.
来源:https://stackoverflow.com/questions/42121086/reference-custom-view-in-other-project-with-custom-font