fix Text reader font name

This commit is contained in:
andyque 2014-07-02 10:08:04 +08:00
parent 60a791ac12
commit fb3e499d9d
1 changed files with 5 additions and 2 deletions

View File

@ -49,6 +49,8 @@ namespace cocostudio
Text* label = static_cast<Text*>(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){