From 86a1f767ed73c7b55d76022341abb73d87993b06 Mon Sep 17 00:00:00 2001 From: Peter0x44 Date: Wed, 19 Jun 2024 12:22:41 +0100 Subject: [PATCH] [rtext] Don't return default font if LoadFontEx fails It is currently impossible to check a font loaded successfully with IsFontReady because LoadFontEx will always return a valid font. DrawTextEx has this check: if (font.texture.id == 0) font = GetFontDefault(); // Security check in case of not valid font So anyone relying on the default font as a fallback for fonts failing to load should still be covered. --- src/rtext.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/rtext.c b/src/rtext.c index 6ad0f90a0..87aa4e492 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -394,7 +394,6 @@ Font LoadFontEx(const char *fileName, int fontSize, int *codepoints, int codepoi UnloadFileData(fileData); } - else font = GetFontDefault(); return font; }