I'm working on creating an application that will display JSON data in a nicely formatted paragraph. The JSON data has things like a title, sub-title, body, etc. In the body there can be links (which I just need to display as blue and underlined) And this is where I'm running into trouble.
The program is based on the .net Compact Framework and I'm only given a Graphics object along with the JSON object (and a rectangle, font, color). Is there anyway to nicely draw a string of text with all of the links changed to the different color/font?
My thoughts have been to draw each individual word and just change the font right then when the word comes up. This sounds very inefficient. Is there a better way?
Oh, p.s. If there is an easy way to determine the proper height of the rectangle in the DrawString method, so that no text is clipped, that would also be very helpful!
UPDATE: I figured out my P.S. question :) http://www.mobilepractices.com/2007/12/multi-line-graphicsmeasurestring.html