Sunday, 11 May 2014

Add custom fonts to your iPhone app




Fonts provide your app a niche look. Apple provides various types of fonts installed in the IOS system, but some time's we need to add custom font file in our project to use that font in our app.
In this post i ma going to tell you that how can we use custom fonts in our app.

                                                         First unzip your font file, it must be a .OTF (open type font) or .TTF (true type font). Then drag this font file in your project. Go to .plist file and add a new key in it named Font provide by application, add font name to its first index as this key is of type array this means you can add different kind of fonts in your app.


Now to use this font in your code you can use the same line

 quoteTextView.font = [UIFont  fontWithName:@"Berlin Sans FB Demi" size:16.0];

To  know your font name as  some times the file has different name anad fonts provided by it are of different name. So please traverse though fonts installed in IOS to get the name of font added by you.
You can check this by following below given post
http://www.amaniphoneblog.com/2014/03/iphone-developement-get-list-of-fonts.html

No comments:
Write comments