is it possible to attach a custom attribute to pieces of text?
In InDesign we can do this and use it to link pieces of text to database content so the text can be synced on demand.
We essentially attach metadata to text pieces.
As far as I understand adding information to art objects is possible using dictionaries - we just need the same for text pieces.
The reason we are not simply storing this in the art object (storing the text indices in the dictionary) is that we need to update the attributes like character attributes:
When the user changes the text by adding or removing characters, the attributes should be retained like character attributes.
Individual text runs cannot be assigned attributes; the only thing that has a dictionary is the art object itself.
That said, dictionaries can themselves have dictionaries, so maybe you can write something that is not as nice (I understand why you'd like to attach it to text directly) you may be able make a system that does what you need.
You should also be aware that knowing when a user has edited text is going to be problematic; it's easy to know art has been modified, but it's much harder to know which art has been modified.
That is unfortunate, but thank you very much for your response.