ActionScript 2.0 Language Reference |
|
|
|
| ActionScript classes > TextField > getFontList (TextField.getFontList method) | |||
public static getFontList() : Array
Returns the names of fonts on the player's host system as an array. (This method does not return names of all fonts in currently loaded SWF files.) The names are of type String. This method is a static method of the global TextField class. You cannot specify a text field instance when you call this method.
Availability: ActionScript 1.0; Flash Player 6
Array - An array of font names.
The following code displays a font list returned by getFontList():
var font_array:Array = TextField.getFontList();
font_array.sort();
trace("You have "+font_array.length+" fonts currently installed");
trace("--------------------------------------");
for (var i = 0; i<font_array.length; i++) {
trace("Font #"+(i+1)+":\t"+font_array[i]);
}
|
|
|
|