TTF_RENDERTEXT_BLENDED_WRAPPED(3)
β¨ TTF_RenderText_Blended_Wrapped β¨
okay bestie, welcome to the SDL_ttf corner of the universe π this one lives in the <SDL3_ttf/SDL_ttf.h> header file, and it's the girl who takes your text and makes it look gorgeous while also breaking it into lines so it doesn't run off the edge of the world. main character energy fr fr π
πΈ NAME πΈ
TTF_RenderText_Blended_Wrapped β render word-wrapped UTF-8 text at high quality to a new ARGB surface π
π HEADER FILE π
Defined in SDL3_ttf/SDL_ttf.h
π¦ SYNOPSIS π¦
#include "SDL3_ttf/SDL_ttf.h"
SDL_Surface * TTF_RenderText_Blended_Wrapped(TTF_Font *font, const char *text, size_t length, SDL_Color fg, int wrap_width);
β¨ DESCRIPTION β¨
so basically, this function allocates a brand new 32-bit, ARGB surface, and it uses alpha blending to dither the font with whatever color you handed it. it gives you back that new surface, or NULL if something went wrong π
The text gets wrapped onto multiple lines β on line endings and on word boundaries β if it stretches past wrap_width in pixels. she's not letting your words hang off the edge, no ma'am π«Ά
and if wrap_width is 0, this function will only wrap on newline characters. that's it. that's the whole vibe check.
if you wanna render at other quality levels, you can, and the girlies for that are:
TTF_RenderText_Solid_WrappedTTF_RenderText_Shaded_WrappedTTF_RenderText_LCD_Wrapped
π FUNCTION PARAMETERS π
fontβ the font you're rendering with, duh πtextβ the text to render, in UTF-8 encoding β¨lengthβ the length of the text, in bytes, or0for null terminated text πfgβ the foreground color for the text π¨wrap_widthβ the maximum width of the text surface, or0to wrap on newline characters π
π RETURN VALUE π
Returns a new 32-bit, ARGB surface, or NULL if there was an error. that's it, that's the tea π
π§ THREAD SAFETY π§
This function should be called on the thread that created the font. don't be messy about it bestie, she's not built for cross-thread chaos π
β AVAILABILITY β
This function is available since SDL_ttf 3.0.0. she's been iconic for a minute now π
π₯ SEE ALSO π₯
β’(3)TTF_RenderText_Blended(3)β’(3)TTF_RenderText_LCD_Wrapped(3)β’(3)TTF_RenderText_Shaded_Wrapped(3)β’(3)TTF_RenderText_Solid_Wrapped(3)
and that's the whole page, periodt πβ¨ this lil beauty comes to you from SDL_ttf 3.2.2 β go forth and render, bestie, 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