Improved font fallback when glyph isn't available in the fallback font.

This commit is contained in:
Martín Lucas Golini
2023-03-27 23:55:54 -03:00
parent cdd91e904a
commit 77c2b584ac

View File

@@ -412,10 +412,12 @@ const Glyph& FontTrueType::getGlyph( Uint32 codePoint, unsigned int characterSiz
FontManager::instance()->getFallbackFont()->getType() == FontType::TTF ) {
FontTrueType* fallbackFont =
static_cast<FontTrueType*>( FontManager::instance()->getFallbackFont() );
if ( mIsMonospace && mEnableDynamicMonospace )
mIsMonospace = false;
return fallbackFont->getGlyph( codePoint, characterSize, bold, outlineThickness,
getPage( characterSize ), maxWidth );
if ( 0 != fallbackFont->getGlyphIndex( codePoint ) ) {
if ( mIsMonospace && mEnableDynamicMonospace )
mIsMonospace = false;
return fallbackFont->getGlyph( codePoint, characterSize, bold, outlineThickness,
getPage( characterSize ), maxWidth );
}
}
return getGlyphByIndex( glyphIndex, characterSize, bold, outlineThickness );