Just came to this company, began to carry out the real project development of Cocos2d-x, in order to be able to better expand later, change little, decided to use 3. x version development, and use the UI editor. In the import, today encountered a problem, Buffer is too small, searched a lot, but there is no solution to the solution, and finally found a wrong inducement, because the UI used the label, so I tried to find it is really a label caused by the problem, Each run exception occurs in the CCDevice.cpp
strcpy_s (Tnewfont.lffacename, Lf_facesize, Fontname.c_str ()) in bool SetFont (const char * pfontname = NULL, int nSize = 0); Because Fontname.c_str () is too long to cross the border, Tnewfont.lffacename length is only 32 bytes, and then see why FontName is too long, while others are normal, found in TextRead.cpp file
void Textreader::setpropsfromjsondictionary (Widget *widget, const rapidjson::value &options).
std::string fontname = Dictool->getstringvalue_json (options, P_fontname, "Microsoft Jas Black");
std::string Fontfilepath = Jsonpath.append (FontName);
Label->setfontname (Fontfilepath);
These lines of code will fontfilepath the path to the increase, in fact, only by passing fontname on the line, so, instead of
std::string fontname = Dictool->getstringvalue_json (options, P_fontname, "Microsoft Jas Black");
std::string Fontfilepath = Jsonpath.append (FontName);
Label->setfontname (FontName);
Normal after compilation.