我可以在UILabel中使用Tally标记字体吗? [英] Can i use a Tally marks fonts in UILabel?

查看:44
本文介绍了我可以在UILabel中使用Tally标记字体吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Apple是否支持使用提示字体?我正在从这里使用此提示:http://www.subtangent.com/maths/resources.php

does Apple support usage of tally fonts ? i'm using this tally from here :http://www.subtangent.com/maths/resources.php

使用此编码:

  UILabel *subtitle = [[UILabel alloc]initWithFrame:CGRectMake(125, 2, 185, 30)];
    [subtitle setBackgroundColor:[UIColor clearColor]];
    [subtitle setFont:[UIFont fontWithName:@"Tally_Regular.ttf" size:19.0]];
   [subtitle setText:@"5"];
    [subtitle setTextColor:[UIColor blackColor]];
    [fLikeThis    addSubview:subtitle];

但是它不能按预期工作,不知道为什么还要在应用程序提供的字体"中输入字体名称.

However it does't work as expected, not sure why as i also entered the font name in "Fonts provided by application".

推荐答案

在应用程序提供的字体"中,您需要添加文件名,例如您的ttf文件而不是字体名称修改您的信息列表,如下:-

In "Fonts provided by application" you need to add file name e.g. your ttf file not font name modify your info plist as follow:-

<key>UIAppFonts</key>
<array>
    <string>yourfontfilename.ttf </string>
</array>

并在标签中使用字体名称:-

and use font name in label :-

[subtitle setFont:[UIFont fontWithName:@"fontname" size:19.0]];//This is your font name not your font file name.You can get font name by opening it with fontbook in mac.

如果仍然无法正常工作,则可能是ttf文件中出现了问题.

if still not working then may be something wrong in ttf file.

这篇关于我可以在UILabel中使用Tally标记字体吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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