SETFONT

Top  Previous  Next

Syntax

SETFONT(win as WINDOW,typeface as STRING,height as INT,weight as INT,OPT flags=0 as UINT,OPT id=0 as UINT)

Description

Changes the font of a window or control.

Parameters

win - Window or parent dialog.

typeface - Name of new font.

height - Size of font in points.

weight - Weight of font.

flags - Style flags for font and character set.

id - Optional control identifier.

Return value

None

Remarks

height and weight can both be 0 in which case a default size and weight will be used. Weight ranges from 0 to 1000 with 700 being standard for bold fonts and 400 for normal fonts. Flags can be a combination of @SFITALIC, @SFUNDERLINE, or @SFSTRIKEOUT  for italicized,  underlined, and strikeout fonts. If an id is specified then the font of a control in the window or dialog is changed.

Certain fonts may have more than one character set. Normally this information is set automatically by the flag value returned by FONTREQUEST. You can set the character set manually by using the following values OR'ed in with the flags

ANSI_CHARSET  = 0

DEFAULT_CHARSET = 0x00010000

SYMBOL_CHARSET  = 0x00020000

SHIFTJIS_CHARSET = 0x00800000

HANGEUL_CHARSET 0x00810000

GB2312_CHARSET  = 0x00860000

CHINESEBIG5_CHARSET = 0x00880000

OEM_CHARSET = 0x00FF0000

JOHAB_CHARSET = 0x00820000

HEBREW_CHARSET  = 0x00B10000

ARABIC_CHARSET  = 0x00B20000

GREEK_CHARSET = 0x00A10000

TURKISH_CHARSET = 0x00A20000

VIETNAMESE_CHARSET = 0x00A30000

THAI_CHARSET = 0x00DE0000

EASTEUROPE_CHARSET = 0x00EE0000

RUSSIAN_CHARSET = 0x00CC0000

MAC_CHARSET = 0x004D0000

BALTIC_CHARSET = 0x00BA0000

See Also: FONTREQUEST

Example usage

SETFONT mywin, "Terminal", 20, 700, @SFITALIC | 0x00FF0000