diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2012-11-16 11:39:26 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-02 10:21:51 +0100 |
commit | cc378774b86d732a1758260eca690637e99c1ac2 (patch) | |
tree | 87c7cb02b63d2c4de90984391ab470be7a45d3ac /src/gui/text/qfontengine_ft.cpp | |
parent | 818c544d6be0daf399ad69222b196e75e6b54505 (diff) |
Move ForceIntegerMetrics testing out of the loop
Change-Id: I5732999dee63568eb83e5186cf5bf8c63709724e
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Diffstat (limited to 'src/gui/text/qfontengine_ft.cpp')
-rw-r--r-- | src/gui/text/qfontengine_ft.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index fe72df64bd..b9a7e69c9d 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -1558,12 +1558,15 @@ void QFontEngineFT::recalcAdvances(QGlyphLayout *glyphs, QFontEngine::ShaperFlag glyphs->advances_x[i] = design ? QFixed::fromFixed(face->glyph->linearHoriAdvance >> 10) : QFixed::fromFixed(face->glyph->metrics.horiAdvance).round(); } - if (fontDef.styleStrategy & QFont::ForceIntegerMetrics) - glyphs->advances_x[i] = glyphs->advances_x[i].round(); glyphs->advances_y[i] = 0; } if (face) unlockFace(); + + if (fontDef.styleStrategy & QFont::ForceIntegerMetrics) { + for (int i = 0; i < glyphs->numGlyphs; ++i) + glyphs->advances_x[i] = glyphs->advances_x[i].round(); + } } glyph_metrics_t QFontEngineFT::boundingBox(const QGlyphLayout &glyphs) |