未设置自定义字体,iPhone [英] Custom font not being set, iPhone
问题描述
我正在尝试将标签的字体更改为Museo_500italic.otf" 我已将其导入到我的项目并将其添加到 p 列表中,但它无法识别该字体.几个月前我用其他字体完成了它,但由于某种原因,这个字体不起作用.我是不是忘记了什么?
I am trying to change the font of a label to "Museo_500italic.otf" I have imported it to my project and added it to the p-list, but it doesn't recognize the font. I've done it with other fonts, a couple of months ago, but this one for some reason isn't working. Am I forgetting something?
这就是我所拥有的:
这给了我 Museo-500 字体:
This gives me Museo-500 for a font:
self.createAccTxt.font = [UIFont fontWithName:@"Museo-500" size:17.5];
这些给了我默认字体:
self.createAccTxt.font = [UIFont fontWithName:@"Museo-500Italic" size:17.5];
self.createAccTxt.font = [UIFont fontWithName:@"Museo-500_Italic" size:17.5];
self.createAccTxt.font = [UIFont fontWithName:@"Museo-500-Italic" size:17.5];
self.createAccTxt.font = [UIFont fontWithName:@"Museo-500italic" size:17.5];
self.createAccTxt.font = [UIFont fontWithName:@"Museo-500_italic" size:17.5];
self.createAccTxt.font = [UIFont fontWithName:@"Museo-500-italic" size:17.5];
推荐答案
在您的 fontWithName:
调用中,带有字体名称的字符串需要与字体手册"应用程序中所写的完全相同,作为 OSX 的一部分.
In your fontWithName:
calls, the string with the font name needs to be precisely as it's written in the "Font Book" app, as part of OSX.
这篇关于未设置自定义字体,iPhone的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!