Font Shortcuts
Font Shortcuts

Font Shortcuts

There are times when you might include a specific font into your script and use it repeatedly within different fields.
The following is an example of one way to write this script:
^XA ^FO120,108^A0N,89^FDA Guide to^FS ^FO120,207^A0N,89^FDZPL II^FS ^FO120,306^A0N,89^FDProgramming^FS ^FO120,405^A0N,89^FDLanguage^FS ^XZ
Notice that the
^FS
command is used on the second to last line to close the field. Actually, it is unnecessary because the
^XZ
will accomplish the same thing, so we can remove it from our script. Also, since the font and font size are not changing within the fields, this script can be simplified for quicker transmission by removing the unnecessary font entries and listing the font information once using the
^CF
command (see ^CF):
^XA ^CF0,89 ^FO120,108^FDA Guide to^FS ^FO120,207^FDZPL II^FS ^FO120,306^FDProgramming^FS ^FO120,405^FDLanguage ^XZ
This script can be made even more efficient by including the
^FB
command to identify the left origin of the text which occurs at the same place each time. For details, see ^FB:
^XA ^CF0,89 ^FO120,108 ^FB800,6 ^FDA Guide to\&ZPL II\&Programming\&Language ^XZ
The entries “\&” within the text indicate a carriage return/line feed as allowed by the
^FB
command. For details, see ^FB.
If you wanted to change the font type or size within the script, however, you would need to include the specific font parameters within the field where the change occurs. In this case, you would not want to use the
^FB
command because the change in font size (in our example below) will affect the y-axis (up and down) position of the text.
You can still use the
^CF
command, but you will need to include the specific font information on the line where the change in the field occurs:
^XA ^CF0,89 ^FO120,108^FDA Guide to^FS ^FO120,207^FDZPL II^FS ^FO120,306^A0N,110^FDProgramming^FS ^FO120,426^FDLanguage ^XZ