开发者

Custom font in iphone not being displayed properly

开发者 https://www.devze.com 2023-03-13 16:43 出处:网络
I installed a custom font called \"modern no. 20\" (already installed in my mac) into my iphone project .

I installed a custom font called "modern no. 20" (already installed in my mac) into my iphone project .

I copied the modernno20.ttf into my resources. Now in my app-info.plist i added this font name in "Fonts provided by application".

Then i added

   cell.textLabel.font=[UIFont fontWithName:@"modernno20.ttf" size:14.0];

in my tableviewcode .

开发者_JAVA技巧

i dont know why but this font is not properly displayed.is there any thing i missed?


In order to call the font in your fontWithName call, the string should be the name of the font as it is displayed in the Mac's 'Font Book' app, and not the actual filename of the referenced font file.


There hasn’t been an easy way to add custom fonts to your iPhone applications. As of iOS 4 it has become very easy to do. there could be possibility you would have missed some of the step to get custom font work. Here is what you need to do in order to add custom fonts,

Check How to include ttf fonts to iOS app

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号