You should do
tm.GetMeshDimensions( tm.GetFormattedString( str ) );
The "height" returned is negative as it returns the cursor postion relative to the start position.
Its not ideal, but at least you'll be able to use the information.
I will create a variant that will return the correct mesh size, including clipping due to maxchars in a future version. Its been in the todo for a while now.