问题描述
在我的应用程序中,我需要添加两种字体:
$ b $ p Insight_screen_Regular-e和Insight_screen_Bold-e
我把它们拖到ttf格式的Xcode项目资源文件夹。在application-info.plist文件中,我已经添加了应用程序提供的字体这个关键字到一个新的行,然后添加了两个项目来添加字体。然后我建立了这个项目。
然而,我无法从xib文件中访问这些字体。可能是什么原因。提前致谢。
阅读。
您可能没有在 fontWithName:size:
中使用正确的字符串。您需要在 fontWithName:size:
中使用 PostScript 的字体名称,您可以在OS X上的Font Book中打开字体,选择字体,然后按cmd + I。
In my app i need to add two fonts:
Insight_screen_Regular-e and Insight_screen_Bold-e
I have dragged and dropped them in the ttf formats to the Xcode project resources folder. In the application-info.plist file I have added the key "Fonts provided by application" to a new row and then added two items for added fonts.Then i built the project.
Yet i am unable to access these fonts from the xib files. What might be the reason. Thanks in advance.
Read this answer.
You're probably not using the right string in fontWithName:size:
. You need to use the PostScript name of the font in fontWithName:size:
, which you can find by opening the font in Font Book on OS X, selecting the font, and pressing cmd+I.
这篇关于无法在iPhone应用程序中添加某些字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!