summaryrefslogtreecommitdiffstats
path: root/src/platformsupport
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-06-03 11:25:03 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-06-08 15:04:19 +0200
commit078c3b7d686c3dfb584f5df57b5ed5c4cb624592 (patch)
tree2777bfb727a790405f36204f09b35dc913fb2e58 /src/platformsupport
parent18e8519dcdf36b211b39c131c0d6e08b5921a03c (diff)
Remove deprecated text-related enums
Fixes: QTBUG-82367 Change-Id: Iff2645759657f8e350754e90e791dbd583017671 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/platformsupport')
-rw-r--r--src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp49
1 files changed, 5 insertions, 44 deletions
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp
index 4c1bfc4d43..d96e65a532 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp
+++ b/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp
@@ -515,13 +515,6 @@ void QWindowsFontEngineDirectWrite::recalcAdvances(QGlyphLayout *glyphs, QFontEn
qreal stretch = fontDef.stretch != QFont::AnyStretch ? fontDef.stretch / 100.0 : 1.0;
for (int i = 0; i < glyphs->numGlyphs; ++i)
glyphs->advances[i] = DESIGN_TO_LOGICAL(glyphMetrics[i].advanceWidth * stretch);
-QT_WARNING_PUSH
-QT_WARNING_DISABLE_DEPRECATED
- if (fontDef.styleStrategy & QFont::ForceIntegerMetrics) {
-QT_WARNING_POP
- for (int i = 0; i < glyphs->numGlyphs; ++i)
- glyphs->advances[i] = glyphs->advances[i].round();
- }
} else {
qErrnoWarning("%s: GetDesignGlyphMetrics failed", __FUNCTION__);
}
@@ -561,17 +554,9 @@ glyph_metrics_t QWindowsFontEngineDirectWrite::boundingBox(const QGlyphLayout &g
{
if (glyphs.numGlyphs == 0)
return glyph_metrics_t();
-
-QT_WARNING_PUSH
-QT_WARNING_DISABLE_DEPRECATED
- bool round = fontDef.styleStrategy & QFont::ForceIntegerMetrics;
-QT_WARNING_POP
-
QFixed w = 0;
- for (int i = 0; i < glyphs.numGlyphs; ++i) {
- w += round ? glyphs.effectiveAdvance(i).round() : glyphs.effectiveAdvance(i);
-
- }
+ 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);
}
@@ -590,15 +575,6 @@ glyph_metrics_t QWindowsFontEngineDirectWrite::boundingBox(glyph_t g)
QFixed verticalOriginY = DESIGN_TO_LOGICAL(glyphMetrics.verticalOriginY);
QFixed topSideBearing = DESIGN_TO_LOGICAL(glyphMetrics.topSideBearing);
QFixed bottomSideBearing = DESIGN_TO_LOGICAL(glyphMetrics.bottomSideBearing);
-
-QT_WARNING_PUSH
-QT_WARNING_DISABLE_DEPRECATED
- if (fontDef.styleStrategy & QFont::ForceIntegerMetrics) {
-QT_WARNING_POP
- advanceWidth = advanceWidth.round();
- advanceHeight = advanceHeight.round();
- }
-
QFixed width = advanceWidth - leftSideBearing - rightSideBearing;
QFixed height = advanceHeight - topSideBearing - bottomSideBearing;
return glyph_metrics_t(leftSideBearing,
@@ -619,32 +595,17 @@ QFixed QWindowsFontEngineDirectWrite::capHeight() const
if (m_capHeight <= 0)
return calculatedCapHeight();
-QT_WARNING_PUSH
-QT_WARNING_DISABLE_DEPRECATED
- return fontDef.styleStrategy & QFont::ForceIntegerMetrics
- ? m_capHeight.round()
- : m_capHeight;
-QT_WARNING_POP
+ return m_capHeight;
}
QFixed QWindowsFontEngineDirectWrite::xHeight() const
{
-QT_WARNING_PUSH
-QT_WARNING_DISABLE_DEPRECATED
- return fontDef.styleStrategy & QFont::ForceIntegerMetrics
- ? m_xHeight.round()
- : m_xHeight;
-QT_WARNING_POP
+ return m_xHeight;
}
qreal QWindowsFontEngineDirectWrite::maxCharWidth() const
{
-QT_WARNING_PUSH
-QT_WARNING_DISABLE_DEPRECATED
- return fontDef.styleStrategy & QFont::ForceIntegerMetrics
- ? m_maxAdvanceWidth.round().toReal()
- : m_maxAdvanceWidth.toReal();
-QT_WARNING_POP
+ return m_maxAdvanceWidth.toReal();
}
QImage QWindowsFontEngineDirectWrite::alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition, const QTransform &t)