GetFont Function | |
Displays the Font dialog box and returns information about the font you choose.
Namespace:
XSharp.VFP
Assembly:
XSharp.VFP (in XSharp.VFP.dll) Version: 2.19
Syntax FUNCTION GetFont(
cFontName,
nFontSize,
cFontStyle,
nFontCharSet
) AS STRING CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public static string GetFont(
Usual cFontName = default,
Usual nFontSize = default,
Usual cFontStyle = default,
Usual nFontCharSet = default
)
Request Example
View SourceParameters
- cFontName (Optional)
- Type: Usual
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 (Optional)
- Type: Usual
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 and , 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 (Optional)
- Type: Usual
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 table in the remarks section lists the values available for cFontStyle.
- nFontCharSet (Optional)
- Type: Usual
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 table in the remarks section describes some example values for nFontCharSet.
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
Type:
String
Character.
GetFont( ) returns one of the following, depending on certain conditions:
Remarks 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 | 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 |
Examples 1* Invoke the dialog with script drop-down list disabled:
2? GetFont("Arial",12,"B")
3* return value is the string:
4* "Arial,12,B"
5* Enable the script drop-down list, Western script selected:
6? GetFont("Arial",12,"B",0)
7* sample return value is the string:
8* "Verdana,16,N,161"
9* Return from the dialog box without making a selection:
10? GetFont("Arial",12,"B")
11* return value is an empty string
12? GetFont("Arial",12,"B",0)
13* return value is still an empty string
See Also