Click or drag to resize

FontMetric Function

X#
-- todo --
Returns font attributes for the current installed operating system fonts.

Namespace:  XSharp.VFP
Assembly:  XSharp.VFP (in XSharp.VFP.dll) Version: 2.21
Syntax
 FUNCTION FontMetric(
	nAttribute,
	cFontName,
	nFontSize,
	cFontStyle
) AS LONG CLIPPER
Request Example View Source

Parameters

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.
nAttributeAttribute
1Character height in pixels
2Character ascent (units above baseline) in pixels
3Character descent (units below baseline) in pixels
4Leading (space between lines) in pixels
5Extra leading in pixels
6Average character width in pixels
7Maximum character width in pixels
8Font weight
9Italic (0 = no, nonzero = yes)
10Underlined (0 = no, nonzero = yes)
11Strikeout (0 = no, nonzero = yes)
12First character defined in font
13Last character defined in font
14Default character (substituted for characters not in font)
15Word-break character
16Pitch and family
17Character set
18Overhang (extra added width)
19Horizontal aspect for font device
20Vertical aspect for font device
CharacterFont style
BBold
IItalic
NNormal
OOutline
QExtra leading in pixels
SShadow
-Strikeout
TTransparent
UUnderline


For more information about the numeric values returned by FontMetric( ), see the TEXTMETRIC function in the Microsoft Windows Programmer's Reference.
See Also