diff --git a/src/rcore.c b/src/rcore.c index b1632492b..3f2a1df8d 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -6949,7 +6949,7 @@ static void LoadAutomationEvents(const char *fileName) /* FILE *repFile = fopen(fileName, "rb"); unsigned char fileId[4] = { 0 }; - + fread(fileId, 1, 4, repFile); if ((fileId[0] == 'r') && (fileId[1] == 'E') && (fileId[2] == 'P') && (fileId[1] == ' ')) diff --git a/src/rtext.c b/src/rtext.c index 1d2b4f35b..2df8be8dc 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -697,18 +697,18 @@ Image GenImageFontAtlas(const GlyphInfo *chars, Rectangle **charRecs, int glyphC // Calculate image size based on total glyph width and glyph row count int totalWidth = 0; int maxGlyphWidth = 0; - + for (int i = 0; i < glyphCount; i++) { if (chars[i].image.width > maxGlyphWidth) maxGlyphWidth = chars[i].image.width; totalWidth += chars[i].image.width + 2*padding; } - + int rowCount = 0; int imageSize = 64; // Define minimum starting value to avoid unnecessary calculation steps for very small images - + // NOTE: maxGlyphWidth is maximum possible space left at the end of row - while (totalWidth > (imageSize - maxGlyphWidth)*rowCount) + while (totalWidth > (imageSize - maxGlyphWidth)*rowCount) { imageSize *= 2; // Double the size of image (to keep POT) rowCount = imageSize/(fontSize + 2*padding); // Calculate new row count for the new image size @@ -1240,7 +1240,7 @@ Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing int GetGlyphIndex(Font font, int codepoint) { int index = 0; - + #define SUPPORT_UNORDERED_CHARSET #if defined(SUPPORT_UNORDERED_CHARSET) int fallbackIndex = 0; // Get index of fallback glyph '?' @@ -1249,7 +1249,7 @@ int GetGlyphIndex(Font font, int codepoint) for (int i = 0; i < font.glyphCount; i++) { if (font.glyphs[i].value == 63) fallbackIndex = i; - + if (font.glyphs[i].value == codepoint) { index = i;