diff options
Diffstat (limited to 'src/gui/text/coretext/qfontengine_coretext.mm')
-rw-r--r-- | src/gui/text/coretext/qfontengine_coretext.mm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/text/coretext/qfontengine_coretext.mm b/src/gui/text/coretext/qfontengine_coretext.mm index f15b413c11..8916648992 100644 --- a/src/gui/text/coretext/qfontengine_coretext.mm +++ b/src/gui/text/coretext/qfontengine_coretext.mm @@ -503,7 +503,11 @@ glyph_metrics_t QCoreTextFontEngine::alphaMapBoundingBox(glyph_t glyph, const QF return QFontEngine::alphaMapBoundingBox(glyph, subPixelPosition, matrix, format); glyph_metrics_t br = boundingBox(glyph); - qcoretextfontengine_scaleMetrics(br, matrix); + + QTransform xform = matrix; + if (fontDef.stretch != 100 && fontDef.stretch != QFont::AnyStretch) + xform.scale(fontDef.stretch / 100.0, 1.0); + qcoretextfontengine_scaleMetrics(br, xform); // Normalize width and height if (br.width < 0) @@ -848,8 +852,9 @@ void QCoreTextFontEngine::loadAdvancesForGlyphs(QVarLengthArray<CGGlyph> &cgGlyp QVarLengthArray<CGSize> advances(numGlyphs); CTFontGetAdvancesForGlyphs(ctfont, kCTFontOrientationHorizontal, cgGlyphs.data(), advances.data(), numGlyphs); + qreal stretch = fontDef.stretch != QFont::AnyStretch ? fontDef.stretch / 100.0 : 1.0; for (int i = 0; i < numGlyphs; ++i) - glyphs->advances[i] = QFixed::fromReal(advances[i].width); + glyphs->advances[i] = QFixed::fromReal(advances[i].width * stretch); } QFontEngine::FaceId QCoreTextFontEngine::faceId() const |