FONTREQUEST

Top  Previous  Next

Syntax

STRING = FONTREQUEST(win as WINDOW,vSize as INT BYREF,vWeight as INT BYREF,vFlags as UINT BYREF,vColor as UINT BYREF,OPT name as STRING)

Description

The FONTREQUEST function opens the standard system font dialog. The function returns the name of the font and sets four variables with the attributes of the requested font.

Parameters

win - [in] Parent window or dialog

vSize - [in][out] The size of the selected font.

vWeight - [in][out] The weight of the font.

vFlags = [in][out] Attributes of the selected font

vColor = [in][out] Color of the selected font

name - [in] Optional font name to preset the combobox list.

Return value

.String containing the name of the selected font or an empty string, "" , if the dialog was canceled.

Remarks

The four variables vSize, vWeight, vFlags and vColor must be defined as type INT. They should be set to the initial selections to be displayed to the user or 0 for default values.

See Also: SETFONT

Example usage

DEF size,weight,flags,col:INT
DEF fontname:STRING
...
fontname = FONTREQUEST(win,size,weight,flags,col)
IF fontname <> ""
    SETFONT win,fontname,size,weight,flags
    FRONTPEN win,col
ENDIF