我已经成功地将自定义字体添加到我的项目中,并且通过执行这行代码以及其他操作,它工作得很好:
[sideScoreLabel setFont:[UIFont fontWithName:@"Caveman" size:34]];
但是我希望将此自定义字体加粗。我对此进行了研究,似乎每个人都在说在字体名称末尾添加“-Bold”或“-BoldMT”,使其看起来如下所示:
[sideScoreLabel setFont:[UIFont fontWithName:@"Caveman-Bold" size:34]];
当我运行我的项目时,它似乎不起作用。有谁知道我做错了什么?也许我使用的字体不适用于 Bolding?
谢谢!
最佳答案
I have successfully added a custom font to my project and it works just fine by doing this line of code amongst other things:
伙计,你在你的 iOS 包中添加了一个CUSTOM FONT。
如果您想要该字体的粗体版本,您需要提供一个系统不会为您做的。
关于objective-c - 将自定义字体设置为粗体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11907157/