Fix a couple of false positive unit-tests in Linux.

This commit is contained in:
Martín Lucas Golini
2026-08-23 18:12:42 -03:00
parent 301b7458d2
commit e269d65e01
2 changed files with 6 additions and 1 deletions

View File

@@ -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;

View File

@@ -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 );
}