DISPLAY FONT statement

Purpose | Display a font selection dialog to return user choices.
Syntax | DISPLAY FONT [hParent], [xpos&], [ypos&], defname$, defpoints&, defstyle&, flags& _ TO fontname$, points&, style& [,colorval&, charset&]
hParent | Handle of the parent window or dialog. If there is no parent, use zero (0) or %HWND_DESKTOP.
xpos | Horizontal position, in pixels, relative to the parent window. If omitted, PowerBASIC selects the position (offset from the parent, or centered if no parent).
ypos | Vertical position, in pixels, relative to the parent window. If missing, PowerBASIC selects the position (offset from the parent, or centered if no parent).
defname$ | The name of the default, pre-selected font which will be initially highlighted when the font dialog is displayed. A default font may be disabled by passing a nul, zero-length ("").
defpoints& | The point size of the default, pre-selected font.
defstyle& | The style attribute of the default, pre-selected font. See the specific definition of style& below.
flags& | The style attributes of the FONT Dialog. The following values may be used alone or combined, and are predefined in the PowerBASIC compiler:
%CF_BOTH | Causes the dialog box to list both screen and printer fonts.
%CF_TTONLY | Specifies that Font selection dialog should only enumerate and allow the selection of TrueType fonts.
%CF_EFFECTS | Specifies that Font selection dialog should enable strikeout, underline, and color effect choices.
%CF_FIXEDPITCHONLY | Specifies that Font selection dialog should select only fixed-pitch fonts.
%CF_FORCEFONTEXIST | Specifies that Font selection dialog should indicate an error condition if the user attempts to select a font or style that does not exist.
%CF_NOSTYLESEL | Specifies that Font selection dialog should not make an initial style selection.
%CF_NOSIZESEL | Specifies that Font selection dialog should not make an initial size selection.
%CF_NOSIMULATIONS | Specifies that Font selection dialog should not allow graphics device interface (GDI) font simulations.
%CF_NOVECTORFONTS | Specifies that Font selection dialog should not allow vector font selections.
%CF_PRINTERFONTS | Causes the Font selection dialog box to list only the fonts supported by the printer.
%CF_SCALABLEONLY | Specifies that Font selection dialog should allow only the selection of scalable fonts. (Scalable fonts include vector fonts, scalable printer fonts, TrueType fonts, and fonts scaled by other technologies.)
%CF_SCREENFONTS | Causes the Font selection dialog box to list only the screen fonts supported by the system.
%CF_WYSIWYG | Specifies that the Font selection dialog should allow only the selection of fonts available on both the printer and the display. If this flag is specified, the %CF_BOTH and %CF_SCALABLEONLY flags should also be specified.
fontname$ | The name of the font selected by the user
points& | The point size of the font selected by the user.
style& | The style attribute of the selected font. Any of the following values can be combined or used alone:
0 | Normal
1 | Bold
2 | Italic
4 | Underline
8 | Strikeout
For example, if a style& value of 3 is returned, it specifies that a combination of both bold and italic attributes was selected by the user.
colorval& | The RGB value of the selected color.
charset& | The chosen character set - 0 if a standard U.S. charset.
See also | CONTROL SET FONT, DIALOG DEFAULT FONT, DISPLAY BROWSE, DISPLAY COLOR, DISPLAY OPENFILE, DISPLAY SAVEFILE, FONT END, FONT NEW, GRAPHIC SET FONT, XPRINT SET FONT