Xcode 5 中的自定义字体 [英] Custom Fonts in Xcode 5
本文介绍了Xcode 5 中的自定义字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您将如何在 Xcode 5 中添加自定义字体以及如何将项目中的每个标签更改为该字体?因为我听说您只能以编程方式执行此操作?
How would you add a custom font in Xcode 5 and how would you change every label in the project to that font? Because I've heard you can only do this programmatically?
推荐答案
更好的选择是将新字体添加到您的系统/操作系统字体目录,然后从那里它可以添加到故事板中或与 NSAttributed 字符串一起使用.
Much better option is to add the new font to your system/OS fonts directory and then from there it can be added in the storyboard or used with NSAttributed strings.
步骤:
- 下载您的字体 .ttf 文件
- 转到故事板中的任何标签/文本视图,然后在右上角的属性检查器中选择:文本"然后选择>属性"
- 点击字体名称旁边的小T图标打开字体编辑器
- 转到齿轮/滚轮/设置图标并选择管理字体"
- 单击右数第二个+"按钮并导航到您的字体 .ttf 文件以添加到系统字体集合
- 现在通过更改故事板或代码中的字体名称来使用您的字体:)
希望有帮助!
这篇关于Xcode 5 中的自定义字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文