# Font Rendering

The OCVMax tool uses Cognex PatMax technology to search for the character strings in each acquired image. After you specify the necessary key sets, you can graphically generate an example of each string and position them on a training image showing the actual strings you need to verify. Positioning these string graphics over the training image helps the PatMax algorithm by providing a logical starting position for each search, as well as provide good initial values for the size, rotation, and character spacing the PatMax algorithm needs to have in order to tune the OCVMax tool with good search parameters for reliably locating each character in successive run-time images.

Graphically rendering an example of each string you want to verify is not mandatory, but generally improves the performance speed and reliability of the OCVMax tool.

For example, the following figure shows an image containing a single string:

The next figure shows the same image after a user has rendered a string and used the OCVMax tool graphics to position the string over the corresponding characters in the training image:

As you render and position a character string over the training image, you might notice the character keys in the image show slightly different characteristics than the character keys in the font you specified, even though you chose the correct font. For example, the printed strings in your images might use a dot-matrix font where the dots are not symmetrical in shape, or are slightly larger in scale than specified by the font.

You can compensate for these types of character key differences with the following advanced font parameters:

- Additional Character Spacing

  You can specify additional spacing, in pixels, between character keys in both the horizontal and vertical direction.

- Additional Line Spacing

  The tool allows you to specify additional spacing, in pixels, between lines of character keys when you specify a multi-line string.

- Character Features

  Primarily for dot-matrix fonts, you can specify the difference in scale between dots in the image and the dots specified by the font you use, or increase the stroke width in non dot-matrix fonts.

You can set these parameters as you position the strings you render over a training image. Be aware, however, that if you enable the tuning feature of an OCVMax tool, the tool itself can set good starting values for these advanced parameters, although you can always choose to change their values later to improve reliability or execution speed.