Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using fonts that aren't on iPhone

I'd like to use some fonts that aren't part of the iPhone OS. I've seen games that use non standard fonts. I can install the fonts, create images for each one in Photoshop and then use those images in the iPhone app. However, I don't think that is a practical way to go. If the color or tint needs to be adjusted (because of background) or size, I'll have to redesign every font I'm using. Is there a better way to do this?

I read this Can I embed a custom font in an iPhone application? and downloaded the open source font label app. However, it crashes most of the time when I try using particular fonts. In regards to the last comment about using UIFont with the fontWithName:size, that certainly doesn't work. Your font variable will be nil. Listing all available fonts reveals why - none of the custom fonts are in the list.

I've also read How do I include a font with my iPhone application?, which definitely does not work. Same as last comment in above link.

like image 808
4thSpace Avatar asked Jun 14 '09 17:06

4thSpace


People also ask

Can you add different fonts to 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.

How do you use fonts on iPhone without app?

You can use your device's built-in font manager under Settings > General > Fonts, where you'll see installed fonts from Font Diner, iFont, and any other font apps you may have downloaded and used. Tap a font and select a typeface to view a sample. Swipe to the left to see additional screens that display the font.

Can you use font without installing?

Too many fonts on the user machine may slow the system down considerably. You can actually get away without installing the font: GDI and GDI+ each provide two ways for you, as a programmer, to add a font for an application to use without installing it. I'll show you how in this article!

Does TTF work on iPhone?

You can install any TrueType (. ttf) or OpenType (. otf) font file on your iPad or iPhone. You can then use this font in most apps like GoodNotes, Procreate, Pages, Keynote, and more.


1 Answers

The correct answer is to use FontLabel, which can be found on GitHub. http://github.com/zynga/FontLabel

I've used that code in several real-world project and it's absolutely fantastic.

UPDATE:

As of iOS 3.2 (iPad only) & iOS 4 on the iPhone, you can package TTF fonts within your app bundle. After entering them into your Info.plist using the UIAppFonts key.

Three step instructions here: http://kgriff.posterous.com/45359635

like image 156
james_womack Avatar answered Sep 29 '22 11:09

james_womack