TTF_RenderText_LCD_Wrapped(3)
β¨ TTF_RenderText_LCD_Wrapped β¨
okay bestie, so we're in the SDL_ttf3 functions manual and today's main character is TTF_RenderText_LCD_Wrapped π
π NAME π
TTF_RenderText_LCD_Wrapped β render word-wrapped UTF-8 text at LCD subpixel quality to a brand new ARGB surface. no cap, that's the whole gig π¦
π HEADER FILE π
Defined in SDL3_ttf/SDL_ttf.h β that's where you go to find it, periodt.
π SYNOPSIS π
#include "SDL3_ttf/SDL_ttf.h"
SDL_Surface * TTF_RenderText_LCD_Wrapped(TTF_Font *font, const char *text, size_t length, SDL_Color fg, SDL_Color bg, int wrap_width);
π DESCRIPTION π
So here's the vibe: this function allocates a whole new 32-bit, ARGB surface, and then renders alpha-blended text using FreeType's LCD subpixel rendering β¨ It hands you back that new surface, or NULL if something went wrong π
Text gets wrapped onto multiple lines on line endings and on word boundaries if it extends beyond wrap_width in pixels π«Ά
Ifwrap_widthis0, this function will only wrap on newline characters. like, that's the whole rule, iykyk.
And if you wanna render at other quality levels, you absolutely can, bestie, just hit up:
TTF_RenderText_Solid_WrappedTTF_RenderText_Shaded_WrappedTTF_RenderText_Blended_Wrapped
π§ FUNCTION PARAMETERS π§
fontβ the font you're rendering with, your main character πtextβ the text to render, in UTF-8 encoding (as it should be π)lengthβ the length of the text, in bytes, or0for null terminated textfgβ the foreground color for the textbgβ the background color for the textwrap_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 π
π₯ THREAD SAFETY π₯
This function should be called on the thread that created the font. don't be chaotic about it, bestie, keep it on that same thread π
π AVAILABILITY π
This function is available since SDL_ttf 3.0.0. iconic behavior honestly.
πΈ SEE ALSO πΈ
β’(3)TTF_RenderText_Blended_Wrapped(3)β’(3)TTF_RenderText_LCD(3)β’(3)TTF_RenderText_Shaded_Wrapped(3)β’(3)TTF_RenderText_Solid_Wrapped(3)
and that's the whole page, bestie!! this one's straight out of the SDL_ttf 3.2.2 manual, section TTF_RenderText_LCD_Wrapped(3) π go forth and wrap some text, you ate π«Άβ¨
π¦ 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