TTF_RENDERTEXT_SOLID_WRAPPED(3)
π TTF_RenderText_Solid_Wrapped π
okay bestie, welcome to the SDL_ttf corner of the manual, this one's from the SDL_ttf 3 era and it's literally the speedrun version of putting words on a screen πββοΈπ¨
πΈ NAME πΈ
TTF_RenderText_Solid_Wrapped β Render word-wrapped UTF-8 text at fast quality to a new 8-bit surface.
π HEADER FILE π
Defined in SDL3_ttf/SDL_ttf.h β that's where she lives, no cap π«Ά
β¨ SYNOPSIS β¨
#include "SDL3_ttf/SDL_ttf.h"
SDL_Surface * TTF_RenderText_Solid_Wrapped(TTF_Font *font, const char *text, size_t length, SDL_Color fg, int wrapLength);
π DESCRIPTION π
So here's the tea, bestie: this function will allocate a new 8-bit, palettized surface. The surface's 0 pixel will be the colorkey, giving a transparent background. The 1 pixel will be set to the text color. it's giving "instant sticker with a see-through backdrop" energy β¨
Text is wrapped to multiple lines on line endings and on word boundaries if it extends beyond wrapLength in pixels.
If wrapLength is 0, this function will only wrap on newline characters. periodt π
You can render at other quality levels with
TTF_RenderText_Shaded_WrappedTTF_RenderText_Blended_WrappedTTF_RenderText_LCD_Wrapped
pick your fighter, they all ate π
π FUNCTION PARAMETERS π
fontβ the font to render with. your main character πtextβ text to render, in UTF-8 encoding.lengthβ the length of the text, in bytes, or0for null terminated text. zero means "bestie, I got you, just read till the end" πfgβ the foreground color for the text.wrapLengthβ the maximum width of the text surface or0to wrap on newline characters.
π RETURN VALUE π
Returns a new 8-bit, palettized surface, or NULL if there was an error.
if you get NULL back, something went wrong, and you should go check that error like it's your ex's story π
π§ THREAD SAFETY π§
This function should be called on the thread that created the font. do NOT go handing your font to another thread, she's not about that life, fr fr β
β AVAILABILITY β
This function is available since SDL_ttf 3.0.0. old enough to be iconic, new enough to still be relevant π
π¦ SEE ALSO π¦
TTF_RenderText_Blended_Wrapped(3)TTF_RenderText_LCD_Wrapped(3)TTF_RenderText_Shaded_Wrapped(3)TTF_RenderText_Solid(3)
and that's the whole page, bestie!! πΈ this was SDL_ttf β the SDL_ttf 3.2.2 era, mwah π go render something gorgeous, you got this π«Άβ¨π
π¦ where this page comes from
- debian trixie: libsdl3-ttf-doc 3.2.2+ds-1 Β· Zlib
- fedora 43: SDL3_ttf-devel 3.2.2-2.fc43 Β· Zlib AND MIT
- fedora 43: SDL3_ttf-devel 3.2.2-2.fc43 Β· Zlib AND MIT
- fedora 44: SDL3_ttf-devel 3.2.2-4.fc44 Β· Zlib AND MIT
- fedora 44: SDL3_ttf-devel 3.2.2-4.fc44 Β· Zlib AND MIT
- ubuntu questing: libsdl3-ttf-doc 3.2.2+ds-1
- ubuntu resolute: libsdl3-ttf-doc 3.2.2+ds-1build1 Β· Zlib
- ubuntu stonking: libsdl3-ttf-doc 3.2.2+ds-2 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms