字体不支持任何风格像'普通'大胆''斜体' [英] font does not support any style like 'regular' 'bold' 'Italic'
问题描述
我怎么能与剂量不支持任何类型的fontstyle的字体工作。顺便说一句,我无法从它的字体对象。帮助??
how can i work with font that dose not support any kind of FontStyle. by the way, I can not create a font Object from it. help??
推荐答案
Windows上的字体代码(如在任何平台上我猜)不会从头开始创建新的字体; 。它会解释,而安装了/你的系统上有什么字体,并给你一个方法与工作
The font code on Windows (as on any platform I guess) doesn't create new fonts from scratch; it will rather interpret what fonts are installed / available on your system and give you a way to work with those.
每个字体由作出的FontFamily对象达成;这样的FontFamily则包含可用每款字体的对象。如果某种风格(如加粗或斜体)是不是你的系统,你将无法创建它。
Each font is reached by making a FontFamily object; such a FontFamily then contains Font objects for each style that is available. If a certain style (such as 'bold' or 'italic') is not available on your system, you won't be able to create it.
您可以测试是否这是通过使用FontFamily.IsStyleAvailable的情况。这里定义为 :
You can test whether this is the case by using the FontFamily.IsStyleAvailable. Defined here as:
public bool IsStyleAvailable(
FontStyle style
)
如果你想创建一个字体,你必须确保它的系统上可用的第一个(这意味着你将不得不使用一个共同的字体或打包的字体与如果你想要一个不常用的解决方案)。
If you want to create a font, you'll have to make sure it's available on the system first (which means you'll have to use a common font or package the font with your solution if you want an uncommon one).
这篇关于字体不支持任何风格像'普通'大胆''斜体'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!