diff --git a/src/sdl_font.cpp b/src/sdl_font.cpp index 82c7cf03a998b..1d29d95b5dfaf 100644 --- a/src/sdl_font.cpp +++ b/src/sdl_font.cpp @@ -333,7 +333,15 @@ SDL_Texture_Ptr CachedTTFFont::create_glyph( const SDL_Renderer_Ptr &renderer, bool CachedTTFFont::isGlyphProvided( const std::string &ch ) const { - return TTF_GlyphIsProvided( font.get(), UTF8_getch( ch ) ); + // Just return false if the glyph is not provided by the font + if( !TTF_GlyphIsProvided( font.get(), UTF8_getch( ch ) ) ) { + return false; + } + + // Test whether the glyph can actually be rendered + constexpr SDL_Color white{255, 255, 255, 0}; + SDL_Surface_Ptr surface( TTF_RenderUTF8_Solid( font.get(), ch.c_str(), white ) ); + return static_cast( surface ); } void CachedTTFFont::OutputChar( const SDL_Renderer_Ptr &renderer, const GeometryRenderer_Ptr &,