Can't create CCLabelTTF with system font!

Can't create CCLabelTTF with system font!
0.0 0


I create a CCLabelTTF simply with “Arial”, which is also the default font name implementing in CCFreeTypeFont. But in CCFreeTypeFont::loadSystemFont() is simply return nullptr for WP8!

How to use system font instead of carry many .ttf files in the packages, especially for the huge chinese fonts?

WP8 not support FreeType font?

Finally, I find a way to use system font. Modify method loadSystemFont() in CCFreeTypeFont.cpp.

Using the following code to replace “return nullptr”.

unsigned char* CCFreeTypeFont::loadSystemFont(const char *pFontName, unsigned long *size) 
    std::string fontName(pFontName);
    if (fontName.find(".ttf") == -1)
        fontName += ".ttf";
    std::string fontPath = "C:\\Windows\\Fonts\\" + fontName;
    return CCFileUtils::sharedFileUtils()->getFileData(fontPath.c_str(), "rb", size);


Thank you for sharing this information. It works great and allowed me to use the Yu Gothic-systemfont for showing Japanese text. I am working with version 2.2.3 by the way and as far as I could see, this code is not in the official release, but should be imho.