OCDProgrammer.com

It's Microsoft's World, and I'm just living in it
View Clarence Klopfstein's profile on LinkedIn

Clarence Klopfstein's Facebook profile

This site is under construction...

Categories

New Comments

Referring Sites


Disclaimer

  • 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.

List all installed fonts on your machine

June 24, 2008 03: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();
}

Comments are closed