Ed,
first I thought this can not be done, than I faked multiple one line fields and tested for the formattedwidth to advance to the next field. With Scott Rossi's suggestion of formattedRect it gave me the idea that you can get the formattedWidth of chunks as well. So I tried this in the script of a field with its alignement set to center (any other works also)
Code: Select all
on keyDown theKey
put word 2 of the selectedLine into tLine
if the formattedWidth of line tLine of me > 36 + (10*tLine) then -- adjust for the progression of width
-- trying not to break words
if (last char of line tLine of me <> " ") then
put cr before last word of line tLine of me
select after me
pass keyDown
else
put return after line tLine of me
select after me
pass keyDown
end if
end if
pass keyDown
end keyDown
This is by no means a complete solution. The user can go into any line and add text that will change the whole layout, also if the user deletes words in the middle of the text and so on. This is probably not the complete code behind the fancy page layout programs that can do these things. But depending on your needs you might get sufficient control over the triangular text layout.
Just one way to approach this.
regards
Bernd