Xcode 5中的自定义字体 [英] Custom Fonts in Xcode 5
本文介绍了Xcode 5中的自定义字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
更好的选择是将新的字体添加到您的系统/操作系统字体目录,然后从那里添加故事板或与NSAttributed字符串一起使用。
步骤:
- 下载字体.ttf文件
- 转到故事板中的任何标签/文本视图,然后选择右上角的属性检查器:文本然后选择>归因 打开字体编辑器的字体名称
- 转到cog / wheel / setting图标并选择管理字体
- 单击第二个现在通过更改故事板或代码中的字体名称来使用您的字体:)
希望有帮助!
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?
解决方案
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.
Steps:
- Download your font .ttf files
- Go to any label/textview in your storyboard and select in top right attributes inspector: "Text" Then select > "Attributed"
- Click the little T icon next to the font name to open up the fonts editor
- Go to the cog/wheel/setting icon and select "Manage Fonts"
- Click the second from right "+" button and navigate to your fonts .ttf file to add to system fonts collection
- Now use your font by changing the font name in the storyboard or code :)
Hope that helps!
这篇关于Xcode 5中的自定义字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文