From 078c3b7d686c3dfb584f5df57b5ed5c4cb624592 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 3 Jun 2020 11:25:03 +0200 Subject: Remove deprecated text-related enums Fixes: QTBUG-82367 Change-Id: Iff2645759657f8e350754e90e791dbd583017671 Reviewed-by: Konstantin Ritt Reviewed-by: Qt CI Bot Reviewed-by: Lars Knoll --- src/gui/text/coretext/qfontengine_coretext.mm | 62 +++------------------------ 1 file changed, 7 insertions(+), 55 deletions(-) (limited to 'src/gui/text/coretext/qfontengine_coretext.mm') diff --git a/src/gui/text/coretext/qfontengine_coretext.mm b/src/gui/text/coretext/qfontengine_coretext.mm index 57fbf6032e..68de945351 100644 --- a/src/gui/text/coretext/qfontengine_coretext.mm +++ b/src/gui/text/coretext/qfontengine_coretext.mm @@ -341,16 +341,9 @@ bool QCoreTextFontEngine::stringToCMap(const QChar *str, int len, QGlyphLayout * glyph_metrics_t QCoreTextFontEngine::boundingBox(const QGlyphLayout &glyphs) { QFixed w; -QT_WARNING_PUSH -QT_WARNING_DISABLE_DEPRECATED - bool round = fontDef.styleStrategy & QFont::ForceIntegerMetrics; -QT_WARNING_POP - - for (int i = 0; i < glyphs.numGlyphs; ++i) { - w += round ? glyphs.effectiveAdvance(i).round() - : glyphs.effectiveAdvance(i); - } - return glyph_metrics_t(0, -(ascent()), w - lastRightBearing(glyphs, round), ascent()+descent(), w, 0); + for (int i = 0; i < glyphs.numGlyphs; ++i) + w += glyphs.effectiveAdvance(i); + return glyph_metrics_t(0, -(ascent()), w - lastRightBearing(glyphs), ascent()+descent(), w, 0); } glyph_metrics_t QCoreTextFontEngine::boundingBox(glyph_t glyph) @@ -370,14 +363,6 @@ glyph_metrics_t QCoreTextFontEngine::boundingBox(glyph_t glyph) ret.xoff = QFixed::fromReal(advances[0].width); ret.yoff = QFixed::fromReal(advances[0].height); -QT_WARNING_PUSH -QT_WARNING_DISABLE_DEPRECATED - if (fontDef.styleStrategy & QFont::ForceIntegerMetrics) { -QT_WARNING_POP - ret.xoff = ret.xoff.round(); - ret.yoff = ret.yoff.round(); - } - return ret; } @@ -396,32 +381,17 @@ QFixed QCoreTextFontEngine::capHeight() const if (c <= 0) return calculatedCapHeight(); -QT_WARNING_PUSH -QT_WARNING_DISABLE_DEPRECATED - if (fontDef.styleStrategy & QFont::ForceIntegerMetrics) -QT_WARNING_POP - c = c.round(); - return c; } QFixed QCoreTextFontEngine::xHeight() const { -QT_WARNING_PUSH -QT_WARNING_DISABLE_DEPRECATED - return (fontDef.styleStrategy & QFont::ForceIntegerMetrics) - ? QFixed::fromReal(CTFontGetXHeight(ctfont)).round() - : QFixed::fromReal(CTFontGetXHeight(ctfont)); -QT_WARNING_POP + return QFixed::fromReal(CTFontGetXHeight(ctfont)); } QFixed QCoreTextFontEngine::averageCharWidth() const { -QT_WARNING_PUSH -QT_WARNING_DISABLE_DEPRECATED - return (fontDef.styleStrategy & QFont::ForceIntegerMetrics) - ? avgCharWidth.round() : avgCharWidth; -QT_WARNING_POP + return avgCharWidth; } qreal QCoreTextFontEngine::maxCharWidth() const @@ -914,14 +884,8 @@ void QCoreTextFontEngine::loadAdvancesForGlyphs(QVarLengthArray &cgGlyp QVarLengthArray advances(numGlyphs); CTFontGetAdvancesForGlyphs(ctfont, kCTFontOrientationHorizontal, cgGlyphs.data(), advances.data(), numGlyphs); - for (int i = 0; i < numGlyphs; ++i) { - QFixed advance = QFixed::fromReal(advances[i].width); -QT_WARNING_PUSH -QT_WARNING_DISABLE_DEPRECATED - glyphs->advances[i] = fontDef.styleStrategy & QFont::ForceIntegerMetrics - ? advance.round() : advance; -QT_WARNING_POP - } + for (int i = 0; i < numGlyphs; ++i) + glyphs->advances[i] = QFixed::fromReal(advances[i].width); } QFontEngine::FaceId QCoreTextFontEngine::faceId() const @@ -1029,18 +993,6 @@ QFontEngine::Properties QCoreTextFontEngine::properties() const result.capHeight = QFixed::fromReal(CTFontGetCapHeight(ctfont) * scale); result.lineWidth = QFixed::fromReal(CTFontGetUnderlineThickness(ctfont) * scale); -QT_WARNING_PUSH -QT_WARNING_DISABLE_DEPRECATED - if (fontDef.styleStrategy & QFont::ForceIntegerMetrics) { -QT_WARNING_POP - result.ascent = result.ascent.round(); - result.descent = result.descent.round(); - result.leading = result.leading.round(); - result.italicAngle = result.italicAngle.round(); - result.capHeight = result.capHeight.round(); - result.lineWidth = result.lineWidth.round(); - } - return result; } -- cgit v1.2.3