From fb3e499d9d3f51cd6b948d5ad145de1a0c6b477c Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 2 Jul 2014 10:08:04 +0800 Subject: [PATCH] fix Text reader font name --- .../cocostudio/WidgetReader/TextReader/TextReader.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp index f7f0170bc7..808ab2002a 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp @@ -48,7 +48,9 @@ namespace cocostudio stExpCocoNode *stChildArray = cocoNode->GetChildArray(); Text* label = static_cast(widget); - + + std::string jsonPath = GUIReader::getInstance()->getFilePath(); + for (int i = 0; i < cocoNode->GetChildNum(); ++i) { std::string key = stChildArray[i].GetName(cocoLoader); @@ -67,7 +69,8 @@ namespace cocostudio }else if(key == P_FontSize){ label->setFontSize(valueToInt(value)); }else if(key == P_FontName){ - label->setFontName(value); + std::string fontFilePath = jsonPath.append(value); + label->setFontName(fontFilePath); }else if(key == P_AreaWidth){ label->setTextAreaSize(Size(valueToFloat(value), label->getTextAreaSize().height)); }else if(key == P_AreaHeight){