--- src/svg/qsvgfont_p.h | 5 ++--- src/svg/qsvghandler.cpp | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) --- src/svg/qsvgfont_p.h.orig +++ src/svg/qsvgfont_p.h @@ -38,6 +38,7 @@ public: class Q_SVG_PRIVATE_EXPORT QSvgFont : public QSvgRefCounted { public: + static constexpr qreal DEFAULT_UNITS_PER_EM = 1000; QSvgFont(qreal horizAdvX); void setFamilyName(const QString &name); @@ -50,9 +51,7 @@ public: void draw(QPainter *p, const QPointF &point, const QString &str, qreal pixelSize, Qt::Alignment alignment) const; public: QString m_familyName; - qreal m_unitsPerEm; - qreal m_ascent; - qreal m_descent; + qreal m_unitsPerEm = DEFAULT_UNITS_PER_EM; qreal m_horizAdvX; QHash m_glyphs; }; --- src/svg/qsvghandler.cpp.orig +++ src/svg/qsvghandler.cpp @@ -2622,7 +2622,7 @@ static bool parseFontFaceNode(QSvgStyleP qreal unitsPerEm = toDouble(unitsPerEmStr); if (!unitsPerEm) - unitsPerEm = 1000; + unitsPerEm = QSvgFont::DEFAULT_UNITS_PER_EM; if (!name.isEmpty()) font->setFamilyName(name);