字体不能在XCode中加载 [英] Font not loading in XCode

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

问题描述

好吧,我想导入一个新的字体到我的应用程序,但没有成功。我有我的.plist中的应用程序键提供的字体,我有我的字体在项目0作为一个字符串和价值AdelleBasic_Bold.otf,我已经将该字体添加到我的项目,我试图用它: / p>

  _myTextField.font = [UIFont fontWithName:@Adelle Basicsize:15]; 



Adelle Basic是我打开Font时的头文件。我也试过没有任何成功:

  _myTextField.font = [UIFont fontWithName:@AdelleBasic_Boldsize:15]; 

有什么建议?

解决方案

这可能不适用于所有的字体,但根据我的经验,Xcode可能很繁琐,我从来没有能够得到它使用otf字体(任何人请发表!),所以我总是转换我的字体使用这个非常优秀的网站 - 在线字体转换器



我将它们转换为ttf字体,它们似乎总是工作正常 - 确保您使用确切的名称(更改文件名字体似乎也停止它的工作)。

希望这有助于。


Well, I want to import a new Font to my application but without success. I have the Fonts provided by application key in my .plist , I have my font in the Item 0 as a String and the value AdelleBasic_Bold.otf, I have added that Font to my project, and I am trying to use it with:

_myTextField.font = [UIFont fontWithName:@"Adelle Basic" size:15];

Adelle Basic is the header of the Font when I open it. I have also tried without any success:

_myTextField.font = [UIFont fontWithName:@"AdelleBasic_Bold" size:15];

Any suggestion?

解决方案

This may well not true for all fonts, but in my experience, Xcode can be fussy, & I've never been able to get it to use otf fonts (anyone who has please post!), so I've always converted my fonts using this really excellent website - Online Font Converter

I convert them to ttf fonts, and they always seem to work fine - make sure you use the exact name (changing the filename of the font seems to stop it working too).

Hope this helps.

这篇关于字体不能在XCode中加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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