When you click on the Add button from the
Fonts area of
the
Configuration pane, you are presented with a list of fonts
that you can use to read strings. To add a font to this list, click
on the Import from
file... button and select a MIL SureDotOCR font file. This is
essentially a text file, with the extension MDMRF, containing
content that respects the expected
specifications for defining a SureDotOCR font.
Modifications made to SureDotOCR fonts and characters are saved
with your Matrox Design Assistant project. You can export these
fonts from your project, and import them into another project; you
can also import fonts that were exported from a MIL SureDotOCR
context. Such fonts automatically have the proper extension and
follow the expected specifications. To export a font, you must
first click the Edit... button from the
Fonts area of
the
Configuration pane.
Optionally, you can manually create and update your own font
files by using the MDMRF extension when saving (instead of, for
example, the TXT extension). Ensure the file is in UTF-16
(little-endian order) and starts with a byte order mark (BOM) that
indicates this; the BOM value is U+FEFF. Although often supported,
editors might not use the standard terminology, UTF-16. For
example, you might have to save the file as Unicode or UCS-2
little-endian.
The content of all SureDotOCR font files must adhere to expected
specifications. Below is an example of how SureDotOCR expects the
character 'A' to appear in a font:
The following is a line-by-line description of what SureDotOCR
files should contain.
Line
|
Description
|
1
|
This line contains the text, "File Representation".
|
2
|
This line contains the text, "MIL_DOT_FONT".
|
3
|
This line is blank.
|
4 and above
|
These lines specify the entry of every character in the
font.
-
Each entry begins with the word "CharValue", a space, and the
character name. The character's dot-matrix representation is on the
next line. "FF" is for dots that represent the character; the rest
use "00". Every dot-matrix of every character must contain at least
one "FF", and have the same number of columns and rows. Lines
beginning with the hash character ('#') are comments. They should
not be within a character's dot-matrix and are typically used
sparingly (only when they provide true value).
Blank lines separate multiple characters in a font. A
character's "CharValue" name should properly identify its
dot-matrix representation. For example, if the "CharValue" name is
'1', its dot-matrix should not represent the letter 'A'.
"CharValue" names should be unique within a font.
-
Character names can be in UTF-16 byte hexadecimal; these begin
with "\x". For example, "CharValue \x0041" specifies 'A'.
Alternatively, you can enter the UTF-16 character directly (for
example, the capital Greek letter PSI) if using Windows API
functions with the UTF-16 macro, and your source code is saved as
Unicode.
Expressing characters in UTF-16 byte hexadecimal allows you to
specify them directly in C++ string literals. This notation can
also be useful if you are in an ASCII environment and you want to
have Unicode characters beyond the Basic Latin range.
Names for special surrogate pairs in UTF-16 byte hexadecimal are
listed successively. For example, "CharValue \xD83D\xDE0A"
specifies a smiley face character.
-
Dot-matrix fonts cannot represent certain characters, such as
null or the standard space (0x0020). To establish the distance
between characters in a string that represents a space, refer to
the Define
spaces subsection of the Procedure for using
the SureDotOCR step section earlier in this chapter.
|