libsdl-org / SDL_ttf

Support for TrueType (.ttf) font files with Simple Directmedia Layer.
zlib License
403 stars 131 forks source link

Issues with SDL_RenderText_Solid_Wrapped only with SDL3 #431

Open CorruptVoidSoul opened 6 days ago

CorruptVoidSoul commented 6 days ago

There are two problems, one, SDL3_ttf doesn't wrap on newline characters, while SDL2_ttf does, two, on Windows, there's a font conversion error and the GDB backtrace told me to report this as a bug

The function is called via a wrapper

SDL_Surface* rendertext(TTF_Font* font, char* text, SDL_Color color)
{
    #ifdef SDL2
    return TTF_RenderText_Solid_Wrapped(font, text, color, 0);
    #endif
    #ifdef SDL3
    return TTF_RenderText_Solid_Wrapped(font, text, strlen(text), color, 0);
    #endif
}

oh hecc