FontMetric Function | |
-- todo --
Returns font attributes for the current installed operating system fonts.
Namespace:
XSharp.VFP
Assembly:
XSharp.VFP (in XSharp.VFP.dll) Version: 2.19
Syntax FUNCTION FontMetric(
nAttribute,
cFontName,
nFontSize,
cFontStyle
) AS LONG CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public static int FontMetric(
Usual nAttribute = default,
Usual cFontName = default,
Usual nFontSize = default,
Usual cFontStyle = default
)
Request Example
View SourceParameters
- nAttribute (Optional)
- Type: Usual
Determines the font attribute FontMetric( ) returns. If you omit cFontName, nFontSize, and cFontStyle,
FontMetric( ) returns the attribute for the current font in the active output window.
The table in the remarks section lists values for nAttribute and the corresponding font attributes returned.
- cFontName (Optional)
- Type: Usual
Specifies the name of an installed font.
- nFontSize (Optional)
- Type: Usual
Specifies the point size of the font specified with cFontName.
- cFontStyle (Optional)
- Type: Usual
Specifies a font style code for the font specified with cFontName. If you omit cFontStyle, FontMetric( ) returns the attribute for the Normal font style.
cFontStyle can be a character or a combination of characters listed in the following font style table.
For example, the combination BI specifies the Bold Italic font style.
Return Value
Type:
Long
Numeric
Remarks
FontMetric( ) returns font attributes for the current font for the active output window. WFONT( ) can be used to determine the current window font.
nAttribute | Attribute |
---|
1 | Character height in pixels |
2 | Character ascent (units above baseline) in pixels |
3 | Character descent (units below baseline) in pixels |
4 | Leading (space between lines) in pixels |
5 | Extra leading in pixels |
6 | Average character width in pixels |
7 | Maximum character width in pixels |
8 | Font weight |
9 | Italic (0 = no, nonzero = yes) |
10 | Underlined (0 = no, nonzero = yes) |
11 | Strikeout (0 = no, nonzero = yes) |
12 | First character defined in font |
13 | Last character defined in font |
14 | Default character (substituted for characters not in font) |
15 | Word-break character |
16 | Pitch and family |
17 | Character set |
18 | Overhang (extra added width) |
19 | Horizontal aspect for font device |
20 | Vertical aspect for font device |
Character | Font style |
---|
B | Bold |
I | Italic |
N | Normal |
O | Outline |
Q | Extra leading in pixels |
S | Shadow |
- | Strikeout |
T | Transparent |
U | Underline |
For more information about the numeric values returned by FontMetric( ), see the TEXTMETRIC function in the Microsoft Windows Programmer's Reference.
See Also