diff --git a/cocos2dx/label_nodes/CCFontAtlasFactory.cpp b/cocos2dx/label_nodes/CCFontAtlasFactory.cpp index 5682a68789..e1bcbf5f6e 100644 --- a/cocos2dx/label_nodes/CCFontAtlasFactory.cpp +++ b/cocos2dx/label_nodes/CCFontAtlasFactory.cpp @@ -21,12 +21,12 @@ const char *FontAtlasFactory::glyphNEHE = "!\"#$%&'()*+,-./0123456789:;<=>?@ABC -FontAtlas * FontAtlasFactory::createAtlasFromTTF(const char* tttFilePath, int fontSize, GlyphCollection glyphs, const char *customGlyphs) +FontAtlas * FontAtlasFactory::createAtlasFromTTF(const char* fntFilePath, int fontSize, GlyphCollection glyphs, const char *customGlyphs) { FontDefinitionTTF *def = 0; if ( (glyphs == GlyphCollection::NEHE) || (glyphs == GlyphCollection::ASCII) ) { - def = FontDefinitionTTF::create(tttFilePath, fontSize, getGlyphCollection(glyphs)); + def = FontDefinitionTTF::create(fntFilePath, fontSize, getGlyphCollection(glyphs)); } else { @@ -43,7 +43,7 @@ FontAtlas * FontAtlasFactory::createAtlasFromTTF(const char* tttFilePath, int fo return nullptr; } - def = FontDefinitionTTF::create(tttFilePath, fontSize, customGlyphs); + def = FontDefinitionTTF::create(fntFilePath, fontSize, customGlyphs); } } diff --git a/cocos2dx/label_nodes/CCFontAtlasFactory.h b/cocos2dx/label_nodes/CCFontAtlasFactory.h index 5ff60d379f..ab1a1da700 100644 --- a/cocos2dx/label_nodes/CCFontAtlasFactory.h +++ b/cocos2dx/label_nodes/CCFontAtlasFactory.h @@ -35,8 +35,8 @@ class CC_DLL FontAtlasFactory public: - static FontAtlas * createAtlasFromTTF(const char* tttFilePath, int fontSize, GlyphCollection glyphs, const char *customGlyphs = 0); - static FontAtlas * createAtlasFromFNT(const char* tttFilePath); + static FontAtlas * createAtlasFromTTF(const char* fntFilePath, int fontSize, GlyphCollection glyphs, const char *customGlyphs = 0); + static FontAtlas * createAtlasFromFNT(const char* fntFilePath); private: diff --git a/cocos2dx/label_nodes/CCLabel.cpp b/cocos2dx/label_nodes/CCLabel.cpp index 6be7a0f1e4..553b4e05f4 100644 --- a/cocos2dx/label_nodes/CCLabel.cpp +++ b/cocos2dx/label_nodes/CCLabel.cpp @@ -31,9 +31,9 @@ NS_CC_BEGIN -Label* Label::createWithTTF( const char* label, const char* tttFilePath, int fontSize, GlyphCollection glyphs, int lineSize, const char *customGlyphs ) +Label* Label::createWithTTF( const char* label, const char* fntFilePath, int fontSize, GlyphCollection glyphs, int lineSize, const char *customGlyphs ) { - FontAtlas *tempAtlas = FontAtlasCache::getFontAtlasTTF(tttFilePath, fontSize, glyphs, customGlyphs); + FontAtlas *tempAtlas = FontAtlasCache::getFontAtlasTTF(fntFilePath, fontSize, glyphs, customGlyphs); if (!tempAtlas) return nullptr; diff --git a/cocos2dx/label_nodes/CCLabel.h b/cocos2dx/label_nodes/CCLabel.h index e0e6b2fd1f..80fff701a6 100644 --- a/cocos2dx/label_nodes/CCLabel.h +++ b/cocos2dx/label_nodes/CCLabel.h @@ -43,7 +43,7 @@ class CC_DLL Label : public SpriteBatchNode, public LabelProtocol, public RGBAPr { public: - static Label* createWithTTF( const char* label, const char* tttFilePath, int fontSize, GlyphCollection glyphs = GlyphCollection::NEHE, int lineSize = 0, const char *customGlyphs = 0 ); + static Label* createWithTTF( const char* label, const char* fntFilePath, int fontSize, GlyphCollection glyphs = GlyphCollection::NEHE, int lineSize = 0, const char *customGlyphs = 0 ); static Label* createWithBMFont( const char* label, const char* bmfontFilePath, int lineSize = 0 ); virtual ~Label(); diff --git a/cocos2dx/label_nodes/CCLabelTextFormatter.cpp b/cocos2dx/label_nodes/CCLabelTextFormatter.cpp index 1b2adb98e2..2e739832d1 100644 --- a/cocos2dx/label_nodes/CCLabelTextFormatter.cpp +++ b/cocos2dx/label_nodes/CCLabelTextFormatter.cpp @@ -38,8 +38,8 @@ bool LabelTextFormatter::multilineText(LabelTextFormatProtocol *theLabel) if (theLabel->getMaxLineWidth()) { // Step 1: Make multiline - vector str_whole = cc_utf16_vec_from_utf16_str(theLabel->getUTF8String()); - unsigned int stringLength = str_whole.size(); + vector strWhole = cc_utf16_vec_from_utf16_str(theLabel->getUTF8String()); + unsigned int stringLength = strWhole.size(); vector multiline_string; multiline_string.reserve( stringLength ); @@ -74,7 +74,7 @@ bool LabelTextFormatter::multilineText(LabelTextFormatProtocol *theLabel) if (i >= stringLength) break; - unsigned short character = str_whole[i]; + unsigned short character = strWhole[i]; if (!start_word) { @@ -106,7 +106,7 @@ bool LabelTextFormatter::multilineText(LabelTextFormatProtocol *theLabel) if (i >= stringLength) break; - character = str_whole[i]; + character = strWhole[i]; if (!startOfWord) {