| TTF_MeasureString(3) | SDL_ttf3 FUNCTIONS | TTF_MeasureString(3) |
TTF_MeasureString - Calculate how much of a UTF-8 string will fit in a given width.
Defined in SDL3_ttf/SDL_ttf.h
#include "SDL3_ttf/SDL_ttf.h"
bool TTF_MeasureString(TTF_Font *font, const char *text, size_t length, int max_width, int *measured_width, size_t *measured_length);
This reports the number of characters that can be rendered before reaching max_width .
This does not need to render the string to do this calculation.
Returns true on success or false on failure; call SDL_GetError() for more information.
This function should be called on the thread that created the font.
This function is available since SDL_ttf 3.0.0.
| SDL_ttf 3.2.2 | SDL_ttf |