Get the size of a rotated text

Get the size of a rotated text

Post by John » Tue, 15 Apr 2008 21:40:59


Hello,

how can i get the size of a rotated text ?
I have tryed TCanvas.TextExtent, but the result is not correct.
Any alternative

Thanks

John
 
 
 

Get the size of a rotated text

Post by Team » Wed, 16 Apr 2008 02:11:38


What this function (or better the API function behind it) returns is
the extent of the unrotated text. The docs for the API GetTextExtent*
functions (like GetTextExtentPoint32) have a comment in the results:

"When returning the text extent, this function assumes that the text is
horizontal, that is, that the escapement is always 0. This is true for
both the horizontal and vertical measurements of the text. Even if
using a font specifying a nonzero escapement, this function will not
use the angle while computing the text extent, the application must
convert it explicitly."

Which means that you have to rotate the output rectangle yourself to
get the rotated dimensions.


--
Peter Below (TeamB)
Don't be a vampire ( http://www.yqcomputer.com/ ),
use the newsgroup archives :
http://www.yqcomputer.com/
http://www.yqcomputer.com/

 
 
 

Get the size of a rotated text

Post by John » Thu, 17 Apr 2008 00:05:06

Thanks Peter