Test if a Font is installed

string fontName = "Consolas";
float fontSize = 12;

using (Font fontTester = new Font( 
       fontName, 
       fontSize, 
       FontStyle.Regular, 
       GraphicsUnit.Pixel)) 
{
    if (fontTester.Name == fontName)
    {
        // Font exists
    }
    else
    {
        // Font doesn't exist
    }
}

Leave a Comment