Xcode 5中的自定义字体 [英] Custom Fonts in Xcode 5

查看:195
本文介绍了Xcode 5中的自定义字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Xcode 5中添加自定义字体,以及如何将项目中的每个标签更改为该字体?因为我听说你只能做到这一点编程?

解决方案

更好的选择是将新的字体添加到您的系统/操作系统字体目录,然后从那里添加故事板或与NSAttributed字符串一起使用。



步骤:


  1. 下载字体.ttf文件

  2. 转到故事板中的任何标签/文本视图,然后选择右上角的属性检查器:文本然后选择>归因 打开字体编辑器的字体名称
  3. 转到cog / wheel / setting图标并选择管理字体

  4. 单击第二个现在通过更改故事板或代码中的字体名称来使用您的字体:)

希望有帮助!


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:

  1. Download your font .ttf files
  2. Go to any label/textview in your storyboard and select in top right attributes inspector: "Text" Then select > "Attributed"
  3. Click the little T icon next to the font name to open up the fonts editor
  4. Go to the cog/wheel/setting icon and select "Manage Fonts"
  5. Click the second from right "+" button and navigate to your fonts .ttf file to add to system fonts collection
  6. Now use your font by changing the font name in the storyboard or code :)

Hope that helps!

这篇关于Xcode 5中的自定义字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆