How can I add Copperplate Gothic Bold font in my iPhone program?
I need to display text in cocos2d layer. I added UITextView. I added some text to the View text. But for setting the font (UIFont class) I couldn't do that. I've seen a list of supported fonts for iPhone. Copperplate Gothic Bold is not on this list. I downloaded it from the net. It works well for CCLabel and CCFontMenuItem. How can I get it to work for UILabel?
* Assertion failed - [UILabel setFont:], / SourceCache / UIKit / UIKit-963.10 / UILabel.m: 445 2010-05-19 16: 07: 43.282 testOfGameScreen [1155: 207]
* Application terminated due to unmapped exception "NSInternalInconsistencyException ", reason:" Invalid parameter, not matching: font! = nil "2010-05-19 16: 07: 43.285 testOfGameScreen [1155: 207] Stack :(
I am getting the above error when using UIFont with Copperplate Gothic Bold
Thanks.
a source to share
Displaying a font that is not yet present in the iphone is not easy. The developers have their own workarounds and I can share one or two with you.
Zyngas Font label (http://github.com/zynga/FontLabel) is a popular method. I don't have any personal experience, but a Google search will tell you that this is an acceptable solution.
If you are trying to display one or two lines of text, you can try a solution based on this link . The example provided is only capable of displaying text on one line, but you can easily modify it to display multiline text. Remember that this method draws text as images and you cannot copy / paste it.
a source to share