Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 432
BP. Avatar asked Sep 03 '09 04:09

BP.


People also ask

How use OTF font in IOS?

Add the Font File to Your Xcode Project To add a font file to your Xcode project, select File > Add Files to “Your Project Name” from the menu bar, or drag the file from Finder and drop it into your Xcode project. You can add True Type Font (. ttf) and Open Type Font (. otf) files.

Does Apple use OTF or TTF?

The TrueType font is the most common font format used by both Mac OS X and Windows platforms. TTF package containing the font included both the screen and the printer font data in a single file.

Is TTF better the OTF?

The Differences Between OTF and TTF For most of us non-designers, the additional options will likely go unused. In other words, OTF is indeed the "better" of the two due to the additional features and options, but for the average computer user, those differences don't really matter.

How can I add fonts to my iPhone?

You can download fonts from the App Store app , then use them in documents you create on iPhone. After you download an app containing fonts from the App Store, open the app to install the fonts. To manage installed fonts, go to Settings > General, then tap Fonts.


2 Answers

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:

  • http://blog.beefyapps.com/2010/06/custom-fonts-in-ios-4/
  • Can I embed a custom font in an iPhone application?
like image 96
Rodo Avatar answered Sep 26 '22 03:09

Rodo


Must you use an otf font on the device or can you convert it to ttf? It is relatively straightforward to convert an OTF font to a TTF font using a tool such as fontforge, perhaps that would be an easy solution.

like image 43
Joey Hagedorn Avatar answered Sep 23 '22 03:09

Joey Hagedorn