summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-01-30 07:56:02 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-02-03 07:08:53 +0100
commit07e5a05dcb91720a88122e4aba9d8ce6bfbd14ad (patch)
treee3657ca83f2ce50c7db0e89d28d0e6a14d62a2b5 /src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp
parent06f88d2177c4b62499a31b54dec5ed86b1c75452 (diff)
Suppress deprecation warnings for QFont::ForceIntegerMetrics
This flag has been deprecated, but until we remove it completely we need to continue supporting it, so we just suppress the warnings for now. Change-Id: I464e1cce42f78af76d46ec12eeb3e8d53d64d6a3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp')
-rw-r--r--src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp
index f84ee3dcaa..e8f9cfb2a8 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp
+++ b/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp
@@ -487,7 +487,10 @@ 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();
}
@@ -531,7 +534,10 @@ 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) {
@@ -557,7 +563,10 @@ glyph_metrics_t QWindowsFontEngineDirectWrite::boundingBox(glyph_t g)
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();
}
@@ -579,9 +588,12 @@ glyph_metrics_t QWindowsFontEngineDirectWrite::boundingBox(glyph_t g)
QFixed QWindowsFontEngineDirectWrite::ascent() const
{
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
return fontDef.styleStrategy & QFont::ForceIntegerMetrics
? m_ascent.round()
: m_ascent;
+QT_WARNING_POP
}
QFixed QWindowsFontEngineDirectWrite::capHeight() const
@@ -589,37 +601,52 @@ 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
}
QFixed QWindowsFontEngineDirectWrite::descent() const
{
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
return fontDef.styleStrategy & QFont::ForceIntegerMetrics
? m_descent.round()
: m_descent;
+QT_WARNING_POP
}
QFixed QWindowsFontEngineDirectWrite::leading() const
{
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
return fontDef.styleStrategy & QFont::ForceIntegerMetrics
? m_lineGap.round()
: m_lineGap;
+QT_WARNING_POP
}
QFixed QWindowsFontEngineDirectWrite::xHeight() const
{
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
return fontDef.styleStrategy & QFont::ForceIntegerMetrics
? m_xHeight.round()
: m_xHeight;
+QT_WARNING_POP
}
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
}
QImage QWindowsFontEngineDirectWrite::alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition, const QTransform &t)