int AddFontResource(lpszFilename) | |||
LPCTSTR lpszFilename; |
The AddFontResource function adds the font resource from the file named by the lpszFilename parameter to the Windows font table. The font can subsequently be used by any application.
lpszFilename
Points to a character string that names the font-resource file. The string must be a null-terminated filename. The filename may specify either a .fon file or a .fnt file.
The return value specifies the number of fonts added if the function is successful. Otherwise, the return value is -1. The return value is zero if no fonts are loaded.
The AddFontResource function may be used as either a wide-character function (where text arguments must use Unicode) or an ANSI function (where text arguments must use characters from the Windows 3.x character set).
Any application that adds or removes fonts from the Windows font table should notify other windows of the change by using the SendMessage function with the hWnd parameter set to -1 to send a WM_FONTCHANGE message to all top-level windows in the system.
An application must remove any font resource it has loaded once the application is through with the resource.
For a description of font resources, see the Guide to Programming.
RemoveFontResource