Question

Is it possible to use UIButtons with my own true type font? I found the FontLabel open source that can use ttf with UILabels, but unfortunately I can't set my UIButton's titleLabel to a created FontLabel. Can someone offer a simple solution to this? Or should I just not be using UIButtons altogether and instead use something else? I feel like I'm missing something obvious because I can't imagine there wouldn't be some truetype functionality in some default button offering.

Was it helpful?

Solution

As of the 3.2 SDK, you can include your own ttf fonts in your app. Just include the font file in your bundle and add the UIAppFonts key to your info.plist. (http://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW18)

You should then be able to create the font as you would any built-in font and use it as the font for your button's label.

OTHER TIPS

For those of you having this problem and looking for a workaround, this worked for me (link to a question I posed and later answered):

Advice on Debugging a UIAppFonts Issue on iPad

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top