本文介绍了[WPSL]如何在wp sliverlight8.1中使用扩展字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在wp sliverlight8.1中使用扩展字体,如何使用代码创建带有导入字体的文本块,我在xaml中使用扩展字体没关系,但是代码创建文本块不行,如何做或在哪里关于docment的字体。
how to use extend fonts in wp sliverlight8.1, how to use code create a textblock with import font, i use extend font in xaml it's ok, but code create textblock it's not ok.how to do or where the font about docment.
谢谢!!!
推荐答案
请确保在部署应用程序时,您已经设置了字体文件"build action-> content"。有关如何使用它,请参阅以下博客:
Please make sure when you deployed your app you've already set the font file "build action->content". For how to use it see the following blog:
对于文本框:
using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication())
{
IsolatedStorageFileStream stream = new IsolatedStorageFileStream(filename, System.IO.FileMode.Open, storage);
text.FontSource = new System.Windows.Documents.FontSource(stream);
text.FontFamily = new FontFamily(fontname);
}
您可以尝试为您的文本块使用相同的代码,看看是否可以解决此问题。
You can try use the same code for you textblock and see if you can fix this issue.
祝你好运,
Barry
这篇关于[WPSL]如何在wp sliverlight8.1中使用扩展字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!