简体   繁体   English

字体不支持“常规”,“粗体”,“斜体”等任何样式

[英]font does not support any style like 'regular' 'bold' 'Italic'

how can i work with font that dose not support any kind of FontStyle. 我该如何使用不支持任何FontStyle的字体。 by the way, I can not create a font Object from it. 顺便说一句,我不能从中创建字体对象。 help?? 救命??

The font code on Windows (as on any platform I guess) doesn't create new fonts from scratch; Windows上的字体代码(我猜在任何平台上)都不会从头开始创建新字体。 it will rather interpret what fonts are installed / available on your system and give you a way to work with those. 它会解释系统上已安装/可用的字体,并为您提供了一种处理这些字体的方法。

Each font is reached by making a FontFamily object; 通过创建FontFamily对象可以访问每种字体。 such a FontFamily then contains Font objects for each style that is available. 这样,FontFamily就会包含每种可用样式的Font对象。 If a certain style (such as 'bold' or 'italic') is not available on your system, you won't be able to create it. 如果您的系统上无法使用某种样式(例如“粗体”或“斜体”),则将无法创建它。

You can test whether this is the case by using the FontFamily.IsStyleAvailable. 您可以使用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). 如果要创建字体,则必须先确保该字体在系统上可用(这意味着必须使用通用字体或将字体打包到解决方案中才能使用)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使字体斜体和粗体 - Make font italic and bold Pdf锋利的字体样式大胆,斜体和下划线在一起 - Pdf sharp font style Bold,Italic and Underline together 字体不支持“常规”样式 - 在 C# 中使用半粗字体 - Font does not support style 'Regular' - using Semibold fonts in C# 粗体和/或斜体的 RichTextBox 字体样式按钮(如何编码以便可以选择多个而不是替换 - RichTextBox font style button for Bold and/or Italic (how to code so more than one can be chosen instead of replacing ZXing.net 抛出 System.ArgumentException:字体 'Arial' 不支持样式 'Regular' 错误 - ZXing.net throws System.ArgumentException: Font 'Arial' does not support style 'Regular' error C#私人字体集合— FontStyle不支持常规 - C# Private Font Collection — FontStyle Does not Support Regular 如何停止我的粗体/斜体/下划线选项将文本的字体更改回默认字体和大小 - How to stop my bold/italic/underline options changing the text's font back to the default font and size 如何使用C#以不同的颜色,大小,字体,粗体和斜体格式以excel或csv格式写入数据 - How to write data in excel or csv with different color, size , Font , Bold and Italic format using c# ITextSharp一起使用多种字体样式。 即粗体,带下划线,斜体等 - ITextSharp using multiple font styles together. ie Bold, Underlined, italic… etc 通过办公自动化获取整个.docx文本,包括字体和属性(粗体,斜体…) - Get whole .docx text with office automation, including font and properties (as bold, italic…)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM