fm_load(3w)
NAME
fm_load − load a font into memory
SYNOPSIS
int fm_load(gfd,path,fontid);
int gfd;
char *path;
int *fontid;
DESCRIPTION
gfd is an integer file descriptor for an gopened device interface.
path is the path name of the font file to be loaded.
fontid is the system wide font id returned upon successful load.
DISCUSSION
This routine loads a font file and updates the font manager’s tables appropriately. The designated font is made the active font, as if fm_activate was called. Hence, certain graphics parameters may be reset; see fm_activate for details. If the optimize bit is set in the font file fm_opt will be called to optimize the font. A system-wide unique font identifier is returned.
Note that font ids (and hence fonts) are associated with a (gfd,process-id) pair. In particular, if a font has been loaded using a gfd for one device, fm_write cannot be called with that font id and a different gfd. Both the file descriptor and process id must match to use a font.
Note that fm_load and fm_remove act much like open(2) and close(2), in that every font loaded by fm_load should be released by a call to fm_remove. If a font is loaded twice by separate calls to fm_load, two calls to fm_remove should be performed to release the font. If gfd or path is invalid, −1 is returned by fm_load. If the font is already loaded a new fontid will be returned. A −1 is also returned if format of the font file is incompatible with the device architecture.
SEE ALSO
fm_remove(3w),fm_activate(3w),fm_opt(3w).
DIAGNOSTICS
A return of −1 indicates failure; otherwise, 0 is returned. See errno(2) for more information.
WARNING
If a rectangular font (pixelformat = 1) or a HP-15 (2-byte) font (pixelformat = 2) is used on a low resolution display with retained rasters, every other rectangular pixel will be lost when an area is obscured. Also 2-byte characters that are written to an obscured area will be twice as big as they should be when the area is unobscured.
Hewlett-Packard Company — HP-UX Release 9.10: April 1995