Pascal
function tsTextGetHeightA(pText: pAnsiChar): tsInt; function tsTextGetHeightW(pText: pWideChar): tsInt;
C/C++
tsInt tsTextGetHeightA(char * pText); tsInt tsTextGetHeightW(WideChar * pText);
This function calculates the height of an text and returns it. You also can use this function to query the actual height of the text inside an blockmode. For this you can call this functions inside the block mode with nil / NULL as pText and it will return the actual height.
If you query the height of an single text (pText is not nil / NULL) the return value is equal to the fontparameter TS_FONT_LINESKIP and no calculation will be performed.
It's an pointer to an null terminated string that contains the text of which you wants to know the height. If you call this function inside the block mode and you pass nil / NULL for pText the function will return the width of the actual drawn text.
Return value is the width of the given text or the width of the drawn text inside the block mode.
There is no active context. See also tsContextBind.
There was no renderer set. See the parameter TS_RENDERER.
There was no font bound to the actual context. See also tsFontBind.
This could happen only in the ansi version. And there was an error to convert the ansi to unicode text. But it's nearly not possible to get this error.
If you pass nil / NULL to this function. If you really wants to draw some text you should put it into this function. With nil / NULL this won't work.