GETFONT( ) Function
Displays the Font dialog box and returns information about the font you choose.
GETFONT([cFontName [, nFontSize [, cFontStyle [, nFontCharSet]]]]) |
Parameters
- cFontName
-
Specifies the name of the font initially selected in the Font dialog box. If the font you specify is not installed, the default font is selected initially.
- nFontSize
-
Specifies the font size selected initially in the Font dialog box. If the font size you specify is not supported, the default font size is selected initially. If you omit nFontSize or if nFontSize is less than or equal to zero, the font size selected defaults to 10 point.
Note
The dialog box permits you to select sizes between
4
and127
, inclusive. You can specify other values for nFontSize when calling the GETFONT function; no error occurs. If you do so, however, the user must select a size within the designated range of values before clicking OK in the dialog box. Otherwise, the dialog box displays an alert and does not accept the value.
- cFontStyle
-
Specifies the font style selected initially in the Font dialog box or to display only those fonts available on the selected printer. If the font style you specify is not supported, the default font style is selected initially.
The following table lists the values available for cFontStyle.
cFontStyle Description B
Select Bold font style initially.
I
Select Italic font style initially.
BI
Select Bold Italic font style initially.
P
Display only those fonts available on the current default printer.
- nFontCharSet
-
Specifies a value for the language script. The values you can specify differ depending on your version of Windows.
Note
Omitting this value disables the script drop-down list in the dialog box.
The following table describes some example values for nFontCharSet.
nFontCharSet Language script 0
Western
1
Default
2
Symbol
128
Japanese
161
Greek
162
Turkish
163
Vietnamese
177
Hebrew
178
Arabic
186
Baltic
204
Cyrillic
238
Central European
Note
If you specify 1 for nFontCharSet, the dialog box that GETFONT( ) opened displays the default language script on the operating system. GETFONT( ) never returns 1 because it returns the value for the language script selected in the GETFONT( ) dialog box.
For more information, see FontCharSet Property.
Return Value
Remarks
Example
See Also
© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic