MocrRestoreFont()函数

Synopsis

Restore a font from disk.

Format

MIL_ID MocrRestoreFont(FileName, Operation, SystemId, FontIdPtr)

char *FileName; Font file name
long Operation; Operation flag
MIL_ID SystemId; System identifier
MIL_ID *FontIdPtr; Storage location for font identifier

Description

This function restores an OCR font previously saved with MocrSaveFont from a file on disk, and returns a handle to it.

The FileName parameter specifies the font file name.

The Operation parameter specifies which font data to restore. It can be set to one of the following values:

M_RESTORE Allocates a new font using the SystemId specified, and restores all of the font’s character, control, and constraint data. The new font ID is written to the variable specified by the FontIdPtr parameter.
M_LOAD_CONTROL Loads only font control data into the specified font. The font ID is read from the variable specified by the FontIdPtr parameter.
M_LOAD_CONSTRAINT Loads only font constraint data into the specified font. The font ID is read from the variable specified by the FontIdPtr parameter.
M_DEFAULT Same as M_RESTORE.

The SystemId parameter determines the system on which the buffer will be allocated when an M_RESTORE or M_DEFAULT operation is specified. This parameter must be given a valid system identifier. Alternatively, SystemId can be set to M_DEFAULT to have MIL automatically select the most appropriate system on which to allocate the buffer (this system might be the default Host system or another already allocated system). This parameter can also be set to M_DEFAULT_HOST, in which case the default Host system of the current MIL application will be selected for the allocation.

The FontIdPtr parameter specifies the address of the variable to/from which the font buffer identifier is to be written/read.

After performing an M_RESTORE operation, the function returns the font identifier and writes it in the variable pointed to by FontIdPtr. Since MocrRestoreFont also returns the font identifier, this parameter can be set to M_NULL. If the restore operation fails, M_NULL is returned as the identifier.

When performing an M_LOAD_CONTROL or an M_LOAD_CONSTRAINT operation, the function reads the target font identifier from the variable pointed to by FontIdPtr. It then loads the specified data into the existing font buffer.

Returned value

This function returns the buffer identifier of the existing or newly allocated font. If allocation fails, M_NULL is returned as the identifier.

See also

MocrImportFont, MocrSaveFont, MocrCopyFont

《MocrRestoreFont()函数》上有2条评论

评论已关闭。