41class Q_SVG_EXPORT
QSvgFont :
public QSvgRefCounted
44 static constexpr qreal DEFAULT_UNITS_PER_EM = 1000;
45 QSvgFont(qreal horizAdvX);
47 void setFamilyName(
const QString &name);
48 QString familyName()
const;
50 void setUnitsPerEm(qreal upem);
52 void addGlyph(
const QString &unicode,
const QPainterPath &path, qreal horizAdvX = -1);
53 bool addMissingGlyph(
const QPainterPath &path, qreal horizAdvX);
55 void draw(QPainter *p,
const QPointF &point,
const QList<
const QSvgGlyph *> &glyphs,
56 qreal pixelSize, Qt::Alignment alignment)
const;
57 QRectF boundingRect(QPainter *p,
const QPointF &point,
const QList<
const QSvgGlyph *> &glyphs,
58 qreal pixelSize, Qt::Alignment alignment)
const;
59 const QSvgGlyph *findFirstGlyphFor(QStringView text)
const;
60 QList<
const QSvgGlyph *> toGlyphs(QStringView text)
const;
64 qreal m_unitsPerEm = DEFAULT_UNITS_PER_EM;
67 std::unique_ptr<
const QSvgGlyph> m_missingGlyph;
72 QList<QSvgGlyph> m_glyphs;
76 mutable QHash<
char32_t, QList<qsizetype>> m_possibleGlyphIndicesForChar;
77 mutable qsizetype m_firstUnscannedGlyphIdx = 0;
79 void draw_helper(QPainter *p,
const QPointF &point,
80 const QList<
const QSvgGlyph *> &glyphs, qreal pixelSize,
81 Qt::Alignment alignment, QRectF *boundingRect =
nullptr)
const;