Extensions Reference
Extensions Reference > exDialogs
dlgFontDialog
bool dlgFontDialog(string Font, int Size, bool Bold, bool Italic);
Displays a font selection dialog
The DLGFONTDIALOG function displays a standard Windows font selection dialog for the user to pick a colour. The parameters to this function specify the defaults that should be used when the dialog first opens. To retrieve the selected font once the dialog has been closed refer to the dlgFontDialogGetName, dlgFontDialogGetSize, dlgFontDialogGetBold and dlgFontDialogGetItalic functions.
The standard Windows font selector only provides for a limited, unchangeable range of colours to be selected. This functionality has been removed from the DLGFONTDIALOG function. If you need to allow the selection of a colour, refer to the dlgColourDialog function which supports a colourwheel-style full range colour selector.
Parameters
Font
The name of the font to select by default
Size
The point size of the font to use by default
Bold
True if the default selection should be bold, otherwise False for a normal typeface
Italic
True if the default selection should be italic, otherwise False for a normal typeface
Return Value
True if the user closes the dialog using the OK button, otherwise False.
Example Code
// Open the dialog with Arial 10pt non bold, italic selected
if(dlgFontDialog("Arial", 10, False, True) == True)
{
// Use the new font selection here
}