Apple 支持使用 tally 字体吗? 我正在使用这里的计数: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];
但是它没有按预期工作,不知道为什么,因为我还在“应用程序提供的字体”中输入了字体名称。
最佳答案
在“应用程序提供的字体”中,您需要添加文件名,例如你的 ttf 文件不是字体名称 按如下方式修改您的信息列表:-
<key>UIAppFonts</key>
<array>
<string>yourfontfilename.ttf </string>
</array>
并在标签中使用字体名称:-
[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 文件有问题。
关于iphone - 我可以在 UILabel 中使用 Tally 标记字体吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8484937/