(function () {
var allFontNames = [];
for ( var i = 0; i < fonts.length; i++ ) {
allFontNames.push ( fonts[ i ].name );
}
var w = new Window ( "dialog", "Fonts" );
var list = w.add ( "dropdownlist", undefined, allFontNames, { scrolling: true } );
list.selection = 0;
w.show ();
}) ();