From e81dca372a3bb2e4714f3a19c463f51c72c38b5b Mon Sep 17 00:00:00 2001 From: pipu Date: Wed, 10 Dec 2014 15:46:58 +0800 Subject: [PATCH] Update that sets default value of font name for ButtonReader, TextFieldReader, TextReader --- .../cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp | 2 +- .../cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp | 2 +- .../cocostudio/WidgetReader/TextReader/TextReader.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp index 6c9e033d6a..deaf7d8ea5 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp @@ -232,7 +232,7 @@ namespace cocostudio button->setTitleFontSize(DICTOOL->getIntValue_json(options, P_FontSize,14)); - button->setTitleFontName(DICTOOL->getStringValue_json(options, P_FontName)); + button->setTitleFontName(DICTOOL->getStringValue_json(options, P_FontName, "")); diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp index 1eee293581..b33361f506 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp @@ -107,7 +107,7 @@ namespace cocostudio textField->setFontSize(DICTOOL->getIntValue_json(options, P_FontSize,20)); - textField->setFontName(DICTOOL->getStringValue_json(options, P_FontName)); + textField->setFontName(DICTOOL->getStringValue_json(options, P_FontName, "")); bool tsw = DICTOOL->checkObjectExist_json(options, P_TouchSizeWidth); bool tsh = DICTOOL->checkObjectExist_json(options, P_TouchSizeHeight); diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp index 04d3338253..8cb192efe1 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp @@ -111,7 +111,7 @@ namespace cocostudio label->setFontSize(DICTOOL->getIntValue_json(options, P_FontSize,20)); - std::string fontName = DICTOOL->getStringValue_json(options, P_FontName); + std::string fontName = DICTOOL->getStringValue_json(options, P_FontName, ""); std::string fontFilePath = jsonPath.append(fontName); if (FileUtils::getInstance()->isFileExist(fontFilePath))