CK's Tech Blog
It's Microsoft's World, and I'm just living in it

List all installed fonts on your machine

June 24, 2008 06:00 by ckincincy

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();
}

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading