I've a feeling I might be missing something with Pango. Almost everything in the API seems geared towards displaying static text with the exception of two functions to draw/move a cursor at a particular position which suggests there might be a built in way to achieve editing text.
For example, to mark a block of text with the mouse (ie change the background color between two points), I can either regenerate the text with changed tags for every single mouse move or draw the rectangles in Cairo and then use Pango to draw the text with a transparent background over the top. Is there a way of applying attributes to a range without regenerating or redrawing the entire screen?
Similarly, if I have Pango draw the cursor and handle key press events myself, is there an alternative to redrawing the entire screen?
GtkTextBuffer is not an option - I don't have all the text at any time and it's far more efficient to calculate what needs to be displayed on the fly from a compact binary format and using a constantly changing set of filters. As well as being bloated, redundant and inelegant, it's also fantastically slow.