gpt4 book ai didi

ios - 斜体字体不适用于 XCode

转载 作者:行者123 更新时间:2023-11-28 22:26:33 25 4
gpt4 key购买 nike

我已将我的 ttf 字体 (ABeeZee-Italic.ttf) 从 Google WebFonts 复制到支持文件中并添加到 plist 中:

enter image description here

并为我的 Label 分配 tag = 4 :

enter image description here

因为我有这段代码可以将字体嵌入到 UILabel 中:

for (UILabel *customLabel in [[self view] subviews]) {
if (customLabel.tag == 1) {
[customLabel setFont:[UIFont fontWithName:@"Raleway-ExtraLight" size:21]];
} else if (customLabel.tag==2){
[customLabel setFont:[UIFont fontWithName:@"ABeeZee-Regular" size:14]];
} else if (customLabel.tag==3){
[customLabel setFont:[UIFont fontWithName:@"ABeeZee-Regular" size:11]];
} else if (customLabel.tag==4){
[customLabel setFont:[UIFont fontWithName:@"ABeeZee-Italic" size:12]];
}
}

一切正常,但斜体字体未加载到我的 iPod (iOS 6.1.3) 中。带有标签 4 的 UILabel 是 iOS 系统字体。不是 ABeeZee-Italic。

我尝试更改标签号,但也失败了。 iOS 中嵌入非常规字体有什么具体要求吗?

谢谢

更新@iPatel 回答:这是我的 FontBook 的样子,它有相同的名字...... enter image description here

最佳答案

检查“FontBook”中字体(ABeeZee-Italic) 的真实名称是什么?并写下“FontBook”中的字体名称。

然后使用这样的

[myLabelName  setFont: [UIFont fontWithName:@"Font Name From Font Book" size:32]];

有关如何在应用程序中添加自定义字体的更多信息。然后阅读 This Answer.

已编辑:

也试试

  • 从您的项目中选择您的字体
  • 右击
  • 使用外部编辑器打开
  • 安装字体
  • 选择插入的字体
  • 并检查什么是“全名”,将其复制并粘贴到您的代码中:

可能会有帮助:)

关于ios - 斜体字体不适用于 XCode,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18798560/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com