40class Q_SVG_EXPORT
QSvgFont :
public QSvgRefCounted
43 static constexpr qreal DEFAULT_UNITS_PER_EM = 1000;
44 QSvgFont(qreal horizAdvX);
46 void setFamilyName(
const QString &name);
47 QString familyName()
const;
49 void setUnitsPerEm(qreal upem);
51 void addGlyph(QChar unicode,
const QPainterPath &path, qreal horizAdvX = -1);
52 bool addMissingGlyph(
const QPainterPath &path, qreal horizAdvX);
54 void draw(QPainter *p,
const QPointF &point,
const QString &str,
55 qreal pixelSize, Qt::Alignment alignment)
const;
56 QRectF boundingRect(QPainter *p,
const QPointF &point,
const QString &str,
57 qreal pixelSize, Qt::Alignment alignment)
const;
61 qreal m_unitsPerEm = DEFAULT_UNITS_PER_EM;
64 std::unique_ptr<
const QSvgGlyph> m_missingGlyph;
65 QHash<QChar, QSvgGlyph> m_glyphs;
68 void draw_helper(QPainter *p,
const QPointF &point,
const QString &str, qreal pixelSize,
69 Qt::Alignment alignment, QRectF *boundingRect =
nullptr)
const;