Has anyone had success using custom otf fonts on the iPhone?

BP. picture BP. · Sep 3, 2009 · Viewed 26.5k times · Source

It looks like there a few working solutions for using custom true type fonts (ttf) on the iPhone, most notably Can I embed a custom font in an iPhone application? However, this method does not support open type fonts (otf).

Has anyone come across a way to make use of otf typefaces?

Answer

Rodo picture Rodo · Jan 6, 2011

For my own project I wanted to use the opentype font and I basically used this method:

Add your custom font file into your project using XCode as a resource Add a key to your info.plist file (Fonts provided by application) For each font you have, enter the full name of your font file (including the extension) save info.plist then use this for your labels (ex:)

UIFont* font = [UIFont fontWithName:@"Harrowprint" size:20];

In my case @"Harrowprint" was the filename without the extension and not the font name provided by Finder.

My font was an otf and it worked...so I guess it's supported...or I was lucky. I'll test another font..and keep you posted..

references: