AskFont

Displays a font selection dialog box, and returns information on the selected font.

Syntax:

AskFont( type, flags, reg-key, format )

Parameters:

(i) type: specifies the type of fonts to be listed.

(i) flags: restricts the fonts that are listed.

(s) reg-key: specifies the name of a user-defined registry key under "HKEY_CURRENT_USER\Software\Wilson WindowWare" where persistent state information will be stored. It will be created if it does not already exist. If "" is specified, persistent state information will not be stored.

(i) format: specifies the format in which the selected font will be returned. See below.

Returns:

(s) font: info font information in requested format.

 

type

Specifies the type of fonts to be listed, and can be one of the following values:

 

value

meaning

0

Screen fonts

1

Printer fonts

2

Both screen and printer fonts

 

If "type" is 1 or 2, a default printer must be installed,otherwise an error will occur.

 

flags

Restricts the fonts that are listed, and can be 0 or more of the following values combined with the bitwise OR ('|') operator:

value

meaning

1

List only script fonts (exclude OEM and Symbol character sets)

2

List only non-vector fonts

4

List only fixed-pitch fonts

8

List only fonts available on both the printer and the display

16

List only scalable fonts

32

List only TrueType fonts

64

List only horizontally oriented fonts

 

If flag 8 is specified, "type" will automatically be set to 2.

 

format

Specifies the format in which information about the selected font will be returned:

value

meaning

0

Tab-delimited string in the format:

LogFont [@TAB] PointSize [@TAB] Color [@TAB] FontType

 

LogFont

a vertical-bar delimited string containing font attributes. See the "SysParamInfo" function for a description of the LOGFONT format string.

 

PointSize

the font size in 1/10 of a point.

 

Color

the font color, as an RGB color value in the form "#RRGGBB". See the "AskColor" function for a description.

 

FontType

a bitmask specifying the font type, consisting of one or more of the following values which can be extracted with the bitwise AND ('&') operator:

Value Meaning

256 The font weight is bold

512 The italic font attribute is set

1024 The font weight is normal

8192 The font is a screen font

16384 The font is a printer font

32768 The font is simulated by the graphics device interface (GDI)

 

 

Example:

type=0
flags=0
customkeyword="test"
format=0
MyFont=AskFont( type, flags, customkeyword, format )
Message("AskFont return value is",MyFont)
See Also:

AskColor