Actually, for anyone who is interested in Text display, here is a rudimentary Text wrapping function, where fo is an roFont, px is the type size, and maxwidth is the number of pixels. This function could be improved significantly, for example, maxwidth should be a separate parameter from paragraph width.
function linebreak(text as string,fo as object,px as integer,maxwidth as integer) as object
timer=createobject("rotimespan")
timer.mark()
arr=text.tokenize(" ")
line=arr[0]
paragraph=[]
length=fo.getonelinewidth(line,maxwidth)
?"length: ";length;
?"maxwidth: ";maxwidth
inc=1
while inc < arr.count()-1
length=fo.getonelinewidth(line+" "+arr[inc],maxwidth)
?"length: ";fo.getonelinewidth(line,maxwidth);" line: ";line;
?"length: ";fo.getonelinewidth(line+" "+arr[inc],maxwidth);" line+: ";line+" "+arr[inc]
if length >= maxwidth -30
paragraph.push(line)
length=0
line=""
line=line+arr[inc]
inc=inc+1
else if length < maxwidth-30 and paragraph.count()<2 then
line=line+" "+arr[inc]
inc=inc+1
else
line=line+" "+arr[inc]
inc=inc+1
end if
end while
line=line+" "+arr[inc]
paragraph.push(line)
'? "FINAL paragraph":
'? paragraph
'?"paragraph parsed in: ";timer.totalmilliseconds()
return paragraph
end function