Microsoft KB Archive/94350

= FoxPro FONTMETRIC Function Returns Font Attributes =

Article ID: 94350

Article Last Modified on 2/10/2005

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 6.0 Professional Edition
 * Microsoft FoxPro 2.5b
 * Microsoft FoxPro 2.5a

-



This article was previously published under Q94350



SUMMARY
The FONTMETRIC function returns the attributes of a font installed in the Microsoft Windows environment. Font attributes include the character height, character ascent, leading space between lines, and font weight. The syntax of the FONTMETRIC function is as follows:

FONTMETRIC([,,[,]])

The  parameter specifies the desired font attribute. If the  and  parameters are omitted, FONTMETRIC returns the specified attribute of the current font in the active output window. The following table lists the  values and their corresponding font attributes.    value   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 (zero = no, nonzero = yes) 10             Underlined (zero = no, nonzero = yes) 11             Strikeout (zero = 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 The  parameter specifies a font name and returns the desired attribute for a specific installed font.

The  parameter specifies the point size for a font specified in the  parameter.

The  parameter specifies a font style code. When an application specifies <expC2>, FoxPro returns the desired attribute for a font with the specified font style. If <expC2> is omitted, FoxPro returns the specified information regarding a font with normal style. The <expC2> parameter can contain one or more characters from the following font style table. <pre class="fixed_text">  Character       Font style ---

-          Strikeout B          Bold I          Italic N          Normal O          Outline Q          Opaque S          Shadow T          Transparent U          Underline

Additional query words: VFoxWin FoxWin 2.50

Keywords: KB94350

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.