Page 1 of 1

Height of a text

Posted: Wed Oct 31, 2012 12:14 am
by bert
Hi all :) i look for a way to get the height of a multiline text. Is it possible with something like xxx:getWidth(). Anyone has an idea ? :)

Re: Height of a text

Posted: Wed Oct 31, 2012 6:08 am
by Xgoff
bert wrote:Hi all :) i look for a way to get the height of a multiline text. Is it possible with something like xxx:getWidth(). Anyone has an idea ? :)
weird but i would guess

Code: Select all

your_font:getHeight() * select(2, your_font:getWrap("text you're printing", your_printf_width))

Re: Height of a text

Posted: Wed Oct 31, 2012 8:23 am
by T-Bone
I typically store mutliline text as a table with strings, one for each line. That makes it simpler, just

font:getHeight() * #texts