diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-18 16:38:38 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-18 16:38:38 (GMT) |
commit | 81a32769389052696fed414af3b6602c90fc4c89 (patch) | |
tree | b6718491fd4521a651eba6dbc31c82e3d1bfc737 /src/gui/text/qfontmetrics.cpp | |
parent | 6ac26093169e6ab89a868f8b71488ef29ecf3c3b (diff) | |
parent | 7a9d7a7ad225589d8815f91e07228a0beb74465b (diff) | |
download | Qt-81a32769389052696fed414af3b6602c90fc4c89.zip Qt-81a32769389052696fed414af3b6602c90fc4c89.tar.gz Qt-81a32769389052696fed414af3b6602c90fc4c89.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2:
Stabilize taskQTBUG_7863_paintIntoCacheWithTransparentParts auto-test.
Optimize getting bearings of a glyph on Windows for true type fonts
Fixes blending problem when paiting non-opaque items with cache enabled.
Optimize speed of QTextLayout and QPainter::drawText
Fix a crash in animation groups when deleting uncontrolled animations
Diffstat (limited to 'src/gui/text/qfontmetrics.cpp')
-rw-r--r-- | src/gui/text/qfontmetrics.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp index 41d0af1..44a18de 100644 --- a/src/gui/text/qfontmetrics.cpp +++ b/src/gui/text/qfontmetrics.cpp @@ -472,8 +472,9 @@ int QFontMetrics::leftBearing(QChar ch) const int nglyphs = 9; engine->stringToCMap(&ch, 1, &glyphs, &nglyphs, 0); // ### can nglyphs != 1 happen at all? Not currently I think - glyph_metrics_t gi = engine->boundingBox(glyphs.glyphs[0]); - return qRound(gi.x); + qreal lb; + engine->getGlyphBearings(glyphs.glyphs[0], &lb); + return qRound(lb); } /*! @@ -506,8 +507,9 @@ int QFontMetrics::rightBearing(QChar ch) const int nglyphs = 9; engine->stringToCMap(&ch, 1, &glyphs, &nglyphs, 0); // ### can nglyphs != 1 happen at all? Not currently I think - glyph_metrics_t gi = engine->boundingBox(glyphs.glyphs[0]); - return qRound(gi.xoff - gi.x - gi.width); + qreal rb; + engine->getGlyphBearings(glyphs.glyphs[0], 0, &rb); + return qRound(rb); } /*! @@ -1317,8 +1319,9 @@ qreal QFontMetricsF::leftBearing(QChar ch) const int nglyphs = 9; engine->stringToCMap(&ch, 1, &glyphs, &nglyphs, 0); // ### can nglyphs != 1 happen at all? Not currently I think - glyph_metrics_t gi = engine->boundingBox(glyphs.glyphs[0]); - return gi.x.toReal(); + qreal lb; + engine->getGlyphBearings(glyphs.glyphs[0], &lb); + return lb; } /*! @@ -1351,8 +1354,10 @@ qreal QFontMetricsF::rightBearing(QChar ch) const int nglyphs = 9; engine->stringToCMap(&ch, 1, &glyphs, &nglyphs, 0); // ### can nglyphs != 1 happen at all? Not currently I think - glyph_metrics_t gi = engine->boundingBox(glyphs.glyphs[0]); - return (gi.xoff - gi.x - gi.width).toReal(); + qreal rb; + engine->getGlyphBearings(glyphs.glyphs[0], 0, &rb); + return rb; + } /*! |