[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int TTF_SizeUTF8(TTF_Font *font,
const char *text, int *w, int *h)
Calculate the resulting surface size of the UTF8 encoded text rendered using font. No actual rendering is done, however correct kerning is done to get the actual width. The height returned in h is the same as you can get using 3.3.10 TTF_FontHeight.
NOTE: Passing a NULL font into this function will cause a segfault.
NOTE: Passing a NULL text into this function will result in undefined behavior.
Returns: 0 on success with the ints pointed to by w and h set as appropriate, if they are not NULL. -1 is returned on errors, such as a glyph in the string not being found.
Note that this example uses the same text as in the LATIN1 example, that is because plain ASCII is UTF8 compatible.
|
See Also:
3.3.20 TTF_SizeText,
3.3.22 TTF_SizeUNICODE,
3.4.2 TTF_RenderUTF8_Solid,
3.4.6 TTF_RenderUTF8_Shaded,
3.4.10 TTF_RenderUTF8_Blended