Font Files

To configure an OCVMax tool you need a font file that already defines the layout of each character in the font, also known as character keys. You can specify any font file for use with an OCVMax tool, which supports all Western-language TrueType ASCII and 16-bit Unicode character fonts (21-bit Unicode fonts are not supported). Other font types might work with the OCVMax tool, but you must experiment with acquired images and OCVMax tool parameters to determine how well they work.

Font information to be used by the OCVMax tool is contained in paragraphs that are part of an arrangement you supply to the tool.

You use the ccOCVMaxParagraph::font() function to specify the font for a paragraph or obtain the font information for a paragraph.

Character strings applied by laser jet (also known as video jet) or thermal printer likely use a common font. You must acquire the font file separately. In order to locate the correct font file for your vision application, Cognex makes the following suggestions:

  • Contact your print equipment vendor.
  • The vendor should be able to provide you with the name of the font the printing equipment uses, and perhaps even the font file itself.

  • If you know the name of the font, search the \WINDOWS\Fonts directory on your PC.
  • If your print equipment uses a TrueType font, you can preview all TrueType fonts by using the font dialog box of Microsoft Word.

    Note: Microsoft Windows prevents users from directly opening font files in the \WINDOWS\Fonts directory. If you need to use a font from \WINDOWS\Fonts, first copy it to any other local directory.

  • Generate your own font file by using the Image Font Extractor, available by choosing Start->All Programs->Cognex->CVL->Utilities->Image Font Extractor.
  • To generate your own font file you need an image containing examples of the characters you want to verify.

  • Try the http://www.myfonts.com/WhatTheFont web site, which is an online source for finding, trying, and buying fonts. The web site boasts 41,680 fonts with search tools that allow you to find and buy the right font to match your printed strings.

An OCVMax tool can use the following font file types:

Font Extension

Font Type

.ttc

TrueType collection font file (a font file that contains multiple TrueType fonts)

.ttf

TrueType font

.cst

Domino stroke font

.gcg

Imaje raster font

.ffn

The OCVMax tool supports the following Markem fonts:

  • 16 high x 10 wide (hi_res16.ffn)
  • 7 high x 5 wide (hi_res7.ffn)
  • 5 high x 5 wide (char_5_5.ffn)

.xcl

VideoJet raster font

.fnt

Zebra raster font (many other font files may also use this extension)

.bdf

Glyph Bitmap Distribution Format font

.ocf

Cognex image font file

.ocm

Cognex extended image font file