feat: add letter spacing to builder

This commit is contained in:
2 * r + 2 * t 2026-04-21 00:50:48 +10:00
parent 28d822270b
commit efa0fa2def
2 changed files with 6 additions and 0 deletions

View file

@ -27,6 +27,11 @@ FontBuilder FontBuilder::italic(bool on) {
return *this;
}
FontBuilder FontBuilder::letterSpacing(qreal spacing, bool absolute) {
m_font.setLetterSpacing(absolute ? QFont::AbsoluteSpacing : QFont::PercentageSpacing, spacing);
return *this;
}
FontBuilder FontBuilder::vaxis(QFont::Tag tag, float value) {
m_font.setVariableAxis(tag, value);
return *this;

View file

@ -17,6 +17,7 @@ public:
[[nodiscard]] Q_INVOKABLE FontBuilder size(int pointSize);
[[nodiscard]] Q_INVOKABLE FontBuilder weight(QFont::Weight weight);
[[nodiscard]] Q_INVOKABLE FontBuilder italic(bool on = true);
[[nodiscard]] Q_INVOKABLE FontBuilder letterSpacing(qreal spacing, bool absolute = true);
[[nodiscard]] Q_INVOKABLE FontBuilder vaxis(QFont::Tag tag, float value);
[[nodiscard]] Q_INVOKABLE QFont build() const;