Closed
Description
- I tested it on latest raylib version from master branch
- I checked there is no similar issue already reported
- I checked the documentation on the wiki
- My code has no errors or misuse of raylib
Issue description
Essentially, the array of strings (splits) returned by TextSplit()
, gets "garbage" value after I use it after loading a font using LoadFont()
.
Environment
HP 15s, Windows 11 24H2, Intel iRIS Xe
Code Example
#include "include/raylib.h"
int main(void) {
int count;
InitWindow(800, 450, "sample");
char* data = "1.2.3.4";
const char **spl = TextSplit(data, '.', &count);
Font font = LoadFont("assets/font/font.ttf");
for(int i=0; i<count; i++) printf("%s\n", spl[i]);
SetTargetFPS(60);
while (!WindowShouldClose()) {
BeginDrawing();
ClearBackground(BLACK);
EndDrawing();
}
UnloadFont(font);
CloseWindow();
return 0;
}
here, if I put the line for(int i=0; i<count; i++) printf("%s\n", spl[i]);
before Font font = LoadFont("assets/font/font.ttf");
, it prints the output as it should be, i,e,
1
2
3
4
But if I put it after that, it produces garbage:
.ttf
tf
Metadata
Metadata
Assignees
Labels
No labels