table of contents
- experimental 3~git20241004~5992548+ds-1
TTF_CreateText_Wrapped(3) | SDL_ttf3 FUNCTIONS | TTF_CreateText_Wrapped(3) |
NAME¶
TTF_CreateText_Wrapped - Create a text object from word-wrapped UTF-8 text and a text engine.
HEADER FILE¶
Defined in SDL3_ttf/SDL_ttf.h
SYNOPSIS¶
#include "SDL3_ttf/SDL_ttf.h"
TTF_Text * TTF_CreateText_Wrapped(TTF_TextEngine *engine, TTF_Font *font, const char *text, size_t length, int wrapLength);
DESCRIPTION¶
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.
FUNCTION PARAMETERS¶
- engine
- the text engine to use when creating the text object, may be NULL.
- font
- the font to render with.
- text
- the text to use, in UTF-8 encoding.
- length
- the length of the text, in bytes, or 0 for null terminated text.
- wrapLength
- the maximum width of the text surface or 0 to wrap on newline characters.
RETURN VALUE¶
( TTF_Text
*) Returns a TTF_Text
object or NULL on failure; call SDL_GetError() for more information.
THREAD SAFETY¶
This function should be called on the thread that created the font.
AVAILABILITY¶
This function is available since SDL_ttf 3.0.0.
SEE ALSO¶
•(3), TTF_CreateText(3), •(3), TTF_DestroyText(3)
SDL_ttf 3.0.0 | SDL_ttf |