3

Where can I find a list of supported fonts for CCLabelTTF? If I try setting the font of a CCLabel to a font like Bank Gothic xcode says that the font was unable to load. If you go to Edit>Format>Font>Show Fonts in xcode it gives you a list of the fonts in xcode and Bank Gothic is one of them so why wont it work with CCLabelTTF?

Thanks!

-Magnus

Praxder
  • 2,315
  • 4
  • 32
  • 51

2 Answers2

4

Included fonts are :

"American Typewriter"
"Arial"
"Arial Rounded MT Bold"
"Courier New"
"Georgia"
"Helvetica"
"Marker Felt"
"Times New Roman"
"Trebuchet MS"
"Verdana"
"Zapfino"

But you can add fonts very simply: Using custom fonts in Cocos2d

Community
  • 1
  • 1
Majster
  • 3,611
  • 5
  • 38
  • 60
  • FYI, I just posted a Q&A regarding setting custom fonts. Cocos2d (or maybe it's iOS, not sure) can be a bit quirky. My guide is similar to the one list above, however it does add a couple extra steps and mentions a few "gotchas" of the font system in Cocos2d. It's worth at least taking a read. Anyway, here is my Q&A (http://stackoverflow.com/questions/14508675/how-can-i-add-a-font-to-my-cocos2d-ios-project-and-use-it-with-a-cclabelttf) – RLH Jan 25 '13 at 12:06
1

CCLabelTTF don't "support" any font. It just can render text with any font, that is available on the device. So, your mac has this font, but maybe, there is no such font on the iOS device. Anyway, you can add any font to the app as resource. Just don't forget to add it to the "Fonts provided by application" section of your info.plist.

Morion
  • 10,495
  • 1
  • 24
  • 33