You need to take a few steps:
1) Make sure you have font distribution rights. Most fonts - even free ones - do not allow you to distribute them. Including them in your application is likely to be โdistributedโ and considered illegal.
2) Copy the font to the "Resources" folder in the application. Make sure it is in the build phase of the copy files.
3) Add the "Fonts provided by the application" key to the plist file and add the full name of the font file (including the extension)
4) Get the "name" of the font by inserting a temporary line of code:
NSLog(@"%@",[UIFont familyNames]);
Build and run the application. This will print to the console the family names of all the fonts on the device. Find one that matches your font.
You can then use this font name in the fontWithName: method.
August
source share