In a JTextPane with a DefaultStyledDocument the document structure (hierarchy of Element objects) ends with a LeafElement that spans all the character of the enclosing paragraph. Is there a way to customize the document such that each leaf element will represent a single character?
(Background: I am trying to implementing a custom coloring scheme - somewhat similar to syntax coloring in an IDE. Using setCharacterAttributes() for this purpose is not an option, mainly due to performance considerations.)