问题
does Apple support usage of tally fonts ? i'm using this tally from here :http://www.subtangent.com/maths/resources.php
with this coding:
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".
回答1:
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.
if still not working then may be something wrong in ttf file.
来源:https://stackoverflow.com/questions/8484937/can-i-use-a-tally-marks-fonts-in-uilabel