Tooltips; More or less Swing related
Suppose I have an infix expression, more exact: I have the abstract syntax tree of the expression. I have complete control over this AST and can 'visit' every node of it. It is easy to reconstruct the textual representation of such an expression. (or the postfix form or whatever).
I can even 'pretty print' it using a Graphics2D object, using several font sizes and colours for, say, the operators, built-in functions etc. no problem at all. Now I want to display such a 'pretty printed' expression in a tooltip. I could save the image generated on the Graphics2D object and load it as a file in my html text for the tooltip, but I don't want that.
Html and I don't like each other; we are never going to become friends, hence my question; is there an css definition (or similar) that can (partly) generate html for (more or less) simple infix mathematical expressions?
I realize this is more of an html question (version 3.2 I presume?) but I googled quite a bit and have not met anything half usefull. Any hints, tips, encouragement are appreciated. I just want infix expressions pretty printed on a tooltip.