I would probably use the libgtkhtml library to do the HTML rendering part. I haven't got a linux box handy to verify this at the moment, but I am sure that you would be able to get the level of control you seek with the library.
Installing Gtk::HTML (actually getting all the *-dev packages I need from Debian). We'll see how it goes. The best part will be if I can do this without installing XFree on my server.