summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-03-21 03:06:24 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-03-21 03:06:24 +0100
commit919298e8c19939008ed2d3b22bcb91e0eca5abd6 (patch)
treeb4bca8e3926dc2fa407b8bd21cd67188bd980b97 /src
parentebed03c59791ea654c304ed8bd71acafd120fd9a (diff)
parent2c67415afc2e12bab958e16b18bcab88a537c248 (diff)
downloadqtsvg-919298e8c19939008ed2d3b22bcb91e0eca5abd6.tar.gz
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I3b34cd3eea8dba0047a8eebe36f3caeef0195069
Diffstat (limited to 'src')
-rw-r--r--src/svg/qsvghandler.cpp9
-rw-r--r--src/svg/qsvgstyle.cpp2
-rw-r--r--src/svg/qsvgstyle_p.h2
3 files changed, 8 insertions, 5 deletions
diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp
index 68929e3..0d2e28e 100644
--- a/src/svg/qsvghandler.cpp
+++ b/src/svg/qsvghandler.cpp
@@ -1362,9 +1362,12 @@ static void parseFont(QSvgNode *node,
}
if (!fontStyle)
fontStyle = new QSvgFontStyle;
-
- if (!attributes.fontFamily.isEmpty() && attributes.fontFamily != QT_INHERIT)
- fontStyle->setFamily(attributes.fontFamily.toString().trimmed());
+ if (!attributes.fontFamily.isEmpty() && attributes.fontFamily != QT_INHERIT) {
+ QString family = attributes.fontFamily.toString().trimmed();
+ if (family.at(0) == QLatin1Char('\'') || family.at(0) == QLatin1Char('\"'))
+ family = family.mid(1, family.length() - 2);
+ fontStyle->setFamily(family);
+ }
if (!attributes.fontSize.isEmpty() && attributes.fontSize != QT_INHERIT) {
// TODO: Support relative sizes 'larger' and 'smaller'.
diff --git a/src/svg/qsvgstyle.cpp b/src/svg/qsvgstyle.cpp
index f981931..924cca0 100644
--- a/src/svg/qsvgstyle.cpp
+++ b/src/svg/qsvgstyle.cpp
@@ -232,7 +232,7 @@ void QSvgFontStyle::apply(QPainter *p, const QSvgNode *, QSvgExtraStates &states
QFont font = m_oldQFont;
if (m_familySet) {
states.svgFont = m_svgFont;
- font.setFamily(m_qfont.family());
+ font.setFamilies(m_qfont.families());
}
if (m_sizeSet)
diff --git a/src/svg/qsvgstyle_p.h b/src/svg/qsvgstyle_p.h
index 5e0b7cc..41d0e11 100644
--- a/src/svg/qsvgstyle_p.h
+++ b/src/svg/qsvgstyle_p.h
@@ -348,7 +348,7 @@ public:
void setFamily(const QString &family)
{
- m_qfont.setFamily(family);
+ m_qfont.setFamilies({family});
m_familySet = 1;
}