Tamil font in iOS

时间秒杀一切 提交于 2019-12-01 12:54:35

问题


I try to install Tamil font name Bamini.ttf in xcode 4.2 and I made the specific changes in info.plist.

Yet its not showing in Interface builder? Can any one help me to sort out this issue?


回答1:


As far as I know new font that you've installed will never be listed in Interface builder.However you can use it in your project like this:

  1. Import yourfont.ttf into your project (check the "copy items into destination group's folder" and "add to targets").

  2. Open appname-info.plist a. add a new row and name it Fonts provided by application (It's an array of strings) b. add an entry with the Bamini.ttf

    Then try the following code

    UIFont *myFont = [UIFont fontWithName:@"Font name" size:18];
    [txtLabel setFont:myFont];
    

*Font name can be different form file name. You can check font name by opening that font.

this will work for sure.



来源:https://stackoverflow.com/questions/12633744/tamil-font-in-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!