Thank you: this isn't a complete solution yet – mostly because Apple insist repeatedly that one should submit a minimum example of the problem, and that is exactly what I did, removing all features that weren't relevant to the specific problem!
Since the "minimum" example didn't include them, your solution ignores those features and there seems to be no way of putting them back in. There are three that are relevant:
You ignore and obliterate the font specified in the original NSAttributedString. In practice a full text would include (for example) headings which use a bold font, as well as lines and paragraphs using a normal font. Is there a way of adapting the solution to do this?
Following on from this, it is also necessary to have individual words have a font of their own (suppose, for instance, that in the NSAttributedString in the example, the words forty-two were bold). Is this doable?
I appreciate how you have taken the indentation properties from the individual parts of the string and applied them when constructing the Text items. Is it similarly possible to make paragraphSpacing and paragraphSpacingBefore work? We use them both, and need them.
Topic:
UI Frameworks
SubTopic:
SwiftUI