Fix #12815, 7e914a0568: Fallback detection failed with sprite font. (#12816)

How missing glyphs were detected was changed, but the sprite font still substituted `?`, which to missing glyph looked like all characters are present.
This commit is contained in:
Peter Nelson
2024-06-27 07:34:01 +01:00
committed by GitHub
parent da4b3bebee
commit a288644e20
2 changed files with 9 additions and 1 deletions
+8
View File
@@ -115,6 +115,14 @@ uint SpriteFontCache::GetGlyphWidth(GlyphID key)
return SpriteExists(sprite) ? GetSprite(sprite, SpriteType::Font)->width + ScaleFontTrad(this->fs != FS_NORMAL ? 1 : 0) : 0;
}
GlyphID SpriteFontCache::MapCharToGlyph(char32_t key, [[maybe_unused]] bool allow_fallback)
{
assert(IsPrintable(key));
SpriteID sprite = this->GetUnicodeGlyph(key);
if (sprite == 0) return 0;
return SPRITE_GLYPH | key;
}
bool SpriteFontCache::GetDrawGlyphShadow()
{
return false;