Truncate Text Until Last Visible Word?
Hello,
I have a RichEditableText populated by markup similar to:
<p><span font="xyz" font-size="12">This is a string of text that may be cut-off on screen depending on the size of the container and the size/style of the selected font.</span></p>
I would like to be able to identify the point in the text where it is no longer visible on screen, then save only the visible chars to a db. For example, if the font were very big, and the container relatively small, we may only be able to see up to the word "cut-off" - in which case I would like to save the string "This is a string of text that may be cut-off" to my db. If the font/style or size changes, the string would be cut-off at a different point and I would liek to save up to there.
Anyone have an idea of how to go about doing that?
Cheers,
Baz
