SAMPLE: FONTUTIL.RTF - Technical Article

Last reviewed: February 15, 1996
Article ID: Q97397
The information in this article applies to:
  • Microsoft Windows Software Development Kit (SDK) for Windows version 3.1

Font Utilities---Some Handy-Dandy Font-Handling Functions

Charlie Kindel, Microsoft Premier Support Services Kyle Marsh, Microsoft Developer Network Technology Group

Created: January 10, 1993

Handling fonts in Microsoft Windows-based applications can involve a lot of grunt work. For example, essential tasks such as creating fonts, retrieving point sizes, and calculating text metrics can take up a lot of the developer's time and effort. This article describes some useful font-handling functions that take care of most of this tedious work, thus making it easier to create and manipulate fonts in Windows.

The FONTUTIL sample application demonstrates most of the font-handling functions discussed in this technical article. FONTUTIL contains useful font-handling routines that make it easier for an application to create and manipulate fonts in Microsoft Windows by taking care of most of the tedious work.

The font utilities are primarily for applications that need the relatively simplistic font model presented in the ChooseFont common dialog box. ChooseFont() deals with fonts using four primary variables: typeface name, typeface style, point size, and effects. ChooseFont also allows for color selection, but the font-handling functions do not currently support this feature.

The font-handling functions allow an application to create and interrogate fonts in a manner that is consistent with the ChooseFont model. For example, you can create a font by using the ReallyCreateFont() function and specifying the typeface name, typeface style, and point size; you can retrieve the typeface style of a font by using the GetTextStyle() function; and so on.

The font utility functions support Microsoft Windows versions 3.0 and 3.1, and Windows NT version 3.1. You can include the functions either in an application or in a dynamic-link library (DLL).

Download FONTUTIL.EXE, a self-extracting file, from the Microsoft Software Library (MSL) on the following services:

  • Microsoft Download Service (MSDL)

          Dial (206) 936-6735 to connect to MSDL
          Download FONTUTIL.EXE (size: 79409 bytes) 
    
  • Internet (anonymous FTP)

          ftp ftp.microsoft.com
          Change to the \SOFTLIB\MSLFILES directory
          Get FONTUTIL.EXE (size: 79409 bytes) 
    


Additional reference words: 3.10 softlib
KBCategory: kbprg kbfile
KBSubcategory: GdiFnt


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.

Last reviewed: February 15, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.