| MIL 10 Reference
| Customize Help
| Save Settings

MocrRestoreFont



See also
Availability
Not available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux with restrictions

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
Synopsis
Restore an OCR font context, font constraint data, or control data from file.
Syntax
MIL_ID MocrRestoreFont(
MIL_CONST_TEXT_PTR FileName, //in
MIL_INT64 Operation, //in
MIL_ID SystemId, //in
MIL_ID *FontContextOcrIdPtr //in-out
)
Description

This function restores an OCR font context that was previously saved to a file using MocrSaveFont().

This function can also restore a font context from a predefined font context file distributed with MIL (such as, C:\Program Files\Matrox Imaging\contexts\ Semi_M12-92.mfo). Alternatively, this function can load only font constraint or control data from the file into the specified OCR font context.

When an OCR font context is no longer required, it should be freed with MocrFree().

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
FileName

Specifies the path and name of the file from which to restore the MIL OCR font context (for example, "C:\mydirectory\myfile"). The function handles (internally) the opening and closing of the file.

The predefined font files, distributed with MIL, are in the "C:\Program Files\Matrox Imaging\contexts\" folder.

To open the file on the remote computer (under Distributed MIL), prefix the specified file name string with "remote:///" (for example, "remote:///C:\mydirectory\myfile").

This parameter can be set to one of the following:

function map For specifying the file name and path
CollapseValue Description
Collapse M_INTERACTIVE
[This is only applicable to Windows]

Opens the File Open dialog box from which you can interactively specify the drive, directory, and name of the file.

Collapse MIL_TEXT("Filename.mfo") 1

Specifies to restore an OCR user-defined font.

Collapse MIL_TEXT("MICR_CMC_7.mfo") 1

Specifies to restore an OCR font context typically used with the MICR CMC7 standard.

Collapse MIL_TEXT("MICR_E_13B.mfo") 1

Specifies to restore an OCR font context typically used with the MICR E-13b standard.

Collapse MIL_TEXT("OCR_A_BT.mfo") 1

Specifies to restore an OCR font context that uses the OCR-A BT font.

Collapse MIL_TEXT("OCR_B_BT.mfo") 1

Specifies to restore an OCR font context that uses the OCR-B BT font.

Collapse MIL_TEXT("SEMI_M12-92.mfo") 1

Specifies to restore an OCR font context following the SEMI M12 standard.

Collapse MIL_TEXT("SEMI_M13-88.mfo") 1

Specifies to restore an OCR font context following the SEMI M13 standard.

Collapse MIL_TEXT("SEMI.mfo") 1

Specifies to restore an OCR font context typically used with the SEMI conductor standard.

1 If you are passing the value in a variable, don't enclose it in MIL_TEXT().

Operation

Specifies which type of OCR font context data to restore. It can be set to one of the following values:

function map For specifying the type of data to restore
CollapseValue Description
Collapse M_DEFAULT

Same as M_RESTORE.

Collapse M_LOAD_CONSTRAINT

Loads only font constraint data into the specified OCR font context.

Collapse M_LOAD_CONTROL

Loads only font control data into the specified OCR font context.

Collapse M_RESTORE

Allocates a new OCR font context on the specified system, and initializes it with the font, control, and constraint data, restored from file.

SystemId

Specifies the system on which the OCR font context is allocated.

This parameter should be set to one of the following values:

function map For specifying the system identifier
CollapseValue Description
Collapse M_DEFAULT_HOST

Specifies the default Host system of the current MIL application.

Collapse MIL system identifier

Specifies a valid system identifier, previously allocated using MsysAlloc().

FontContextOcrIdPtr

Specifies the address of the variable to/from which the font identifier is to be written/read.

Since after performing a restore operation, MocrRestoreFont() also returns the OCR font context identifier, this parameter can be set to M_NULL. If the restore operation fails, M_NULL is returned as the identifier.

Return value
Returns the identifier of the existing or newly allocated OCR font context. If allocation fails, M_NULL is returned as the identifier.
Compilation information
Header Include mil.h.
Library Use mil.lib; milocr.lib.
DLL Requires mil.dll; milocr.dll.
INTERACTIVE DEFAULT LOAD CONSTRAINT LOAD CONTROL RESTORE DEFAULT HOST