SmartCAM Technical Bulletin: 223

Topic: Creating a SmartCAM Font File

Technote 223
Date: 10/06
Product: All
Version: v12.x and Up

SmartCAM Font files are specially prepared Process Model files. While there are some specific rules that need to be followed, creating a font file is not that difficult.

The following is a screen capture of the AFONT.PM5 file. Use this bitmap as a reference, when reviewing the requirements for a font file.

AFONT.PM5 Screen Capture

The format for a font file is straightforward. User Commands are used to establish which geometry belongs to which character. An initial user command is used to specify the start of the letter's geometry and which letter/number/character the geometry describes. Immediately following the establishing User Command is the geometry that describes the character. Following the character geometry is another User Command, which established the width of the character and marks the end of the geometry for that character. This second User Command could be an end-of-line marker or the establishing user command for another character.

In the example bitmap, you can see that there is a User Command, followed by the geometry that defines the capital letter "A", followed by the user command that established the letter "B" and so forth. Each row of text ends with a trailing user command. This trailing user command is used describe the width of the last letter in the row, for example the capital letter "S" - in the case of the top line.

When creating text in SmartCAM, the following will happen. Assume the text string you want to add to your Process Model is "AS-1." The text string is just an example, there is no real meaning to it.

SmartCAM will open the font file that you have designated. It then starts to read through the sequenced geometry looking for User Commands. When it locates a User Command, it compares the Event Text against the letter currently being searched for.

In the above example, SmartCAM first looks for a User Command with the Event Text set to "A." When located, SmartCAM begins to copy the geometry that follows this User Command into your process model. It copies the data in the same sequence as it appears in the font file. SmartCAM will continue to copy data until it reaches another User Command.

This second User Command not only tells SmartCAM to stop copying geometry, it also sets the width of the character. In this case, the width of the letter "A" is exactly the same as the width between the letter's User Command and the next User Command in the database (in this case, the User Command that defines the letter "B").

In our example, the next letter searched for is the letter "S." Again, SmartCAM starts reading through the font file looking for the appropriate User Command. When the User Command for "S" is found, SmartCAM then starts to copy geometry until the next User Command is encountered.

As you can see by looking at the example bitmap, the next User Command after "S" does not have any geometry. This user command is used to set the width for the letter "S". Without this "special" User Command, the subsequent User Command established the letter "T". But notice the location of this user command, it is far to the left of the letter "S", which would really throw off the letter spacing if used.

Continuing, SmartCAM searches for the "hypen" and finally the number "1."

If the character being searched for does not have an associated User Command, then nothing is added to your current Process Model. Additionally, this triggers a "2728 Error - Can't Find Character" error.

If the example font only had capital letters and numbers and you tried to create the text string "Lower," then only the letter "L" would be created in your process model. The lower case letters would not be found and thus, nothing would be output.

You can create geometry, in a font file, for any character that you can enter in a text input box. This means you can also create extended ASCII characters, such as non-Western characters.

To have anything output, it must have a matching User Command in the font file. This includes non-display characters, such as the space character. Obviously, the space character will have no geometry, but it does need the defining User Command and a trailing User Command to establish its width.

The User Commands used are the regular SmartCAM User Commands. When you create it you set the Event Text to the letter that the proceeding geometry will define. For example, in the case of "A", the User Command's Event Text is: A.

To create a User Command for the space character, the Event Text is: " ". Simply press the space bar once.

You may only have a single character in the Event Text.

In the above bitmap example, there are User Commands at the end of each row of text. These User Commands do not have any geometry associated with them. As discussed, they exist to establish the width of the preceding character. This means the Event Text for these User Commands are different. The Event Text cannot be a character that might otherwise be used. If it is, SmartCAM will be unable to tell that this User Command is not establishing a valid character.

For these special user commands, set the Event Text to nothing - a blank, empty field.

Before starting on your first font, it would be a good idea to open an existing font into SmartCAM and examine how it is created. This will give you a very good idea of what will need to happen.

You can also make changes to the existing fonts to see what those changes will do. If you do this, make sure you save the font with a new filename. Do not modify the existing fonts.

When you create a new font, always save it with a new file. Again, do not overwrite shipping fonts.

The following are some further requirements needed to successfully create a font file:

  • All geometry, including User Commands, are on Layer 1
  • Level and Profile Top for all geometry is 0 - font files only support X/Y axis.
  • All Font file geometry should be created on the XY Plane.
  • Geometry should be scaled or designed with a max height of 1 unit. If the Process Model is in Inch units, the tallest character should have a height of no more than 1 inch.
  • Use only Lines and Arcs to create the fonts; do not use splines, polylines, helixes, etc.
  • You can have multiple rows of defined text; for example uppercase letters on one row, lower case on another, numbers on a 3rd, and punctuation on a forth. Each row of text should be aligned on the same Y-Axis value. Review the screen capture of the AFONT, which shows this layout.
  • Each "row" of text is ended with a special User Command. See above image for example.
  • Character spacing is controlled by the User Commands. The amount of space that the letter "A" takes is defined by the User Command that precedes the geometry for letter "A" up to the User Command that defines letter "B."