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
}
}
How do you get a list of all the installed fonts?
var fontsCollection = new InstalledFontCollection();
foreach (var fontFamily in fontsCollection.Families)
{
if (fontFamily.Name == fontName) {...} \\ check if font is installed
}
See InstalledFontCollection class for details.
MSDN:
Enumerating Installed Fonts