0
votes

Did anyone get custom ttf fonts in SpriteBuilder/Cocos2d-iPhone 3 working?

Ie: For a CCLabelTTF in SpriteBuilder, we can select a ttf file added to the SP project. However after publishing, the font does not display. Do we need to add the font in Info.plist etc as well? I tried it, but couldn't get it working. I tried some different path attempts but couldn't get it working.

For now I do it the old Cocos2d-iPhone 2 way; add the fonts to the xcode project, add the filename to the font settings in Info.plist... then just change it manually per CCLabelTTF. I don't think the SpriteBuilder fonts work yet seeing as you only specify a TTF file for a CCLabelTTF - a ttf file could contain many different fonts (or as far as I remember)

2

2 Answers

1
votes

In info.plist, under "Fonts provided by application", add a new row, and insert the font name including extension.

ScreenShot of example info.plist

0
votes

Hmm. I haven't had to do anything with the plist; everything just's magically worked. The only place where not is when I want to set a font in code...and then I have to pass a long path to the font. And I'm sure the fonts aren't available to non-cocos UI elements, but I don't have any of those....