summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontengine_mac.mm
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-08-30 16:11:03 +0200
committerOlivier Goffart <olivier.goffart@nokia.com>2010-08-30 16:11:03 +0200
commit1ba3cac3c7296320ca914f262f124ae7f2dea841 (patch)
tree40e9c04835dcfe8adccb4cedfda5e568f3c92677 /src/gui/text/qfontengine_mac.mm
parent708978d1c18cf938a4e0c29a5a90be5de4e82140 (diff)
parent51582e3d1251766a3ed941530d966e1a591cbed6 (diff)
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_mac.mm')
-rw-r--r--src/gui/text/qfontengine_mac.mm17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/gui/text/qfontengine_mac.mm b/src/gui/text/qfontengine_mac.mm
index f898fb836a..011cfe3923 100644
--- a/src/gui/text/qfontengine_mac.mm
+++ b/src/gui/text/qfontengine_mac.mm
@@ -455,12 +455,13 @@ bool QCoreTextFontEngine::stringToCMap(const QChar *, int, QGlyphLayout *, int *
glyph_metrics_t QCoreTextFontEngine::boundingBox(const QGlyphLayout &glyphs)
{
QFixed w;
+ bool round = fontDef.styleStrategy & QFont::ForceIntegerMetrics;
+
for (int i = 0; i < glyphs.numGlyphs; ++i) {
- w += (fontDef.styleStrategy & QFont::ForceIntegerMetrics)
- ? glyphs.effectiveAdvance(i).round()
- : glyphs.effectiveAdvance(i);
+ w += round ? glyphs.effectiveAdvance(i).round()
+ : glyphs.effectiveAdvance(i);
}
- return glyph_metrics_t(0, -(ascent()), w, ascent()+descent(), w, 0);
+ return glyph_metrics_t(0, -(ascent()), w - lastRightBearing(glyphs, round), ascent()+descent(), w, 0);
}
glyph_metrics_t QCoreTextFontEngine::boundingBox(glyph_t glyph)
{
@@ -1486,12 +1487,12 @@ void QFontEngineMac::recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFla
glyph_metrics_t QFontEngineMac::boundingBox(const QGlyphLayout &glyphs)
{
QFixed w;
+ bool round = fontDef.styleStrategy & QFont::ForceIntegerMetrics;
for (int i = 0; i < glyphs.numGlyphs; ++i) {
- w += (fontDef.styleStrategy & QFont::ForceIntegerMetrics)
- ? glyphs.effectiveAdvance(i).round()
- : glyphs.effectiveAdvance(i);
+ w += round ? glyphs.effectiveAdvance(i).round()
+ : glyphs.effectiveAdvance(i);
}
- return glyph_metrics_t(0, -(ascent()), w, ascent()+descent(), w, 0);
+ return glyph_metrics_t(0, -(ascent()), w - lastRightBearing(glyphs, round), ascent()+descent(), w, 0);
}
glyph_metrics_t QFontEngineMac::boundingBox(glyph_t glyph)