summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontengine.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-08-30 14:11:03 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-08-30 14:11:03 (GMT)
commit1ba3cac3c7296320ca914f262f124ae7f2dea841 (patch)
tree40e9c04835dcfe8adccb4cedfda5e568f3c92677 /src/gui/text/qfontengine.cpp
parent708978d1c18cf938a4e0c29a5a90be5de4e82140 (diff)
parent51582e3d1251766a3ed941530d966e1a591cbed6 (diff)
downloadQt-1ba3cac3c7296320ca914f262f124ae7f2dea841.zip
Qt-1ba3cac3c7296320ca914f262f124ae7f2dea841.tar.gz
Qt-1ba3cac3c7296320ca914f262f124ae7f2dea841.tar.bz2
Merge remote branch 'origin/4.7' into qt-master-from-4.7
Conflicts: qmake/generators/win32/msbuild_objectmodel.cpp qmake/generators/win32/msvc_vcxproj.cpp tests/auto/qnetworkreply/tst_qnetworkreply.cpp
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 3f6b409..1b94915 100644
--- a/src/gui/text/qfontengine.cpp
+++ b/src/gui/text/qfontengine.cpp
@@ -1109,6 +1109,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
// ------------------------------------------------------------------