2011-12-13 79 views
0

Apple支持使用理貨字體嗎? 我使用這個理貨從這裏:HTTP://www.subtangent.com/maths/resources.php我可以在UILabel中使用Tally標記字體嗎?

與此編碼:

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]; 

但是它簡化版,按預期方式工作,不確定爲什麼我也在「應用程序提供的字體」中輸入了字體名稱。

回答

2

在「應用程序提供的字體」中,您需要添加文件名,例如您的TTF文件不是字體名 修改信息的plist如下: -

<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文件。

+0

感謝您的快速回復....是啊不工作...我猜是ttf文件有問題 – Desmond

相關問題