Skip to content

Commit 2cb387b

Browse files
committed
REVIEWED: Font atlas image generation, added some comments #5141
1 parent f53cd44 commit 2cb387b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/rtext.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,9 @@ Image GenImageFontAtlas(const GlyphInfo *glyphs, Rectangle **glyphRecs, int glyp
834834
atlas.height = imageSize; // Atlas bitmap height
835835
#else
836836
int paddedFontSize = fontSize + 2*padding;
837+
837838
// No need for a so-conservative atlas generation
839+
// NOTE: Multiplying total expected are by 1.2f scale factor
838840
float totalArea = totalWidth*paddedFontSize*1.2f;
839841
float imageMinSize = sqrtf(totalArea);
840842
int imageSize = (int)powf(2, ceilf(logf(imageMinSize)/logf(2)));
@@ -887,7 +889,7 @@ Image GenImageFontAtlas(const GlyphInfo *glyphs, Rectangle **glyphRecs, int glyp
887889
recs[j].width = 0;
888890
recs[j].height = 0;
889891
}
890-
break;
892+
break; // Break for() loop, stop processing glyphs
891893
}
892894
}
893895

0 commit comments

Comments
 (0)