Returns the name, size, or style of the current font for a window in Visual FoxPro for Windows.
Syntax
WFONT(nFontAttribute [, WindowName])
Returns
Character and Numeric
Arguments
nFontAttribute
Specifies the font attribute you want to return.
If nFontAttribute is 1, WFONT( ) returns the name of the current font for the active or specified window.
If nFontAttribute is 2, WFONT( ) returns the font size.
If nFontAttribute is 3, WFONT( ) returns a code that identifies the font style.
The font style code is a character or set of characters that correspond to the current font style. For example, the current font style is Bold Italic if WFONT(3) returns BI.
The following table lists the codes for each font style:
Character | Font Style |
B | Bold |
I | Italic |
N | Normal |
O | Outline |
Q | Opaque |
S | Shadow |
– | StrikeThru |
T | Transparent |
U | Underline |
WindowName
Specifies the name of the window for which you want to determine the current font, font size, or font style. In Visual FoxPro, you can also include the name of a toolbar. Include the empty string to return the current font, font size, or font style for the main Visual FoxPro window.
WindowName can be the name of a user-defined window created with DEFINE WINDOW or a text- or memo-editing window.
You can also include the name of a system window (View, Trace, Debug, and so on). WFONT( ) can return font attributes only for a system window that has been opened and is currently visible or hidden. If the system window you specify is closed, Visual FoxPro generates an error message.
WFONT( ) returns the current font, font size or font style for the active output window if you omit WindowName.