List Installed Fonts

Here is some simple code for creating a list of all your installed fonts in order to create a visual reference. It may be of more interest to a web designer. I suggest you print the web page so you can easily find an appropriate font. Some applications have font drop down menus that display font names using that font but I would rather have a handy print out.

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using System.Drawing;

/// <summary>
/// Lists all the installed fonts for a quick visual reference.
/// </summary>
public partial class ListFonts : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        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();
        }
    }
}

I'm not doing anything interesting with ASP.NET at the moment. I recently got an iBook so I've been busy exploring OS X. I'm also reading my second book on After Effects because I want to get back to creative work. If you are a geek and a big movie fan then you should really explore the world of digital video editing and motion graphics. The complexity of the software will satisfy your geek side. Many of the high end video editing systems have steep learning curves. As a digital film geek you'll get to network with amateur filmmakers and videographers who are increasingly interested in promoting their work online and therefore involved in social networking, media startups, etc.

I will be exploring asynchronous web requests because I've run into several situations where my code is waiting too long for a web request. There are some technical challenges in making multiple asynchronous web requests in a loop and dealing with their staggered completion.

3 Comments

  • You need to figure out a different way to display your code. A lot of the code on the right hand side that is not visible.

  • I'm a total video geek, and After Effects just gets better and better every release. I finally let go of Avid, as I think Final Cut Pro is much easier to deal with (though its media management could be a little better).

  • Very good code ,its working perfectly for asp.net web application ,but what to do with silverlight application

Comments have been disabled for this content.