Skip to content

Commit

Permalink
[rtext] Don't return default font if LoadFontEx fails
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Peter0x44 committed Jun 19, 2024
1 parent 52f2a10 commit 86a1f76
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/rtext.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,6 @@ Font LoadFontEx(const char *fileName, int fontSize, int *codepoints, int codepoi

UnloadFileData(fileData);
}
else font = GetFontDefault();

return font;
}
Expand Down

0 comments on commit 86a1f76

Please sign in to comment.