From 2f629433aa6e95e0a68331e126f3645aea5fecd9 Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Sun, 2 Feb 2025 04:12:56 +0300 Subject: [PATCH] catch null font, report it as unimplemented --- src/rendering/twn_text.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/rendering/twn_text.c b/src/rendering/twn_text.c index 6d8b2ef..e5bfe5f 100644 --- a/src/rendering/twn_text.c +++ b/src/rendering/twn_text.c @@ -289,6 +289,11 @@ void text_cache_reset_arena(TextCache *cache) { void draw_text(const char *string, Vec2 position, float height, Color color, const char *font) { + if (!font) { + log_warn("Default font isn't yet implemented"); + return; + } + ensure_font_cache(font, (int)height); /* the original string might not be around by the time it's used, so copy it */