WPF和字体 [英] WPF and fonts
问题描述
我知道您可以在csproj文件中将字体添加为资源,但是我们的需求有所不同.如果我选择AddFontResourceEx作为临时全局字体添加我们的字体,即使我们将使用本地字体,Word和Win32应用程序似乎也可以使用并查看该字体,但WPF无法.我什至尝试了WinForms添加本地字体的方式,WPF看不到它.
I know you can add a font as a resource in a csproj file but our needs are a bit different. If I pinvoke AddFontResourceEx to add our font either as a temporary global font, (even though we would use local) Word and win32 apps seem to be able to use and see the font but WPF cannot. I even tried the WinForms way of adding a local font and WPF can't see it.
任何人都知道断开连接在哪里.我也尝试过字体 .GetFontFamilies,并且该文件夹还不错. WPF拒绝在Win32可以看到的地方看到它.
Anyone know what the disconnect is here. I have also tried Fonts.GetFontFamilies and the folder is known good, yet again. WPF refuses to see it where Win32 can.
谢谢
推荐答案
我知道您可以将字体作为资源添加到csproj文件中,但是我们的需求有所不同.如果我将AddFontResourceEx命名为临时全局字体来添加我们的字体(即使我们将使用本地字体),Word和Win32应用程序似乎也能够 使用并查看字体,但WPF不能.我什至尝试了WinForms添加本地字体的方式,WPF看不到它.
I know you can add a font as a resource in a csproj file but our needs are a bit different. If I pinvoke AddFontResourceEx to add our font either as a temporary global font, (even though we would use local) Word and win32 apps seem to be able to use and see the font but WPF cannot. I even tried the WinForms way of adding a local font and WPF can't see it.
任何人都知道断开连接在哪里.我也尝试过 字体 .GetFontFamilies,并且该文件夹众所周知,很好. WPF拒绝在Win32可以看到的地方看到它.
Anyone know what the disconnect is here. I have also tried Fonts.GetFontFamilies and the folder is known good, yet again. WPF refuses to see it where Win32 can.
谢谢
我正面临着相同的问题,并在不同的论坛中提出了相同的问题,但无法获得正确的答案.任何答案或建议都会对我们有很大帮助.
I am facing the same problem and asked the same question in different forum but could not get proper answer. any answer or suggest will help us a lot.
谢谢
这篇关于WPF和字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!