GetFontInstalled Method (.NET)

 

Returns: An a boolean value indicating whether font fontName is installed. This is a convenience method used to determine whether the FontsInstalled property contains a specified font name.

 

Syntax:

bool bIsFontInstalled = extBrow.GetFontInstalled(string fontName);

 

Note: You must call this method after the GetExtendedBrowser method has been called. Otherwise the font detection will not have been performed yet.

 

Note: Unless you specify "all" in FontsToCheck, the font name passed into GetFontsInstalled must be a name in the FontsToCheck property. For example if FontsToCheck is equal to "arial, verdana, times", valid font names to use in the call to GetFontsInstalled are "arial", "verdana", and "times". If FontsToCheck is set to "all", then any font name can be used in the call to the GetFontInstalled method.

 

Tip: See the source for the BrowserHawk fontcheck.aspx sample (\Program Files\cyScape\BrowserHawk\samples\dotnet) for more details on detecting fonts with BrowserHawk and a full example.

 

C# Example:

<%

ExtendedOptions options = new ExtendedOptions();

options.FontsToCheck = "verdana,arial";

options.AddProperties(ExtendedBrowserObj.Prop.FONTSINSTALLED);

ExtendedBrowserObj extBrow = BrowserObj.GetExtendedBrowser(options);

bool bVerdanaInstalled = extBrow.GetFontInstalled("verdana");

%>

<html> Verdana installed? <% = bVerdanaInstalled.ToString() %> </html>

 

See Also:

FontsInstalled Property (.NET)