Now, inorder to use customer ttf font, you should do some more work. I will use TestCpp as example to describe the steps.
* Add your custom font files into your project using XCode as a resource
* Add full name of customer ttf into your application’s info.plist
* Use ttf file in codes(only use font name without directory and .ttf)
Please refer to samples/TestCpp/Classes/FontTest/FontTest.cpp for detail information.
如果传入错误的话,通过CCLabelTTF的getContentSize()来获得字符串的高度通常是错误的
* Add your custom font files into your project using XCode as a resource
* Add full name of customer ttf into your application’s info.plist
* Use ttf file in codes(only use font name without directory and .ttf)
Please refer to samples/TestCpp/Classes/FontTest/FontTest.cpp for detail information.
On iOS, use just pass font name to CCLabelTTF create an instance of CCLabelTTF. On other platforms, you should use full name.
CCLabeTTF* label = NULL;
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
label = CCLabeTTF::create("HelloWorld", "fonts/A Damn Mess.ttf", 32);
#else
label = CCLabeTTF::create("HelloWorld", "A Damn Mess", 32);
#endif
如果传入错误的话,通过CCLabelTTF的getContentSize()来获得字符串的高度通常是错误的