FONTDIALOGA (return chosen font and character set)

Top  Previous  Next


FONTDIALOGA([title] ,typeface [,size] [,color] [,style] [,charset] [,added] )


Displays the standard Windows font choice dialog box to allow the user to choose a font and a character set.


A string constant or variable containing the title to place on the font choice dialog. If omitted, a default title is supplied by Windows.


A string variable (STRING in Clarion, CLASTRING in Clarion#) to receive the name of the chosen font.


A SREAL variable to receive the size (in points) of the chosen font.


A SIGNED integer variable to receive the red, green, and blue values for the color of the chosen font in the low-order three bytes.


A SIGNED integer variable to receive the strike weight and style of the chosen font.


A SIGNED integer variable to receive the character set value.


An integer constant or variable that specifies adding screen or printer fonts, or both, to the list of available fonts. Zero (0) adds screen fonts, one (1) adds printer fonts, two (2) adds both, four (4) adds true type only fonts, and eight (8) adds fixed pitch only fonts. If omitted, only Windows registered fonts are listed. Parameter not valid in Clarion#

The FONTDIALOGA procedure displays the Windows standard font choice dialog box to allow the user to choose a font and character set. When called, any values in the parameters set the default font values presented to the user in the font choice dialog. They also receive the user's choice when the user presses the "OK" button on the dialog. FONTDIALOGA returns zero (0) if the user pressed the Cancel button, or one (1) if the user pressed the "OK" button.

If you don't need a specific character set then you can use the FONTDIALOG procedure.

Return Data Type:



Typeface   STRING(31) !Use CLASTRING in Clarion#

FontSize   SIGNED

FontColor  LONG

FontStyle  LONG

CharSet    BYTE

Added      SIGNED


OPEN(MDIChild1)                                           !open the window

IF FONTDIALOGA('Choose Display Font',Typeface,FontSize,FontColor,FontStyle,CharSet,0)

 SETFONT(0,Typeface,FontSize,FontColor,FontStyle,CharSet) !Set window font


 SETFONT(0,'Arial',12)                                    !Set default font



 !Window handling code



See Also:

FONT(set default font)

Font Support Quick Summary