Filters
Filter values by
Font controls
  • Global controls
  • Character controls
| Customize Help
| Save Settings

MdmrControlFont



Function Map
Synopsis
Control a global setting of a font in a SureDotOCR context, or control a character in a font.
Syntax
void MdmrControlFont(
MIL_ID ContextDmrId, //in
MIL_INT64 FontLabelOrIndex, //in
MIL_INT64 CharIndex, //in
MIL_CONST_TEXT_PTR CharNamePtr, //in
MIL_INT64 ControlType, //in
MIL_DOUBLE ControlValue, //in
const void *ControlValuePtr //in
)
Description

This function allows you to control a global setting of a font in a SureDotOCR context, or to control a character in a font. This includes adding characters to, and deleting characters from, a font. To add a font to a SureDotOCR context, use MdmrControl() with M_FONT_ADD (this adds an empty font). For a successful read operation, the context must have at least one font with one character. The characters held by a font are represented by a dot-matrix. String models use the dot-matrix character representations in the font to define the text to read.

Adding or modifying characters with this function requires specifying their dot-matrix representation in an array. You can also add or modify characters by calling MdmrImportFont() with a SureDotOCR font file (more commonly done). To inquire about fonts, use MdmrInquireFont().

You must preprocess the SureDotOCR context after modifying its fonts and before calling MdmrRead(). To know if a context needs to be preprocessed, call MdmrInquire() with M_PREPROCESSED.

Note that when using a C compiler (not a C++ or other compiler) in 64-bit mode, MdmrControlFont() internally calls the MIL_DOUBLE version of this function (MdmrControlFontDouble()). If you need to pass integer values, call the MIL_INT64 version of this function (MdmrControlFontInt64()).
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 which MIL system’s documentation you should use in its place and any possible differences.
Parameters
This function is not supported on the selected boards.
This function reference has not been updated for the selected MIL system. To show the content of this page, choose a second MIL system; refer to the MIL system's release note to see which MIL system’s documentation to choose and any possible differences.
Parameters
ContextDmrId

Specifies the identifier of the SureDotOCR context that contains the fonts to control. The context must have been previously allocated on the system using MdmrAlloc().

FontLabelOrIndex

Specifies the font (one or all) to control. Set this parameter to one of the values below:

function map For specifying the font
Click to summarizeValue Description
Click to summarize

Specifies to control the font by indicating its index.

(summarize)
Parameters

Specifies the index of the font.

0 <= Value < M_NUMBER_OF_FONTS

Specifies the index of the font to control.

Click to summarize

Specifies to control the font by indicating its label.

(summarize)
Parameters

Specifies the label of the font.

0 < Value < 2097152

Specifies the label of the font to control.

Click to summarize M_ALL

Specifies to control all fonts.

CharIndex

Specifies the index of a character in the font, if required. Set this parameter to one of the values below:

function map For specifying the index of a character
Click to summarizeValue Description
Click to summarize M_DEFAULT

Specifies that the index of a character is not required.

Click to summarize M_ALL

Specifies all characters. Only specify this value for M_CHAR_DELETE.

(summarize)
Click to summarize Value >= 0

Specifies the index of a character.

CharNamePtr

Specifies the name of a character in the font, if required. Set this parameter to one of the values below:

function map For specifying the name of the character
Click to summarizeValue Description
Click to summarize M_NULL

Specifies that the name of the character is not required.

Click to summarize MIL_TEXT("CharName") 1

Specifies the name of the character. For example, 'A' would be the name that identifies the first uppercase letter of the English alphabet. When using the CharNamePtr parameter to specify the name of a character, the CharIndex parameter must be set to M_DEFAULT.

When working in an ASCII environment, you can specify Unicode character names; these names must be in hexadecimal format and begin with "\x". This is required for specifying character names beyond the Basic Latin range. For example, Basic Latin does not include the smiley face character; to specify it, use "\x263A". When working in a Unicode environment, you can directly specify the smiley face as the name of the character.

Character names must be unique among all character names in the font. Specifying the name of a character that already exists causes an error. To avoid unpredictable results, character names should match the dot-matrix that they represent.

(summarize)

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

ControlType

Specifies the type of control to set.

See the Parameter associations section for possible values that can be specified.

ControlValue

Specifies the required value for the control.

Set this parameter to M_DEFAULT if not used.

See the Parameter associations section for possible values that can be specified.

ControlValuePtr
Accepts the address of one of the following (see the Parameter associations section for specifics on which is expected):
  • array of type MIL_UINT8 [optionally, in C++: a reference to a constant std::vector<MIL_UINT8> ]
  • M_NULL
  • MIL_CONST_TEXT_PTR [optionally, in C++: a reference to a MIL_STRING]

Specifies the address which contains more information about the setting's new value.

Set this parameter to M_NULL if not used. If you use this parameter, the ControlValue parameter must be M_DEFAULT.

See the Parameter associations section for possible values that can be specified.

The tables below list possible values for the ControlType, ControlValue, and ControlValuePtr parameters.

The following ControlType and corresponding ControlValue and ControlValuePtr parameter settings are used to control a global setting of a font. Unless otherwise specified, set the FontLabelOrIndex parameter to the label or index of a font (one or all), set the CharIndex parameter to M_DEFAULT, and set the CharNamePtr parameter to M_NULL.

function map For controlling a global setting of a font
Click to summarize
ControlType
Description
ControlValue
ControlValuePtr
Click to summarize M_FONT_LABEL_VALUE

Modifies the label value of the font. Set the FontLabelOrIndex parameter to a specific font. Specifying all fonts causes an error.

(summarize)
Click to summarize ControlValue

Specifies the following.

(summarize)
Click to summarize 0 < Value < 2097152

Specifies the font's new label value, as an integer. The label must be unique among all font labels in the context.

(summarize)
Click to summarize ControlValuePtr
Data type info: Data type: Set this parameter to M_NULL
Click to summarize M_FONT_SIZE_COLUMNS

Sets the number of columns in the font's dot-matrix template. Only specify this value for an empty font (no characters).

The dot-matrix template defines the grid within which to represent every character in the font.

Fonts are typically added with MdmrImportFont(). In this case, the dimensions of the characters' dot-matrix in the font file (MDMRF) represent the dimensions of the dot-matrix template of the font. INQ

(summarize)
Click to summarize ControlValue

Specifies one of the following.

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 5 columns.

Click to summarize Value > 0

Specifies the number of columns, as an integer.

Click to summarize ControlValuePtr
Data type info: Data type: Set this parameter to M_NULL
Click to summarize M_FONT_SIZE_ROWS

Sets the number of rows in the font's dot-matrix template. Only specify this value for an empty font (no characters).

The dot-matrix template defines the grid within which to represent every character in the font.

Fonts are typically added with MdmrImportFont(). In this case, the dimensions of the characters' dot-matrix in the font file (MDMRF) represent the dimensions of the dot-matrix template of the font. INQ

(summarize)
Click to summarize ControlValue

Specifies one of the following.

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 7 rows.

Click to summarize Value > 0

Specifies the number of rows, as an integer.

Click to summarize ControlValuePtr
Data type info: Data type: Set this parameter to M_NULL

The following ControlType and corresponding ControlValue and ControlValuePtr parameter settings are used to control a font's characters. Unless otherwise specified, set the FontLabelOrIndex parameter to the label or index of a font (one or all), and set either the CharIndex parameter to a character index or the CharNamePtr parameter to the name of a character.

function map For controlling a font's characters
Click to summarize
ControlType
Description
ControlValue
ControlValuePtr
Click to summarize M_CHAR_ADD

Adds a character to the font. To add multiple characters, call this function multiple times. SureDotOCR assigns an index to each character, starting with 0. Use the CharNamePtr parameter to specify the name of the character and set the CharIndex parameter to M_DEFAULT. Fonts should only contain characters you want to read.

(summarize)
Click to summarize ControlValue

Specifies the following.

(summarize)
Click to summarize M_DEFAULT

Implements the default behavior.

Click to summarize ControlValuePtr
Data type info: Data type: array of type MIL_UINT8 [optionally, in C++: a reference to a constant std::vector<MIL_UINT8> ] MORE

Specifies the address of an array containing the dot-matrix of the character to add to the font. You must define the dot-matrix in the array, one row contiguously after the other; use "FF" for dots that represent the character; otherwise use "00". The dot-matrix of the font's characters should be identical to the dot-matrix of the characters in the strings to read.

You must organize the character data in the specified array according to the dimensions of the font's dot-matrix template. To inquire the dimensions, call MdmrInquireFont() with M_FONT_SIZE_COLUMNS and M_FONT_SIZE_ROWS. The dot-matrix of all characters in a font must have these dimensions. The dots that make up the dot-matrix are specific to each character.

(summarize)
Click to summarize M_CHAR_DELETE

Deletes characters in a font.

To delete a specific character in a font, set the CharIndex parameter to the index of the character to delete, or set the CharNamePtr parameter to the name of the character to delete. To delete all characters in a font, set the CharIndex parameter to M_ALL and the CharNamePtr parameter to M_NULL.

(summarize)
Click to summarize ControlValue

Specifies the following.

(summarize)
Click to summarize M_DEFAULT

Implements the default behavior.

Click to summarize ControlValuePtr
Data type info: Data type: Set this parameter to M_NULL
Click to summarize M_CHAR_NAME

Renames a character in a font.

(summarize)
Click to summarize ControlValue

Specifies the following.

(summarize)
Click to summarize M_DEFAULT

Implements the default behavior.

Click to summarize ControlValuePtr
Data type info: Data type: address of a MIL_CONST_TEXT_PTR [optionally, in C++: MIL_STRING ]

Specifies the following.

(summarize)
Click to summarize MIL_TEXT("CharName") 1

Specifies the character's new name. To indicate the character to rename, use either the CharIndex parameter or the CharNamePtr parameter. Character names must be unique among all character names in the font. To avoid unpredictable results, character names should match the dot-matrix that represents them.

(summarize)
Click to summarize M_CHAR_TEMPLATE

Redefines the dot-matrix of a character in a font. INQ

(summarize)
Click to summarize ControlValue

Specifies the following.

(summarize)
Click to summarize M_DEFAULT

Implements the default behavior.

Click to summarize ControlValuePtr
Data type info: Data type: array of type MIL_UINT8 [optionally, in C++: a reference to a constant std::vector<MIL_UINT8> ] MORE

Specifies the address of an array containing the character's new dot matrix. This character data must adhere to the same specifications as M_CHAR_ADD. To indicate the character to redefine, use either the CharIndex parameter or the CharNamePtr parameter.

(summarize)

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

Type-specific versions of the function when using a C compiler under 64-bit
void MdmrControlFontInt64 (MIL_ID ContextDmrId, MIL_INT64 FontLabelOrIndex, MIL_INT64 CharIndex, MIL_CONST_TEXT_PTR CharNamePtr, MIL_INT64 ControlType, MIL_INT64 ControlValue, const void *ControlValuePtr)
Parameters

ContextDmrId

See ContextDmrId of the main function for a description.

FontLabelOrIndex

See FontLabelOrIndex of the main function for a description.

CharIndex

See CharIndex of the main function for a description.

CharNamePtr

See CharNamePtr of the main function for a description.

ControlType

See ControlType of the main function for a description.

ControlValue

See ControlValue of the main function for a description.

ControlValuePtr

See ControlValuePtr of the main function for a description.

void MdmrControlFontDouble (MIL_ID ContextDmrId, MIL_INT64 FontLabelOrIndex, MIL_INT64 CharIndex, MIL_CONST_TEXT_PTR CharNamePtr, MIL_INT64 ControlType, MIL_DOUBLE ControlValue, const void *ControlValuePtr)
Parameters

ContextDmrId

See ContextDmrId of the main function for a description.

FontLabelOrIndex

See FontLabelOrIndex of the main function for a description.

CharIndex

See CharIndex of the main function for a description.

CharNamePtr

See CharNamePtr of the main function for a description.

ControlType

See ControlType of the main function for a description.

ControlValue

See ControlValue of the main function for a description.

ControlValuePtr

See ControlValuePtr of the main function for a description.

Compilation information
Header Include mil.h.
Library Use mil.lib; mildmr.lib.
DLL Requires mil.dll; mildmr.dll.
NUMBER OF FONTS ALL DEFAULT ALL NULL FONT LABEL VALUE FONT SIZE COLUMNS DEFAULT FONT SIZE ROWS DEFAULT CHAR ADD DEFAULT CHAR DELETE DEFAULT CHAR NAME DEFAULT CHAR TEMPLATE DEFAULT DEFAULT NULL ALL DEFAULT NULL DEFAULT ALL NULL DEFAULT NULL ALL NULL ALL DEFAULT ALL NULL ALL DEFAULT NULL