From f62ab70b381e3e75dede1bb50895038addf5fb21 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 29 Jan 2025 03:13:55 -0800
Subject: [PATCH] Don't fail the entire string if we can't load one of the
glyphs
We'll just use a 0x0 sized bitmap and won't render anything.
---
src/SDL_ttf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/SDL_ttf.c b/src/SDL_ttf.c
index 95bf11cc..ae851846 100644
--- a/src/SDL_ttf.c
+++ b/src/SDL_ttf.c
@@ -2607,7 +2607,8 @@ static bool Load_Glyph(TTF_Font *font, c_glyph *cached, int want, int translatio
// Render the glyph
error = FT_Render_Glyph(slot, ft_render_mode);
if (error) {
- return TTF_SetFTError("FT_Render_Glyph() failed", error);
+ // Don't fail entirely, just use a 0x0 sized bitmap
+ //return TTF_SetFTError("FT_Render_Glyph() failed", error);
}
// Access bitmap from slot