[英]Must one add custom font file to info.plist in Xcode?
Just a question about adding a custom font in Xcode.只是关于在 Xcode 中添加自定义字体的问题。 After I add it to my project's resources as a ttf file, I can use it inside a label in my storyboard for example.
在我将它作为 ttf 文件添加到我的项目资源后,我可以在我的 storyboard 中的 label 中使用它。 But do I need to add it to the info.plist file too?
但是我是否也需要将它添加到 info.plist 文件中?
Yes, you must add custom fonts to your Info.plist. 是的,您必须将自定义字体添加到Info.plist中。 You do this with the
UIAppFont
Info.plist key (which shows up as Fonts provided by application
in the plist editor). 您可以使用
UIAppFont
Info.plist键(在plist编辑器中显示为Fonts provided by application
)来执行此操作。
Here is the relevant documentation . 这是相关文档 。
And an example: 一个例子:
<key>UIAppFonts</key>
<array>
<string>SomeFont.otf</string>
<string>SomeOtherFont.otf</string>
</array>
I have recently done the same thing.我最近做了同样的事情。
+
+
添加新属性Fonts provided by application
Fonts provided by application
item-0
.item-0
的项目。item-0
key can remain as it is. item-0
键可以保持原样。 And give the value as font_name.otf.+
under Fonts provided by application
.Fonts provided by application
下的+
即可。 And it will create keys like item-1, item-2 and so on.
item-1, item-2 and so on.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.