@Kent1Cooper wrote:
.... I'm having a hard time imagining how the resulting individual-word objects could be positioned for the "same look." ....
[EDIT -- Message 9 arrived while I was writing this, and what it's talking about is less complex in some ways, but most principles could still apply....]
Actually, I'm starting to imagine that it might be possible, at least with some conditions. The critical thing I'm finding is that the bounding box of Mtext "reaches" leftward to encompass leading spaces if present, in contrast to the fact that [for whatever reason] it does not "reach" rightward to encompass trailing spaces. So:
1. divide up the Mtext's content at the spaces, keeping each space as part of the string of the following word;
2. divide at any hard or soft returns, with some encoding of their presence to cover line breaks that are not just the result of word-wrapping;
3. put in individual Mtext objects for each word, individually set to zero defined width, positioning them by their bounding boxes which [after the first] will include the spacing from the previous one;
4.. watch for when one would overshoot the source Mtext's right-most extent, and if it would, go to the next line. The line spacing for moving down to the next can be calculated from the source Mtext's entity data.
There's the question of the position of the first word on each line after the first, if its bounding box includes a space that you wouldn't want at the beginning of the line. It should be possible to determine that a word would overshoot the right side, and if so, to not just go down to a next line, but to first remove the space and re-establish the bounding box.
I think that might not be too hard for Top-Left-justified Mtext at "Exactly" line-spacing style. If this is all bounding-box-based, it turns out that bounding boxes do not account for taller-than-capitals [in some fonts] characters like | / ( ), which are the things that stretch the line spacing under "At Least" spacing style. I'm not sure how one could account for that kind of line spacing variation, since how much taller those characters are is buried in the font definition, and not available from something like entity data. And at the time a new line is started, it wouldn't know whether a taller object might be coming farther along on that same line.
Working from other source-Mtext justifications could be rather complicated, but may be possible. For right justifications it would presumably involve Moving a whole line's worth of words leftward as each word is added. Likewise for bottom justifications, Moving whole lines upward as each new line is started, etc. Non-zero rotations would further complicate things.
Internal formatting such as color and font and size changes would get messed up unless they apply only to a single word, with their coding fully contained between the spaces around that word. Whether to STRIP all internal formatting first would be a question.
Anyway, something to think about....
Kent Cooper, AIA