DOCUMENT:Q94350 03-FEB-2000 [foxpro] TITLE :FoxPro FONTMETRIC() Function Returns Font Attributes PRODUCT :Microsoft FoxPro PROD/VER:WINDOWS:2.5,2.5a,3.0,5.0,6.0 OPER/SYS: KEYWORDS: ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - Microsoft Visual FoxPro for Windows, versions 3.0, 5.0, 6.0 - Microsoft FoxPro for Windows, versions 2.5, 2.5a ------------------------------------------------------------------------------- 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 , FoxPro returns the desired attribute for a font with the specified font style. If is omitted, FoxPro returns the specified information regarding a font with normal style. The parameter can contain one or more characters from the following font style table. 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 : Technology : kbVFPsearch kbAudDeveloper kbFoxproSearch kbFoxPro250 kbFoxPro250a kbVFP300 kbVFP500 kbVFP600 Version : WINDOWS:2.5,2.5a,3.0,5.0,6.0 ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 2000.