diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2021-04-26 07:48:05 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2021-04-27 12:12:35 +0000 |
commit | 678cbaebcf212d24c23bb31bb6643cb57053b2de (patch) | |
tree | 51dbf6633f189c02f5692cb92aa6009c1836efa7 /src/gui/text/qrawfont.cpp | |
parent | f6c8798001bbf647ccd4b52d9d520f117615be23 (diff) |
doc: Warn about kerning in QRawFont::advancesForGlyphIndexes()
The fact that KernedAdvances does not work correctly on a majority
of fonts is confusing. So we warn users that this is the case and
point them to the correct function to use instead.
Task-number: QTBUG-92930
Change-Id: I70f4b09ea1050fceabbff25a9c91008d1754f772
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/gui/text/qrawfont.cpp')
-rw-r--r-- | src/gui/text/qrawfont.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gui/text/qrawfont.cpp b/src/gui/text/qrawfont.cpp index 00a2939e79..462c60b1f6 100644 --- a/src/gui/text/qrawfont.cpp +++ b/src/gui/text/qrawfont.cpp @@ -579,7 +579,12 @@ bool QRawFont::glyphIndexesForChars(const QChar *chars, int numChars, quint32 *g to make it appear as if the two glyphs are unspaced. How the advances are calculated is controlled by \a layoutFlags. - \sa QTextLine::horizontalAdvance(), QFontMetricsF::horizontalAdvance() + \note When \c KernedAdvances is requested, this function will apply kerning rules from the + TrueType table \c{KERN}, if this is available in the font. In many modern fonts, kerning is + handled through OpenType rules or AAT rules, which requires a full shaping step to be applied. + To get the results of fully shaping the text, use \l{QTextLayout}. + + \sa QTextLine::horizontalAdvance(), QFontMetricsF::horizontalAdvance(), QTextLayout::glyphRuns() */ /*! @@ -604,7 +609,12 @@ bool QRawFont::glyphIndexesForChars(const QChar *chars, int numChars, quint32 *g array \a glyphIndexes while the results are returned through \a advances, both of them must have \a numGlyphs elements. How the advances are calculated is controlled by \a layoutFlags. - \sa QTextLine::horizontalAdvance(), QFontMetricsF::horizontalAdvance() + \note When \c KernedAdvances is requested, this function will apply kerning rules from the + TrueType table \c{KERN}, if this is available in the font. In many modern fonts, kerning is + handled through OpenType rules or AAT rules, which requires a full shaping step to be applied. + To get the results of fully shaping the text, use \l{QTextLayout}. + + \sa QTextLine::horizontalAdvance(), QFontMetricsF::horizontalAdvance(), QTextLayout::glyphRuns() */ bool QRawFont::advancesForGlyphIndexes(const quint32 *glyphIndexes, QPointF *advances, int numGlyphs, LayoutFlags layoutFlags) const { |