This method presents a system font chooser. The method returns current font
information selected in a
basics::dictionary. If the dialog is canceled the
basics::dictionary will be empty.
The dictionary keys are:
- faceName (string) - font face name selected.
- pointSize (integer) - point size selected.
- rgbColors (unsigned integer) - color selected.
- isBold (bool) - bold selected.
- isItalic (bool) - italic selected.
- isUnderline (bool) - underline selected.
- isStrikeOut (bool) - strikeout selected. Note: Strikeout is currently not supported in Boxely.
function onFontDialog()
{
// Open Font dialog with inital font name Times New Roman, and size 14.
var fontDictionary = appUtils.fontDialog(scene, "Times New Roman", 14);
if (fontDictionary)
{
// Get a list of all the keys.
var keyList = fontDictionary.allKeys();
var count = keyList.count;
for (var i = 0; i < count; ++i)
{
// Iterate thru all the keys getting the value.
var key = keyList.getValue(i);
var value = fontDictionary.valueForKey(key);
if (key == "rgbColors")
shell.print("key = " + key + " value = 0x" + value.toString(16).toLowerCase());
else
shell.print("key = " + key + " value = " + value);
}
}
}