SAMPLE: Adding TrueType, Raster, or Vector Fonts to SystemLast reviewed: February 15, 1996Article ID: Q130459 |
The information in this article applies to:
FONTINST is a sample application in the Microsoft Software Library that demonstrates how to programmatically add a TrueType, raster, or vector font to the system. When working with a TrueType font file (.TTF file), FONTINST creates a .FOT file and moves the specified .TTF file to the Windows system directory. For a raster or vector font file (.FON file), FONTINST moves the .FON file to the Windows system directory. After the font file has been moved to the system directory, FONTINST adds the font to the system by using the AddFontResource() API. Then it adds font information to the [fonts] section of the WIN.INI file so that the font is automatically loaded every time Windows starts. For example, the following line is added to the WIN.INI file when FONTINST adds the ARIAL.TTF file to the system:
Arial (TrueType)=ARIAL.FOTFONTINST also demonstrates how to retrieve the facename of a font given a .TTF or .FON file. In the case of a TrueType font, FONTINST opens up the file and reads the naming table of the .TTF file. FONTINST also shows how to read the FONTINFO structure (as described on pages 49-50 of the "Microsoft Windows Software Development Kit: Programmer's Reference, Volume 4: Resources") of a .FON file. The facename of a font in a .FON file can also be found in this manner. After a font is installed by FONTINST, information about the font is displayed in the window. Information such as the TEXTMETRIC structure and font type, as well as sample font text, is displayed. Information added to the WIN.INI file is also displayed in this window. Download FONTINST.EXE, a self-extracting file, from the Microsoft Software Library (MSL) on the following services:
|
Additional reference words: 3.10 3.50 4.00 95 softlib
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |