Click to Rate and Give Feedback
MSDN
MSDN Library
Windows Mobile
Windows Mobile 6.5
Fonts
Fonts Reference
Fonts Functions
 AddFontResource
Collapse All/Expand All Collapse All
AddFontResource
A version of this page is also available for
4/8/2010

This function adds the font resource from the specified file to the operating system's font table. The font can subsequently be used for text output by any application on the device.

int AddFontResource(
  LPCTSTR lpszFilename
);
lpszFilename

[in] Long pointer to a null-terminated string that contains a valid font file name. The file name can specify a raw TrueType file (.ttf), a TrueType resource file (.fot), a TrueType collection file (.ttc), a raw bitmap font file (.fnt), or a raster resource file (.fon).

The number of fonts added indicates success. Zero indicates failure. To get extended error information, call GetLastError.

Any application that adds or removes fonts from the system font table should notify other applications of the change by sending a WM_FONTCHANGE message to all top-level windows in the operating system (OS). The application should send this message by calling the SendMessage function and setting the hwnd parameter to HWND_BROADCAST.

When an application no longer needs a font resource that the application loaded by calling the AddFontResource function, the application must remove the resource by calling the RemoveFontResource function.

Windows CE 2.0 and later support systems that use either TrueType or raster fonts, but not both. The OEM chooses the font type at system design time, and applications cannot change the font type.

AddFontResource can add raster fonts if the GDI raster font component is built into the system, or TrueType fonts if the GDI TrueType font component is built into the system.

Note that AddFontResource will not work for raster fonts if the GDI TrueType font component is added to the system by the OEM, and will not work for TrueType fonts if the GDI raster font component is added to the system by the OEM.

Windows CE 1.0 and 1.01 support only raster fonts.

Headerwindows.h
Librarycoredll.lib
Windows Embedded CEWindows CE 2.0 and later
Windows MobilePocket PC for Windows Mobile Version 5.0 and later, Smartphone for Windows Mobile Version 5.0 and later
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker