在iPhone应用程序中不能使用自定义字体 [英] Cannot use custom font in iPhone app

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

问题描述

我的iPhone应用程序中有3个.ttf文件。他们代表这三种字体:




  • Gotham Rounded Book

  • Gotham Rounded Medium

  • Gotham Rounded Bold



我把所有这些放在我的.plist中,但是当我做这:

  NSLog(@%@,[UIFont fontNamesForFamilyName:@Gotham Rounded]); 

这就是记录:

GothamRoundedMedium-Regular,
GothamRoundedBook-Regular



这里有什么问题?截图如下。





解决方案

这可能是由于你的目标没有包含 gothamroundedbold.ttf 如在图像中。
选择援助导航器
检查丢失的字体文件的成员资格。在我的情况下,它被检查,在你的情况下,应该是unchecked。


`


I have 3 .ttf files in my iPhone app. They represent these 3 fonts:

  • Gotham Rounded Book
  • Gotham Rounded Medium
  • Gotham Rounded Bold

I put all of them in my .plist, but only 2 show up when I do this:

NSLog(@"%@",[UIFont fontNamesForFamilyName:@"Gotham Rounded"]);

This is what gets logged:

"GothamRoundedMedium-Regular",
"GothamRoundedBook-Regular"

What is going wrong here? Screenshots below.

解决方案

It might be due to the reason that you haven't included gothamroundedbold.ttf in your target as in image. Select assistance navigator Check the membership of the font file that is missing. In my case it is checked and in your case it should be unchecked.
`

这篇关于在iPhone应用程序中不能使用自定义字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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