This is MY blog. The views represented here are not in relation to anybody else. Please read my full disclaimer for a more complete disclaimer.
I recently ran across this post and loved it! I do some image creation stuff and the hardest part of my task is picking a font. Now I can print out my installed fonts and quickly pick one out.
Now here is the guys code, but slightly edited. As his had a few syntax errors in it.
try
{
StringBuilder sb = new StringBuilder();
foreach (FontFamily family in FontFamily.Families)
sb.Append("<h2 style='color:blue;font-family:Arial;'>" + family.Name + "</h2>");
sb.Append("<font face='" + family.Name + "' size='6'>");
sb.Append("The quick brown fox jumps over the lazy dog. 1234567890");
sb.Append("</font><hr/>");
sb.Append(Environment.NewLine);
}
lblFontList.Text = sb.ToString();
catch (Exception ex)
lblErrorMessage.Text = ex.ToString();
Related posts