summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontengine.cpp
diff options
context:
space:
mode:
authorDavid Boddie <dboddie@trolltech.com>2010-08-31 12:03:44 (GMT)
committerDavid Boddie <dboddie@trolltech.com>2010-08-31 12:03:44 (GMT)
commitaec1d2b85b3a818350b70bbb27790dee6ac35327 (patch)
treeab37d5df921ee1c4ca09b9d582ddf562c3fef8c1 /src/gui/text/qfontengine.cpp
parent2192d722a0b2af2aae0a8c45741f1ee4fd28269c (diff)
parent500e4d4a7faef619354cb92b6bf7df6a639d29e3 (diff)
downloadQt-aec1d2b85b3a818350b70bbb27790dee6ac35327.zip
Qt-aec1d2b85b3a818350b70bbb27790dee6ac35327.tar.gz
Qt-aec1d2b85b3a818350b70bbb27790dee6ac35327.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
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 194c5f3..3f758b1 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
// ------------------------------------------------------------------