From: Arthur Rats Date: 2009-08-31T21:04:35+09:00 Subject: Re: Loooong wordwrap def wordwrap(textinput,width,font) lines=[] if (textinput.text.index(' ').nil? and font.text_width(textinput.text) > width) no_lines=font.text_width(textinput.text)/width b = no_lines.ceil no_chars=textinput.caret_pos no_each_line=(textinput.caret_pos / b).ceil for i in 1..b do if i < b lines.push(textinput.text.slice((i-1)*no_each_line.to_i,no_each_line)) else lines.push(textinput.text.slice((i-1)*no_each_line.to_i,no_each_line+b)) end end else words = textinput.text.split(' ') lines = [words.shift] words.each do |word| if font.text_width("#{lines[-1]} #{word}") < width lines[-1] << ' ' << word else lines.push(word) end end end return lines end something like this - is what I need to do but I am chopping the text in to equal parts to make it fit into lines within the box, -- Posted via http://www.ruby-forum.com/.