4
votes

I was wondering that how to load a TTF font from a absolute file path, not relative, which is usually done with [UIFont fontWithName:@"xyz"];

In cocos2d we can do it by using CCLabelBMFont that takes file as parameter, but when use CCLabelTTF it takes the name of font, not the file name.

Is there any workaround to load an external font not embedded with the application but downloaded from some resource as per need ?

2
Even if you downloaded the font as needed, the only way to get the dynamic referencing would be to have it listed in the info.plist file.Bill Burgess

2 Answers

10
votes

Yes, you can do this.

Just copy the font to your project and add this reference in your info.plist. Then you can reference the font name just like any other system font.

enter image description here

0
votes

if I did well understand your question, maybe this post Can I embed a custom font in an iPhone application? will give you an answer.