summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontengine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/text/qfontengine.cpp')
-rw-r--r--src/gui/text/qfontengine.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp
index 35a76e7982..2c23cbd693 100644
--- a/src/gui/text/qfontengine.cpp
+++ b/src/gui/text/qfontengine.cpp
@@ -1093,6 +1093,18 @@ const QVector<QRgb> &QFontEngine::grayPalette()
return *qt_grayPalette();
}
+QFixed QFontEngine::lastRightBearing(const QGlyphLayout &glyphs, bool round)
+{
+ if (glyphs.numGlyphs >= 1) {
+ glyph_t glyph = glyphs.glyphs[glyphs.numGlyphs - 1];
+ glyph_metrics_t gi = boundingBox(glyph);
+ if (gi.isValid())
+ return round ? QFixed(qRound(gi.xoff - gi.x - gi.width))
+ : QFixed(gi.xoff - gi.x - gi.width);
+ }
+ return 0;
+}
+
// ------------------------------------------------------------------
// The box font engine
// ------------------------------------------------------------------