Wednesday, January 16, 2008

FontConverter.ConvertFromInvariantString - Add Italics

I didn't find the MSDN documentation very complete when it came to this. It was fairly obvious that I could feed "Verdana, 15.75pt" into the ConvertFromInvariantString method and get the right font returned, but I wasn't sure how to make that Italic. Since I am using this to skin my application, I wanted to put this string in a config file.

FontConverter fc = new FontConverter();Font headerFont = (Font)fc.ConvertFromInvariantString("Verdana, 15.75pt, style=Italic");

No comments:

Post a Comment