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

MdmrInquireFont



Function Map
Synopsis
Inquire about a global setting of a font in a SureDotOCR context, or inquire about a character in a font.
Syntax
MIL_INT MdmrInquireFont(
MIL_ID ContextDmrId, //in
MIL_INT64 FontLabelOrIndex, //in
MIL_INT64 CharIndex, //in
MIL_CONST_TEXT_PTR CharNamePtr, //in
MIL_INT64 InquireType, //in
void *UserVarPtr //out
)
Description

This function inquires about a global setting of a font in a SureDotOCR context, or inquires about a character in a font. Font settings can be specified with MdmrControlFont().

Characters you are inquiring about are typically imported into a font with MdmrImportFont(). You can also inquire about characters added to a font with MdmrControlFont().

If the inquired setting is set to M_DEFAULT (for example, in MdmrControlFont()), MdmrInquireFont() will return M_DEFAULT. To inquire the actual default value, add M_DEFAULT to the InquireType parameter.

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 font about which to inquire. The context must have been previously allocated on the system using MdmrAlloc().

FontLabelOrIndex

Specifies the font about which to inquire. Set this parameter to one of the values below:

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

Specifies to inquire about 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 inquire about the font by indicating its label.

(summarize)
Parameters

Specifies the label of the font.

0 < Value < 2097152

Specifies the label of the font about which to inquire.

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 this parameter is not required.

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 this parameter is not required.

Click to summarize MIL_TEXT("CharName") 1

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

(summarize)

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

InquireType

Specifies the type of inquire to perform.

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

UserVarPtr
Accepts the address of one of the following (see the Parameter associations section for specifics on which is expected):
  • array of type MIL_TEXT_CHAR [optionally, in C++: a reference to a MIL_STRING]
  • array of type MIL_UINT8 [optionally, in C++: a reference to a std::vector<MIL_UINT8> ]
  • MIL_DOUBLE
  • MIL_INT
  • MIL_INT32
  • MIL_INT64
  • MIL_UINT8

Specifies the address in which to write the requested information. Since the MdmrInquireFont() function also returns the requested information, you can set this parameter to M_NULL.

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

The tables below list possible values for the InquireType parameter and possible values returned to the UserVarPtr parameter.

To inquire about a global setting of a font, set the InquireType parameter to one of the values below. Unless otherwise specified, set the FontLabelOrIndex parameter to the label or index of a font, the CharIndex parameter to M_DEFAULT, and the CharNamePtr parameter to M_NULL.

function map For inquiring about a global setting of a font
Click to summarize
InquireType
Description
UserVarPtr
- Possible values returned
Click to summarize M_FONT_INDEX_VALUE +

Inquires the index value of a font. Set the FontLabelOrIndex parameter to the font's label.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE
Click to summarize M_INVALID

Specifies that the font to which you are referring does not exist in the context.

Click to summarize 0 <= Value <= 255

Specifies the index of the font.

Click to summarize M_FONT_LABEL_VALUE +

Inquires the label value of the font. Set the FontLabelOrIndex parameter to the font's index.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE
Click to summarize 0 < Value < 2097152

Specifies the font's label value. If SureDotOCR cannot return the requested information (no such font exists in the context), you will get an error.

(summarize)
Click to summarize M_FONT_SIZE_COLUMNS +

Inquires the number of columns in the font's dot-matrix template. SET

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE
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 M_FONT_SIZE_ROWS +

Inquires the number of rows in the font's dot-matrix template. SET

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE
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 M_FONT_SIZE_TEMPLATE +

Inquires the total number of dots possible in the font's dot-matrix template. The returned value corresponds to M_FONT_SIZE_COLUMNS * M_FONT_SIZE_ROWS.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE
Click to summarize Value >= 0

Specifies the number of dots.

Click to summarize M_NUMBER_OF_CHARS +

Inquires the number of characters in the font. Characters are added with MdmrImportFont() or MdmrControlStringModel().

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE
Click to summarize Value >= 0

Specifies the number of characters.

Combination value for M_FONT_SIZE_COLUMNS; M_FONT_SIZE_ROWS.

You can add the following value to the above-mentioned values to get the default value of an inquire type (if supported), regardless of the current value of the inquire type.

function map For inquiring the default value
Click to summarizeInquireType Description
UserVarPtr
- Possible values returned
Click to summarize M_DEFAULT

Inquires the default value of the specified inquire type.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE

To inquire about a font's characters, set the InquireType parameter to one of the values below. Unless otherwise specified, the FontLabelOrIndex parameter must be set to the label or index of a font, and either the CharIndex or CharNamePtr parameter must specify a character.

function map For inquiring about a font's characters
Click to summarize
InquireType
Description
UserVarPtr
- Possible values returned
Click to summarize M_CHAR_INDEX_VALUE +

Inquires the index value of the character, based on its name. Set the CharIndex parameter to M_DEFAULT and the CharNamePtr parameter to the name of the character in the font.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE
Click to summarize M_INVALID

Specifies that the character to which you are referring does not exist in the font.

Click to summarize Value >= 0

Specifies the index of the character.

Click to summarize M_CHAR_NAME +

Inquires the name of the character, based on its index. Set the CharIndex parameter to the index of a character in the font and the CharNamePtr parameter to M_NULL.

M_CHAR_NAME is returned as a regular string. It consists of all characters including the terminating null character.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: array of type MIL_TEXT_CHAR [optionally, in C++: MIL_STRING ] MORE
Click to summarize Value

Specifies the name.

Click to summarize M_CHAR_TEMPLATE +

Inquires the dot-matrix that represents the character in the font. The dot-matrix is returned as array data, organized one row contiguously after the other, where 255 (0xFF) represents a dot and 0 represents a blank. SET

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: array of type MIL_UINT8 [optionally, in C++: a reference to a std::vector<MIL_UINT8> ] MORE
Click to summarize Value

Specifies the character's dot-matrix.

Combination value for M_CHAR_TEMPLATE.

You can add the following value to the above-mentioned value to determine the required array size (number of elements) to store the returned values.

function map For determining the required array size (number of elements) to store the returned values
Click to summarizeInquireType combination value Description
UserVarPtr
- Possible values returned
Click to summarize M_NB_ELEMENTS

Retrieves the required array size (number of elements) to store the returned values.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE
Combination value for M_CHAR_NAME.

You can add the following value to the above-mentioned value to get the size of a string.

function map For inquiring the size of a string
Click to summarize
InquireType combination value
Description
UserVarPtr
- Possible values returned
Click to summarize M_STRING_SIZE +

Inquires the number of characters in the string. This number accounts for every character, including the terminating null character. All strings have the terminating null character, even though you need not explicitly list it when specifying the string.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE
Combination values for M_CHAR_NAME; M_STRING_SIZE.

You can add one of the following values to the above-mentioned values to determine the UTF-16 (Unicode) character name information, which can be useful when working in an ASCII environment.

If you are in an ASCII environment and you are inquiring about character names (for example, with M_CHAR_NAME) that are within the Basic Latin range, SureDotOCR does not consider the Unicode name, by default. For example, if SureDotOCR reads the character 'A', which is a Basic Latin character, and you use M_CHAR_NAME to get the name of that character, SureDotOCR returns 'A', even if you explicitly named it "\x0041" in the font. To return information about the character's UTF-16 (Unicode) name (that is, "\x0041"), use the combination value M_HEX_UTF16_FOR_ALL.

If you are in an ASCII environment and you are inquiring about character names beyond the Basic Latin range, you can only retrieve information about the character name in hexadecimal format. For example, Basic Latin does not include the smiley face character; it is named in hexadecimal format ("\x263A") in the font.

Note that the string size information can change when these combination values are added. For example, in an ASCII environment, if the first four characters in the font are "abc☺", using M_CHAR_NAME + M_HEX_UTF16_FOR_NON_BASIC_LATIN returns "b" for the character at index 1, and "\x263A" for the character at index 3. Consequently, the string sizes are 2 and 7, respectively (inquired with M_CHAR_NAME + M_STRING_SIZE + M_HEX_UTF16_FOR_NON_BASIC_LATIN). If M_HEX_UTF16_FOR_ALL is specified, the preceding example returns "\x0062" and "\x263A" for the respective character names, and 7 for each string size. Recall that the null-terminating character is included in the string size.

In a Unicode environment, the character representations are returned (for example, the smiley face), unless you explicitly specify a combination value (for example, to obtain "\x263A" instead of the actual smiley face).

function map For explicitly inquiring about Unicode character name information (can be useful when working in ASCII)
Click to summarize
Combination value
Description
Click to summarize M_HEX_UTF16_FOR_ALL

Retrieves results with the name of all characters in hexadecimal 16-bit Unicode (UTF-16) format.

Click to summarize M_HEX_UTF16_FOR_NON_BASIC_LATIN

Retrieves results with the names of characters that fall out of the Basic Latin range, in hexadecimal 16-bit Unicode (UTF-16) format. INFO

Combination value for the values listed in For inquiring about a global setting of a font; the values listed in For inquiring about a font's characters.

You can add the following value to the above-mentioned values to determine whether an inquire type is supported for the font currently being inquired.

function map For inquiring if an inquire type is supported
Click to summarizeInquireType Description
UserVarPtr
- Possible values returned
Click to summarize M_SUPPORTED

Inquires whether the specified inquire type is supported.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE
Click to summarize M_FALSE

Specifies that the inquire type is not supported.

Click to summarize M_TRUE

Specifies that the inquire type is supported.

Combination values for the values listed in For inquiring about a global setting of a font; and for the following values: M_CHAR_INDEX_VALUE; M_CHAR_TEMPLATE; M_STRING_SIZE.

You can add one of the following values to the above-mentioned values to cast the requested information to the required data type.

function map For casting the requested information to the required data type
Click to summarizeInquireType Description
UserVarPtr
- Possible values returned
Click to summarize M_TYPE_MIL_DOUBLE

Casts the requested information to a MIL_DOUBLE.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_DOUBLE
Click to summarize M_TYPE_MIL_INT

Casts the requested information to a MIL_INT.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_INT
Click to summarize M_TYPE_MIL_INT32

Casts the requested information to a MIL_INT32.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_INT32
Click to summarize M_TYPE_MIL_INT64

Casts the requested information to a MIL_INT64.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_INT64
Click to summarize M_TYPE_MIL_UINT8

Casts the requested information to a MIL_UINT8.

(summarize)
Expand data type infoCollapse data type info UserVarPtr extra info
Data type info: Data type: address of a MIL_UINT8
Return value
The returned value is the requested information, cast to a MIL_INT. If the requested information does not fit into a MIL_INT, this function will return M_NULL or truncate the information.
Compilation information
Header Include mil.h.
Library Use mil.lib; mildmr.lib.
DLL Requires mil.dll; mildmr.dll.
NUMBER OF FONTS DEFAULT NULL FONT INDEX VALUE INVALID FONT LABEL VALUE FONT SIZE COLUMNS DEFAULT FONT SIZE ROWS DEFAULT FONT SIZE TEMPLATE NUMBER OF CHARS DEFAULT CHAR INDEX VALUE INVALID CHAR NAME CHAR TEMPLATE NB ELEMENTS STRING SIZE HEX UTF16 FOR ALL HEX UTF16 FOR NON BASIC LATIN SUPPORTED FALSE TRUE TYPE MIL DOUBLE TYPE MIL INT TYPE MIL INT32 TYPE MIL INT64 TYPE MIL UINT8 DEFAULT NULL FONT INDEX DEFAULT NULL FONT LABEL DEFAULT NULL DEFAULT NULL DEFAULT NULL