From e269d65e01f306126aff45f4109bb9bd65c4161b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Sun, 23 Aug 2026 18:12:42 -0300 Subject: [PATCH] Fix a couple of false positive unit-tests in Linux. --- src/eepp/graphics/systemfontresolver.cpp | 3 ++- src/tests/unit_tests/fontrendering_tests.cpp | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/eepp/graphics/systemfontresolver.cpp b/src/eepp/graphics/systemfontresolver.cpp index 580999906..bd0a6efb9 100644 --- a/src/eepp/graphics/systemfontresolver.cpp +++ b/src/eepp/graphics/systemfontresolver.cpp @@ -504,7 +504,8 @@ FontDesc SystemFontResolver::getFallbackForCodepoint( Uint32 codepoint, FontWeig } FontDesc nativeMatch = matchFallbackForCodepoint( codepoint, weight, italic ); - if ( !nativeMatch.path.empty() && !( isEmoji && fontHasSvgTable( nativeMatch.path ) ) ) { + if ( !nativeMatch.path.empty() && fontContainsCodepoint( nativeMatch.path, codepoint ) && + !( isEmoji && fontHasSvgTable( nativeMatch.path ) ) ) { Lock lock( mMutex ); mCodepointFallbackCache[codepoint] = nativeMatch.path; return nativeMatch; diff --git a/src/tests/unit_tests/fontrendering_tests.cpp b/src/tests/unit_tests/fontrendering_tests.cpp index 16066e827..5db5008ad 100644 --- a/src/tests/unit_tests/fontrendering_tests.cpp +++ b/src/tests/unit_tests/fontrendering_tests.cpp @@ -375,6 +375,10 @@ UTEST( FontRendering, shapedTextUsesSystemFallbackForCommonSymbols ) { const Uint32 codepoint = symbols[glyph.stringIndex]; if ( codepoint == ' ' ) continue; + FontDesc fallback = SystemFontResolver::instance()->getFallbackForCodepoint( + codepoint, FontWeight::Normal, false ); + if ( fallback.path.empty() ) + continue; EXPECT_NE( 0u, glyph.glyphIndex ); EXPECT_NE( font.get(), glyph.font ); }