From 2cb387b50a05a85402007ee8868491614489e2f2 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 3 Sep 2025 18:30:00 +0200 Subject: [PATCH] REVIEWED: Font atlas image generation, added some comments #5141 --- src/rtext.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rtext.c b/src/rtext.c index 009a264f3..c6078d7cb 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -834,7 +834,9 @@ Image GenImageFontAtlas(const GlyphInfo *glyphs, Rectangle **glyphRecs, int glyp atlas.height = imageSize; // Atlas bitmap height #else int paddedFontSize = fontSize + 2*padding; + // No need for a so-conservative atlas generation + // NOTE: Multiplying total expected are by 1.2f scale factor float totalArea = totalWidth*paddedFontSize*1.2f; float imageMinSize = sqrtf(totalArea); int imageSize = (int)powf(2, ceilf(logf(imageMinSize)/logf(2))); @@ -887,7 +889,7 @@ Image GenImageFontAtlas(const GlyphInfo *glyphs, Rectangle **glyphRecs, int glyp recs[j].width = 0; recs[j].height = 0; } - break; + break; // Break for() loop, stop processing glyphs } }