我有一个自定义复合字体作为库dll中的资源,我想加载但是我无法获得确切的语法。我试过了:
FontFamily font = new FontFamily(
new Uri("pack://application:,,,/MyLibraryDll"),
"./fonts/#My Font from composite font");
哪个没用,所以我尝试用以下字体枚举字体:
ICollection<FontFamily> fonts = Fonts.GetFontFamilies(
new Uri("pack://application:,,,/MyLibraryDll"),
"./fonts/#My Font from composite font");
和
ICollection<FontFamily> fonts = Fonts.GetFontFamilies(
new Uri("pack://application:,,,/MyLibraryDll"),
"./fonts/mycompositefont.compositefont#My Font from composite font");
两者都返回0.我没有找到关于这些的文件 - 有没有人对此有任何好运?
答案 0 :(得分:2)
根据Packaging Fonts with Applications,正确的语法是:
new FontFamily(new Uri("pack://application:,,,"),
"MyLibraryDll;Component/Fonts/#My Font from composite font");