43class Q_SVG_EXPORT
QSvgFont :
public QSvgRefCounted
46 static constexpr qreal DEFAULT_UNITS_PER_EM = 1000;
47 QSvgFont(qreal horizAdvX);
50 void setFamilyName(
const QString &name);
51 QString familyName()
const;
53 void setUnitsPerEm(qreal upem);
55 void addGlyph(
const QString &unicode,
const QPainterPath &path, qreal horizAdvX = -1);
56 bool addMissingGlyph(
const QPainterPath &path, qreal horizAdvX);
58 void draw(QPainter *p,
const QPointF &point,
const QList<
const QSvgGlyph *> &glyphs,
59 qreal pixelSize, Qt::Alignment alignment)
const;
60 QRectF boundingRect(QPainter *p,
const QPointF &point,
const QList<
const QSvgGlyph *> &glyphs,
61 qreal pixelSize, Qt::Alignment alignment)
const;
62 const QSvgGlyph *findFirstGlyphFor(QStringView text)
const;
63 QList<
const QSvgGlyph *> toGlyphs(QStringView text)
const;
67 qreal m_unitsPerEm = DEFAULT_UNITS_PER_EM;
70 std::unique_ptr<
const QSvgGlyph> m_missingGlyph;
75 QList<QSvgGlyph> m_glyphs;
79 mutable QHash<
char32_t, QList<qsizetype>> m_possibleGlyphIndicesForChar;
80 mutable qsizetype m_firstUnscannedGlyphIdx = 0;
82 void draw_helper(QPainter *p,
const QPointF &point,
83 const QList<
const QSvgGlyph *> &glyphs, qreal pixelSize,
84 Qt::Alignment alignment, QRectF *boundingRect =
nullptr)
const;