Deprecate QFont::ForceIntegerMetrics and QFont::OpenGLCompatible

The ForceIntegerMetrics flag was added in Qt 4.7 specifically because
of WebKit, which was rounding text metrics and getting mismatches
with the underlying font engine whenever it supported fractional
advances. For backwards compatibility with how the CoreText engine
worked before this, we added a flag to allow rounding all metrics.

Rounding advances gives very broken rendering and is hopefully not
used by anyone anymore, so lets remove this flag in Qt 6.

As for OpenGLCompatible, this flag is not used anywhere. I am
not exactly sure what this flag did, but all fonts are
"OpenGL-compatible" at this point.

[ChangeLog][QtGui][QFont] Deprecated QFont::ForceIntegerMetrics
and QFont::OpenGLCompatible, with the intention of removing them
in Qt 6.0.0.

Change-Id: I0a492c153348023f00d561bab8ab4b5104c6c7c4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
bb10
Eskil Abrahamsen Blomfeldt 2020-01-20 13:00:56 +01:00
parent eecd502ff3
commit dd17456a8a
2 changed files with 8 additions and 6 deletions

View File

@ -1353,8 +1353,8 @@ QFont::StyleHint QFont::styleHint() const
\value NoAntialias don't antialias the fonts.
\value NoSubpixelAntialias avoid subpixel antialiasing on the fonts if possible.
\value PreferAntialias antialias if possible.
\value OpenGLCompatible forces the use of OpenGL compatible
fonts.
\value OpenGLCompatible This style strategy has been deprecated. All fonts are
OpenGL-compatible by default.
\value NoFontMerging If the font selected for a certain writing system
does not contain a character requested to draw, then Qt automatically chooses a similar
looking font that contains the character. The NoFontMerging flag disables this feature.
@ -1373,8 +1373,8 @@ QFont::StyleHint QFont::styleHint() const
\value PreferQuality prefer the best quality font. The font matcher
will use the nearest standard point size that the font
supports.
\value ForceIntegerMetrics forces the use of integer values in font engines that support fractional
font metrics.
\value ForceIntegerMetrics This style strategy has been deprecated. Use \l QFontMetrics to
retrieve rounded font metrics.
*/
/*!

View File

@ -80,8 +80,10 @@ public:
PreferQuality = 0x0040,
PreferAntialias = 0x0080,
NoAntialias = 0x0100,
OpenGLCompatible = 0x0200,
ForceIntegerMetrics = 0x0400,
#if QT_DEPRECATED_SINCE(5, 15)
OpenGLCompatible Q_DECL_ENUMERATOR_DEPRECATED = 0x0200,
ForceIntegerMetrics Q_DECL_ENUMERATOR_DEPRECATED = 0x0400,
#endif
NoSubpixelAntialias = 0x0800,
PreferNoShaping = 0x1000,
NoFontMerging = 0x8000