| MIL 10 Reference
| Customize Help
| Save Settings

MocrImportFont



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

Available on Windows
Available on Linux

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
None.
Synopsis
Import character representations into an OCR font context.
Syntax
void MocrImportFont(
MIL_CONST_TEXT_PTR FileName, //in
MIL_INT64 FileFormat, //in
MIL_INT64 Operation, //in
MIL_CONST_TEXT_PTR CharListString, //in
MIL_ID FontContextOcrId //in
)
Description

This function imports character representations from a file to initialize or overwrite those of an existing OCR font context. This function's main use is to initialize custom fonts.

Font character representations can come from either a grayscale image or a text file.

When taken from an image file, character representations are associated with the ASCII characters in the string, specified by CharListString. The image file must be a grid of character representations matching the specifications of the font. The character representations are read from left to right and top to bottom, and the number of characters in the source image must equal the number of characters in the string, specified by CharListString.

When taken from an ASCII file, font character representations must be presented as in the table below.

Row

Description

01

Specifies ASCII file format.

02

Blank row.

03

Specifies the start of a new character representation and its associated (generally ASCII) character.

04 to 36

Specifies the alpha-numerical representation of the character.

37

Blank row.

38

Specifies the start of a new character representation and its associated (generally ASCII) character.

39 to 71

Specifies the alpha-numerical representation of the character.

etc.

This pattern is repeated for every character in the font.

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 name and path of the file from which to import the character representation. The function handles (internally) the opening and closing of the file.

This parameter can be set to the following value:

function map For specifying the file name and path
CollapseValue Description
Collapse MIL_TEXT("FileName") 1

Specifies the drive, directory, and name of the file (for example, "C:\mydirectory\myfile").

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

(summarize)

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

FileFormat

Specifies how the data is stored in the file. This parameter can be set to one of the following values:

function map For specifying how the data is stored
CollapseValue Description
Collapse M_FONT_ASCII

Specifies a user-drawn ASCII file.

Note that the CharListString must be set to M_NULL.

(summarize)
Collapse M_MIL

Specifies a MIL format image file.

Note that only one-band images can be used.

(summarize)
Collapse M_TIFF

Specifies a TIFF format image file.

Note that only one-band images can be used.

(summarize)
Operation

Specifies the type of import operation to be performed. This parameter must be set to the following value:

function map For specifying the type of import operation
CollapseValue Description
Collapse M_LOAD_CHARACTER

Specifies that the font character representations should be imported.

CharListString INQ

Specifies the ASCII characters to associate with the font character representations in the file. This parameter can be set to one of the following values:

function map For specifying the ASCII characters
CollapseValue Description
Collapse M_NULL

Specifies that this parameter is ignored. Use this setting when the FileFormat parameter is set to M_FONT_ASCII.

(summarize)
Collapse MIL_TEXT("StringOfCharacters") 1

Specifies the list of ASCII characters to associate with the font character representations in the image file. This string must be null-terminated. Note that the number of characters in this list must match the number of font character representations present in the source file.

(summarize)

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

FontContextOcrId

Specifies the identifier of the OCR font context.

Compilation information
Header Include mil.h.
Library Use mil.lib; milocr.lib.
DLL Requires mil.dll; milocr.dll.
FONT ASCII MIL TIFF LOAD CHARACTER NULL