Synopsis
Retrieves font character information.
Format
void MocrInquire(FontId, InquireItem, ResultPtr)
MIL_ID FontId | Font identifier |
long InquireType; | Item to inquire about |
void *ResultPtr; | Pointer to variable for returned value |
Description
This function inquires about a specific item of an OCR’s font character information.
The FontId parameter specifies the identifier of the font from which to read information.
The InquireType parameter specifies the particular item of the font’s character information to inquire about. It can be set to one of the following values:
InquireType | Description |
M_OWNER_SYSTEM | The MIL identifier (MIL_ID) of the system on which the font has been allocated (MocrAllocFont). |
M_FONT_TYPE | Font type (MocrAllocFont). |
M_CHAR_NUMBER | The number of characters that can be stored in the font (MocrAllocFont). |
M_CHAR_NUMBER_IN_FONT | The number of characters that are currently stored in the font. |
M_CHAR_BOX_SIZE_X | The font character box X size (MocrAllocFont). |
M_CHAR_BOX_SIZE_Y | The font character box Y size (MocrAllocFont). |
M_CHAR_OFFSET_X | The font character X offset (MocrAllocFont). |
M_CHAR_OFFSET_Y | The font character Y offset (MocrAllocFont). |
M_CHAR_SIZE_X | Font character X size (MocrAllocFont). |
M_CHAR_SIZE_Y | Font character Y size (MocrAllocFont). |
M_CHAR_THICKNESS | The thickness of the font character (MocrAllocFont). |
M_STRING_LENGTH | The length of the string that the font is trained to read/verify (MocrAllocFont). |
M_FOREGROUND_VALUE | The foreground value (MocrAllocFont) |
M_FONT_INITFLAG | The initialization flag passed at font allocation (MocrAllocFont and MocrModifyFont). |
M_STRING_ACCEPTANCE | The minimum score for a read/verified string to be considered valid (MocrControl). |
M_CHAR_ACCEPTANCE | The minimum score for a read/verified character to be considered valid (MocrControl). |
M_CHAR_INVALID | The symbol used for unrecognized characters. When no special character has been defined by the user the returned value is M_NULL (MocrControl). |
M_TARGET_CHAR_SPACING | Intercharacter spacing, which is the distance between adjacent characters (MocrCalibrateFont and MocrControl). |
M_TARGET_CHAR_SIZE_X | The target image character X size (MocrCalibrateFont?and MocrControl). |
M_TARGET_CHAR_SIZE_Y | The target image character Y size (MocrCalibrateFont and MocrControl). |
M_SKIP_CONTRAST_ENHANCE | The contrast enhancement flag (MocrControl). |
M_SKIP_STRING_LOCATION | The string location flag (MocrControl). |
M_ROBUSTNESS | The robustness/speed factor. |
M_CHAR_IN_FONT | The characters present in the font. A null terminated array of character is returned. |
M_CONSTRAINT_TYPE+n | The constraint character type for the nth position (MocrSetConstraint). |
M_CONSTRAINT+n | The constraint string for the nth position in the string. A null terminated array of characters is returned (MocrSetConstraint). |
The ResultPtr parameter specifies the address in which results will be written. This parameter should be a pointer to a double, except in the case of the M_CONSTRAINT+n and M_CHAR_IN_FONT parameters, when it should be a pointer to an array of characters. The type and size of the data pointed to by ResultPtr should match the default result pointer type and size specified above (if not overridden). For the M_CONSTRAINT+n and M_CHAR_IN_FONT parameters, ResultPtr must point to an array of size equal to the number of characters in the font plus one extra entry. This is because the string is null-terminated.
It is possible to override the default ResultPtr type by appending one of the following to the InquireType parameter:
M_TYPE_CHAR | Returns data cast to char. |
M_TYPE_SHORT | Returns data cast to short. |
M_TYPE_LONG | Returns data cast to long. |
M_TYPE_FLOAT | Returns data cast to float. |
M_TYPE_DOUBLE | Returns data cast to double. |
For example, setting InquireType equal to M_CHAR_SCALE_X +M_TYPE_LONG will force the font character X size to be written to the variable pointed by ResultPtr as a long value.
See also
MocrAllocFont, MocrControl, MocrSetConstraint, MocrCalibrateFont, MocrModifyFont
《MocrInquire()函数》上有2条评论
评论已关闭。