I have 2 FormattedTextAreas. They have different widths and heights. I tried to get the overflow from the first and put it in the second, but GetOverflowFormattedTextArea tells me that I cannot set the width of an overflow text area. I also cannot read the overflow text.
Possible workaround ?
Mike
GetOverflowFormattedTextArea
Re: GetOverflowFormattedTextArea
Support · Feb 15, 2008Hello Mike,
Currently the ability to overflow text with different widths or heights is only available using the TextArea object. The FormattedTextArea has the limitation that the overflow must always have the same width as the original. Also it is not possible to get the overflow text.
You may use the following work around but this will not be perfect always if you use a big fonts in your text.
Create a TextArea object with some height and width, but do not add it to the page. Get the overflow text and use it to determine where the text breaks. Then split the original text at this point into two pieces. Create two FormattedTextAreas with the required widths and heights with the respective texts.
Actually to go even further, if you took your text (the text that included the formatting tags) made a copy of it and in this copy go through and remove all the formatting tags (remove all the <b> and </b>, <font>, etc. tags). Then you would have a new string that was much closer in size to that in which your Formatted Text would actually appear. Then use that new string in "dummy" calculations used inside the TextArea.
Either of these methods will have some limitations like if your formatted text contains paragraph tags that is going to through off this rough calculation. Or if you are using a larger font size in some areas or a lot of bold words this will eventually do the same.
But as a general workaround and understanding the limitations this could work for much of the time.
Thanks,
ceTe Software Support Team.
Re: GetOverflowFormattedTextArea
Forum member · Feb 15, 2008I think I'm going to need something more exact than that. I tried creating a document and calling draw but the FormattedTextArea still would not let me read its Text.
So I think now I'm going to try to write a method that just keeps adding words to a formatted text area until HasOverflowText is true. Of course this may be tricky since each word could be formatted differently.
Mike