Different, but a little bit related. The work which is done actually on the possibility (not implemented but alreay realized) to colorize (style") the different graphemes of a glyph is very interesting.
Python with its absurd Flexible String Representation just become a no go for the kind of task. (Should not be too complicate to understand.) jmf -- https://mail.python.org/mailman/listinfo/python-list