User Tools

Site Tools


fontdialoga_return_chosen_font_and_character_set_.htm
Navigation:  Language Reference > 13 - Built-in Functions >====== FONTDIALOGA (return chosen font and character set) ====== Previous pageReturn to chapter overviewNext page

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

blk2blue.jpg

FONTDIALOGA Displays the standard Windows font choice dialog box to allow the user to choose a font and a character set.
title A string constant or variable containing the title to place on the font choice dialog. If omitted, a default title is supplied by Windows.
typeface A string variable (STRING in Clarion, CLASTRING in Clarion#) to receive the name of the chosen font.
size A SIGNED variable to receive the size (in points) of the chosen font.
color A LONG integer variable to receive the red, green, and blue values for the color of the chosen font in the low-order three bytes.
style A LONG integer variable to receive the strike weight and style of the chosen font.
charset A BYTE integer variable to receive the character set value.
added 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: BOOL

Example:

Typeface   STRING(31) !Use CLASTRING in Clarion#

FontSize   SIGNED

FontColor  LONG

FontStyle  LONG

CharSet    BYTE

Added      SIGNED

CODE

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

ELSE

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

END

ACCEPT

 !Window handling code

END

See Also:

FONT(set default font)

Font Support Quick Summary

fontdialoga_return_chosen_font_and_character_set_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1