diff --git a/src/plugins/qmldesigner/assetexporterplugin/parsers/textnodeparser.cpp b/src/plugins/qmldesigner/assetexporterplugin/parsers/textnodeparser.cpp index 9b797ad77db..dfbc78a75d9 100644 --- a/src/plugins/qmldesigner/assetexporterplugin/parsers/textnodeparser.cpp +++ b/src/plugins/qmldesigner/assetexporterplugin/parsers/textnodeparser.cpp @@ -27,6 +27,7 @@ #include "assetexportpluginconstants.h" #include +#include #include namespace { @@ -68,10 +69,14 @@ QJsonObject TextNodeParser::json(Component &component) const QJsonObject textDetails; textDetails.insert(TextContentTag, propertyValue("text").toString()); - textDetails.insert(FontFamilyTag, propertyValue("font.family").toString()); - textDetails.insert(FontStyleTag, propertyValue("font.styleName").toString()); - textDetails.insert(FontSizeTag, propertyValue("font.pixelSize").toInt()); - textDetails.insert(LetterSpacingTag, propertyValue("font.letterSpacing").toFloat()); + + QFont font = propertyValue("font").value(); + QFontInfo fontInfo(font); + textDetails.insert(FontFamilyTag, fontInfo.family()); + textDetails.insert(FontStyleTag, fontInfo.styleName()); + textDetails.insert(FontSizeTag, fontInfo.pixelSize()); + textDetails.insert(LetterSpacingTag, font.letterSpacing()); + QColor fontColor(propertyValue("font.color").toString()); textDetails.insert(TextColorTag, fontColor.name(QColor::HexArgb));