I'm writing an application which needs to draw a lot of text - several lines, maybe tens of lines - in Direct3D9. The text can be heavily formatted (i.e. different typefaces, styles, sizes) and can contain unicode symbols from different charsets. Worst of all, it can change on the fly, so it needs to be dynamic (render once display always won't do).
There are two problems with that: first, I'll probably need a lot of calls to D3DXCreateFont, which are supposedly costly (I'm not sure myself). Another approach is to create all the fonts before drawing the multi-part-line, and then just switch between them - is this better? Well, I can also create font objects on-the-fly as I draw the line, add them to some kind of font-object-cache and then look in cache before trying to create a new one? What do you think, which is the best approach?
The second problem is that D3DXFont seem to not understand underline/strike-through font styles. Although D3DFONT is based on LOGFONT, it omits those fields (supports italic though). Let's say I really really need underline/strike-through, what do I do? Is there a way to force ID3DXFont to do underline? Should I just draw those lines myself (how do I do that fast)? Or maybe I should switch to drawing with GDI on HDC and then copying those pixels into texture - will that provide reasonable performance?