DIALOG DEFAULT FONT statement

Purpose | Specify the default DDT font information.
Syntax | DIALOG DEFAULT FONT fontname$ [,points&, style&, charset&] Legacy syntax: DIALOG FONT [DEFAULT] fontname$ [,points&, style&, charset&]
fontname$ | Name of the font.
points& | Size of the font, in points.

style&

Font style attribute.

0 | Normal
2 | Italic

charset&

CharSet identifier.

0 | ANSI CharSet | 162 | Turkish CharSet
1 | Default CharSet | 177 | Hebrew CharSet
2 | Symbol CharSet | 178 | Arabic CharSet
77 | Mac CharSet | 186 | Baltic CharSet
128 | Shiftjis CharSet | 204 | Russian CharSet
129 | Hangeul CharSet | 222 | Thai CharSet
130 | Johab CharSet | 238 | East Europe CharSet
136 | Chinese CharSet | 255 | OEM CharSet
161 | Greek CharSet |  |

Remarks

The DIALOG DEFAULT FONT statement specifies the font which will be used for all subsequent dialogs created with DIALOG NEW, until another DIALOG DEFAULT FONT statement is executed. When a DIALOG NEW statement is executed, the selected default font is associated with it, and its vhild controls, for the lifetime of the dialog.

The default font is particularly important when creating new dialogs which use dialog units (rather than pixels) as the unit of measurement. When sizing in dialog units, Windows calculates the physical size of the window based upon the font size, among other factors. Changing the font size later will not update the window size.

You may use the value zero (0) for any of the numeric parameters to designate that the compiler should use the default for that item. If parameter(s) are missing, the compiler substitutes the default value for all remaining parameters. If no DIALOG DEFAULT FONT statement is executed, PowerBASIC will select MS Sans Serif, 8 point, with no style attributes.

When specifying a font, care should be exercised to use a standard font that is available in all versions of Windows, such as "Times New Roman", "Arial", "Courier", "MS Sans Serif", etc. Specifying a font name that is not available forces Windows to substitute a font that may not be visually appealing, and may also alter the relative size of the dialog.

DIALOG DEFAULT FONT is module-specific. That is, it only affects subsequent dialogs created by code in the same EXE or DLL. For example, a DIALOG DEFAULT FONT statement in a DLL, will not affect dialogs created in the calling EXE or other DLLs loaded by the EXE.

See also | CONTROL SET FONT, Dynamic Dialog Tools, DIALOG NEW, DIALOG SET COLOR, FONT END, FONT NEW, GRAPHIC SET FONT, XPRINT SET FONT