ZPLToolkit

^FO

Field OriginPreview: partial

Places the top-left corner of the next field. It is the command you will use more than any other.

Syntax

^FOx,y,z

Parameters

ParameterDescription and accepted valuesIf omitted
xDistance from the left edge of the label, in dots.0 to 32000 dots from the left edge0
yDistance from the top edge of the label, in dots.0 to 32000 dots from the top edge0
zJustification for the field. Requires firmware V60.14.x or later.0 left, 1 right, 2 autoLast ^FW value, otherwise 0

How it works

^FO sets where the next field starts, in dots, measured from the label origin. The coordinate is the top-left corner of the field: text hangs down and to the right of it, and so does a barcode or a graphic box.

Coordinates are always in dots, so the same ^FO50,50 lands in a different physical spot on a 203 dpi and a 300 dpi printer. When you migrate a template between resolutions, every coordinate scales by the ratio between them.

^FO stays in effect until the field is closed with ^FS. The companion command ^FT positions by the text baseline instead of the top-left corner, which is usually what you want when you are aligning text of different sizes.

Example

ZPL
^XA
^FO50,50^A0N,40,40^FDLeft^FS
^FO50,120^A0N,40,40^FDBelow^FS
^XZ

Rendering…

Two fields at the same x, 70 dots apart vertically.
Open in the viewer

How the preview on this site handles it

Position is reproduced exactly. The justification parameter z is parsed but not applied, so right-justified and auto-justified fields preview as left-justified.

Common mistakes

  • Treating the coordinates as millimetres. They are dots — divide by 8 for millimetres at 203 dpi.
  • Placing a field at a coordinate outside ^PW or ^LL. It is clipped rather than reported, so the field simply vanishes.
  • Using ^FO to align text of different sizes. The tops line up but the baselines do not; use ^FT for that.

See also