Jump to content

GpiUnloadFonts

From EDM2
Revision as of 21:32, 6 April 2025 by Iturbide (talk | contribs) (Created page with "This function unloads any fonts previously loaded from the resource file by GpiLoadFonts. ==Syntax== GpiUnloadFonts(hab, pszFilename) ==Parameters== ; hab (HAB) - input : Anchor-block handle. ; pszFilename (PSZ) - input : Fully qualified file name of the font resource. : The file name extension is .FON ==Return Value== ; rc (BOOL) - returns : Success indicator. :; TRUE :: Successful completion :; FALSE :: Error occurred. ==Remarks== Before issuing t...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function unloads any fonts previously loaded from the resource file by GpiLoadFonts.

Syntax

GpiUnloadFonts(hab, pszFilename)

Parameters

hab (HAB) - input
Anchor-block handle.
pszFilename (PSZ) - input
Fully qualified file name of the font resource.
The file name extension is .FON

Return Value

rc (BOOL) - returns
Success indicator.
TRUE
Successful completion
FALSE
Error occurred.

Remarks

Before issuing this function, the application must:

  1. Issue GpiSetCharSet to a font other than one of those to be unloaded, for example, to the default font.
  2. Issue GpiDeleteSetId for each local identifier (lcid) that references one of the fonts (the LCID_ALL option can be used if all lcids are to be deleted).

An error is returned if lcids that reference one of the fonts still exist for this application, and a warning is logged if lcids exist for another application.

Errors

Possible returns from WinGetLastError:

PMERR_FONT_FILE_NOT_LOADED (0x202E)
An attempt was made to unload a font file that was not loaded.
PMERR_OWN_SET_ID_REFS (0x20EB)
An attempt to unload a font failed because the setid is still being referenced.

Example Code

#define INCL_GPILCIDS /* Or use INCL_GPI, INCL_PM, */
#include <os2.h>

HAB     hab;         /* Anchor-block handle. */
PSZ     pszFilename; /* Fully qualified file name of the font resource. */
BOOL    rc;          /* Success indicator. */

rc = GpiUnloadFonts(hab, pszFilename);

Related Functions