Merge branch 'nicbarker:main' into main

This commit is contained in:
__hexmaster111 2025-03-10 09:12:52 -05:00 committed by GitHub
commit 3a9172ec4c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 23 additions and 15 deletions

View file

@ -91,8 +91,11 @@ static inline Clay_Dimensions Raylib_MeasureText(Clay_StringSlice text, Clay_Tex
float textHeight = config->fontSize;
Font* fonts = (Font*)userData;
Font fontToUse = fonts[config->fontId];
// Font failed to load, likely the fonts are in the wrong place relative to the execution dir
if (!fontToUse.glyphs) return textSize;
// Font failed to load, likely the fonts are in the wrong place relative to the execution dir.
// RayLib ships with a default font, so we can continue with that built in one.
if (!fontToUse.glyphs) {
fontToUse = GetFontDefault();
}
float scaleFactor = config->fontSize/(float)fontToUse.baseSize;