diff options
| author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2023-11-27 18:07:57 +0100 |
|---|---|---|
| committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2024-06-22 11:25:12 -0700 |
| commit | f7e48756616fafe1f5d5ffef09493e278826d37f (patch) | |
| tree | 5db92fa7d87e2aebc44826b22f799f65bddbc9e2 | |
| parent | af3091ca5b7e1da6d5198edf2fed1795a46603a3 (diff) | |
Ignore Text.style when drawing color glyphs
The style shader doesn't support color glyphs, and would result in
a grayscale glyph/emoji as a result. As raising or outlining color
glyphs is not typically how the native platforms handle color glyphs
we opt out of these styles if we're dealing with color glyphs.
Fixes: QTBUG-82311
Change-Id: I52b02ed4d95dbc8655f19118eebc7634f122ff8b
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 8b179cebb755059888a61fe69e2c4b4561c50a87)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| -rw-r--r-- | src/quick/scenegraph/qsgdefaultglyphnode.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/quick/scenegraph/qsgdefaultglyphnode.cpp b/src/quick/scenegraph/qsgdefaultglyphnode.cpp index 9235178f73..e8908af8f0 100644 --- a/src/quick/scenegraph/qsgdefaultglyphnode.cpp +++ b/src/quick/scenegraph/qsgdefaultglyphnode.cpp @@ -83,11 +83,14 @@ void QSGDefaultGlyphNode::update() QRawFont font = m_glyphs.rawFont(); QMargins margins(0, 0, 0, 0); - if (m_style == QQuickText::Normal) { + const auto *fontEngine = QRawFontPrivate::get(font)->fontEngine; + const bool isColorFont = fontEngine->glyphFormat == QFontEngine::Format_ARGB; + + if (m_style == QQuickText::Normal || isColorFont) { QFontEngine::GlyphFormat glyphFormat; // Don't try to override glyph format of color fonts - if (QRawFontPrivate::get(font)->fontEngine->glyphFormat == QFontEngine::Format_ARGB) { + if (isColorFont) { glyphFormat = QFontEngine::Format_None; } else { switch (m_preferredAntialiasingMode) { |
