Retrieves a collection of all the system-supported fonts.
Syntax
[ oColl = ] HtmlDlgSafeHelper.fonts[ oObject = ] HtmlDlgSafeHelper.fonts(iIndex)
Possible Values
oColl A collection of system-supported fonts. oObjectReference to an individual item in the array of elements contained by the object.iIndexRequired. Integer that specifies the zero-based index of the item to be returned.
Members Table
The following table lists the members exposed by the fonts object. Attributes/Properties Show: Attributes/Properties Methods PropertyDescriptionCount Retrieves the number of available block format tags. MethodDescriptionItem Retrieves a string that specifies the name of a block format tag.
The following table lists the members exposed by the fonts object.
Remarks
fonts was introduced in Microsoft Internet Explorer 6
Example
The following example displays the total number of system fonts, and then displays a list of their names. function testFonts() { var a=dlgHelper.fonts.count; alert(a); //show total number of system fonts for (i = 1;i < dlgHelper.fonts.count;i++) { var f= f + " " + dlgHelper.fonts(i) } alert(f); //show names of all system fonts } This feature requires Microsoft Internet Explorer 6.0 or later. Click the following icon to install the latest version. Then reload this page to view the sample.
The following example displays the total number of system fonts, and then displays a list of their names.
function testFonts() { var a=dlgHelper.fonts.count; alert(a); //show total number of system fonts for (i = 1;i < dlgHelper.fonts.count;i++) { var f= f + " " + dlgHelper.fonts(i) } alert(f); //show names of all system fonts }
Applies To
HtmlDlgSafeHelper
For this code to work, you need to add:
<OBJECT id=dlgHelper CLASSID="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" width="0px" height="0px"></OBJECT>
to the body of your html.