[英]NSMutableAttributedString Italic and Bold do not work at the same time
我需要斜体和粗体NSMutableAttributedString
,我尝试了一些组合,但只有一个属性工作。
[attributedText addAttributes:@{NSFontAttributeName:[UIFont italicSystemFontOfSize:14], NSFontAttributeName:[UIFont boldSystemFontOfSize:boldTextFontSize]}
range:range3];
和
[attributedText addAttributes:@{NSFontAttributeName:[UIFont italicSystemFontOfSize:14]}
range:range3];
[attributedText addAttributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:boldTextFontSize]}
range:range3];
其中只有一个应用于字符串。 有没有切实可行的方法来解决这个问题?
字体文件包含所有可显示的字符,但只包含一个(!)样式。 要显示粗体斜体字体,您必须加载包含粗体斜体符号的文件。
您无法加载2个字体文件,并希望操作系统将它们混合起来......
如果没有粗斜体字体,则需要使用自定义字体。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.