I'm interested in creating a 2D game that will contain a large amount of dialogue. I'm looking for a game library or 2D rendering library with good support for rich text. Specifically, I need to be able to change certain words to be different colors, and certain characters to be italic while other are non-italic, all in the same piece of text.
I'll also need a way to tell the width in pixels of a piece of text, so that I can determine when it's about to overflow the current line of the dialogue box. I'll be creating a line of dialogue by appending characters to it, one character at a time.
Has anyone had experiences with a library like this? I have tried things like SDL and SFML in past and they have no support for text operations like this. Sometimes it's hard just to get text which is properly anti-aliased.
I'm not interested in using a visual novel engine like Ren'Py because it's too limiting (my game will contain a lot more than just dialogue).