Page 1 of 1

bounding rect of text

Posted: Tue Aug 02, 2005 08:43
by Sachin

Is there a way to get the bounding rectangle of some text.. i mean i want to create a generic message box..i also want that wen the constructor of the message box receives some text it should automatically resize itself according to the text size. (ofcourse the font size will also play a role in this)

Re: bounding rect of text

Posted: Thu Aug 04, 2005 09:44
by CrazyEddie
Look at

Font::getFormattedLineCount and Font::getFormattedTextExtent

Though you might find a catch-22 situation because the space occupied by a given text will be determined by the area in which you render it and the formatting used.