.\" This manpage content is licensed under Creative Commons .\" Attribution 4.0 International (CC BY 4.0) .\" https://creativecommons.org/licenses/by/4.0/ .\" This manpage was generated from SDL_ttf's wiki page for TTF_SizeText: .\" https://wiki.libsdl.org/SDL_ttf/TTF_SizeText .\" Generated with SDL/build-scripts/wikiheaders.pl .\" revision 3~git20240320~6e260a2+ds-1 .\" Please report issues in this manpage's content at: .\" https://github.com/libsdl-org/sdlwiki/issues/new .\" Please report issues in the generation of this manpage from the wiki at: .\" https://github.com/libsdl-org/SDL/issues/new?title=Misgenerated%20manpage%20for%20TTF_SizeText .\" SDL_ttf can be found at https://libsdl.org/projects/SDL_ttf .de URL \$2 \(laURL: \$1 \(ra\$3 .. .if \n[.g] .mso www.tmac .TH TTF_SizeText 3 "SDL_ttf 3.0.0" "SDL_ttf" "SDL_ttf3 FUNCTIONS" .SH NAME TTF_SizeText \- Calculate the dimensions of a rendered string of Latin1 text\[char46] .SH SYNOPSIS .nf .B #include \(dqSDL3_ttf/SDL_ttf.h\(dq .PP .BI "int TTF_SizeText(TTF_Font *font, const char *text, int *w, int *h); .fi .SH DESCRIPTION This will report the width and height, in pixels, of the space that the specified string will take to fully render\[char46] This does not need to render the string to do this calculation\[char46] You almost certainly want .BR TTF_SizeUTF8 () unless you're sure you have a 1-byte Latin1 encoding\[char46] US ASCII characters will work with either function, but most other Unicode characters packed into a .BR const char * will need UTF-8\[char46] .SH FUNCTION PARAMETERS .TP .I font the font to query\[char46] .TP .I text text to calculate, in Latin1 encoding\[char46] .TP .I w will be filled with width, in pixels, on return\[char46] .TP .I h will be filled with height, in pixels, on return\[char46] .SH RETURN VALUE Returns 0 if successful, -1 on error\[char46] .SH AVAILABILITY This function is available since SDL_ttf 3\[char46]0\[char46]0\[char46] .SH SEE ALSO .BR TTF_SizeUTF8 (3), .BR TTF_SizeUNICODE (3)