You are here: Reference > JavaScript > client-side > ActiveX > HtmlDlgSafeHelper objects > objects > fonts
fonts collection
Represents a collection of all available fonts in the current system.
Syntax:
Properties that reference the object:
| HtmlDlgSafeHelper.fonts |
Possible members:
Properties:
Returns an integer that specifies the number of available fonts.
This property is read-only. |
Methods:
item (index) |
Returns the name of a font by index.
Parameters:
Return value:
Returns a string that contains the name of the font at the specified position.
|
Example HTML code 1:
This example illustrates the use of the fonts collection:
|
||||
<head> <script type="text/javascript"> function ShowFonts () { var dlgHelper = document.getElementById ("dlgHelper"); if (dlgHelper.fonts) { // Internet Exlporer var fontList = ""; for (var i = 1; i < dlgHelper.fonts.Count; i++) { if (i > 1) { fontList += ", "; } fontList += dlgHelper.fonts (i); } alert ("The number of fonts is " + dlgHelper.fonts.Count); alert ("The available system fonts:\n" + fontList); } else { alert ("Your browser doesn't support this example!"); } } </script> </head> <body> <object id="dlgHelper" classid="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" width="0px" height="0px"></object> <button onclick="ShowFonts ();">Show system fonts!</button> </body> |
||||
|
||||
Did you find this example helpful?
|
External links:
User Contributed Comments