Quote:Original post by Fiddler
Solution: split your text into text runs (one run per [font, style, size, color] combination) and draw the runs sequentially.
The problem is that if the run word-wraps, it won't wrap with respect to the full bounding rectangle of the whole string, just the bounding rectangle for that individual run.
Quote:Better solution: use a RichTextControl which offers this functionality out of the box.
I looked into this, but there were two problems: firstly it doesn't support drawing to a bitmap and I would have to use some pInvoke magic to get that to work, and secondly it doesn't support a transparent background so I'd have to subclass my own custom control and add that support.
Quote:Another solution: use a WebBrowser Control and format your text using HTML.
I didn't think about this control, but it appears to have the same two limitations as RichTextControl.
At this point I'm just thinking of giving up and not supporting this feature. It's simply too much effort for something I thought would be simple.