不能在项目中包含.ttf字体 [英] Can not include .ttf font into project

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

问题描述

我试图把字体Hipchick加入到我的项目中,但是它不起作用。我已经测试了一些方法,并以此结束:和这个网站。 / b>


更多信息:

字体到你的应用程序,你需要申请/写你的字体的真实姓名,所以检查如何从otf或ttf文件获取字体名称?


I am trying to include the font "Hipchick" into my project but it does not work. I have tested a few methods and ended up with this one: iOS tips: Custom Fonts to try to solve this but it still doesn't work.

Here is some screens and code:

The font is added to the project: "hitch__.ttf"

It is added to the .plist.

It is in the bundle.

Here is the info about the font.

- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.

NSLog(@"hipch___: %@",[UIFont fontNamesForFamilyName:@"Hipchick"]);



testLbl.font = [UIFont fontWithName:@"Hipchick" size:30];
testLbl.text = @"Frank Zappa";
}

I have tried "Hipchick", "hipchick" and "hitch__" but it still display the wrong font.

I would really appreciate any help possible.

解决方案

This is Step for, How to add custom font in Application.

1 - Add .TTF font in your application
2 - Modify the application-info.plist file.
3 - Add the key "Fonts provided by application" to a new row
4 - and add each .TTF file (of font) to each line.

For more info read This and This site.

FOR MOREINFORMATION :

But after adding font to your application, you need to apply/write real name of your font, so check How do I get the font name from an otf or ttf file?

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

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