zpl.tools
Fields

^FO - Field Origin

Sets the top-left corner of the next field.

^FO places the field that follows by its upper-left corner, measured from label home rather than from the edge of the media. It is the ordinary way to position text, a bar code, a box or an image. ^FO anchors the top of the character cell, so a larger font under a fixed ^FO grows downwards. ^FT anchors the baseline instead, which is why address blocks and tabular layouts use ^FT.

Syntax

^FOx,y,z

Support

Supportedparsed: full · state: full · rendered: full

Every documented parameter renders the same output Labelary produces.

Labelary renders this command.

Parameters

xX-axis positionoptional · dots

Distance right from label home, set by ^LH. Not from the left edge of the media unless label home is 0.

Default
0
Accepted range
0 to 32000 dots
Invalid value
clamped to the nearest allowed value. The renderer clamps a value above 32000 to 32000, and reports an invalid argument. A non-numeric value reads as 0, which places the field at the left edge.
Test coverage
Bounds pinned: maximum (32000), below the minimum (-200), above the maximum (33000). No test at the minimum. The invalid-value rule is pinned by 5 tests, including the diagnostic it emits.
yY-axis positionoptional · dots

Distance down from label home. For text this is the top of the character cell, which is what distinguishes ^FO from ^FT.

Default
0
Accepted range
0 to 32000 dots
Invalid value
clamped to the nearest allowed value. The renderer clamps a value above 32000 to 32000, and reports an invalid argument. A non-numeric value reads as 0, which places the field at the top edge.
Test coverage
Bounds pinned: maximum (32000), above the maximum (33000). No test at the minimum. The invalid-value rule is pinned by 2 tests, including the diagnostic it emits.
zJustificationoptional · one of a set

Which side of the field the x coordinate pins.

Default
the justification last set by ^FW, or 0
Invalid value
discarded, and the default applies. Any other value uses the current ^FW justification.
Test coverage
Values exercised: 0, 1. Not exercised: 2. The invalid-value rule is not pinned by a test.
0
Left justify: the field grows rightwards from x (default)
1
Right justify: the field grows leftwards from x
2
Auto justify, chosen from the field's rotation

Behavior

A field has one origin. ^FO and ^FT overwrite each other, so the last one before ^FS decides the anchor as well as the position: ^FT100,100^FO50,50 positions by top-left corner, not by baseline.

The coordinates are relative to label home, so ^LH, ^LS and ^LT move the field with the rest of the label. An origin beyond the label is not an error: the field is not visible. That explains a field that renders on a larger label size and disappears on a smaller one.

Right justification is easy to misread. z=1 puts the x coordinate at the field's right edge and lets the field grow leftwards. ^FO40,20,1 on a wide field therefore runs off the left of the label and prints nothing. Use it with the x coordinate at the right-hand margin. Justification 2 takes the side from the direction of the text, which for left-to-right text is the same as 0. The renderer uses whatever ^FW last set, and does not inspect the text.

Tested behavior

Differences from the specification

Labelary against the ZPL II guide

Where Labelary — our compatibility target — behaves differently from the printed specification.

  • The 2006 guide's format is ^FOx,y: the justification argument z appears in Labelary's reference and in later firmware, not in the guide. — pinned by test_fo_right_justified_fs

zpl.tools against the ZPL II guide

Where our renderer behaves differently from the specification.

  • A negative origin uses its magnitude, so ^FO-200,50 places the field 200 dots in. The guide's range for either origin starts at 0. The report reads Value -200 is negative, but negative values are not allowed; used 200 instead. Labelary agrees, measured on 2026-08-21. — pinned by test_fo_negative_x_uses_the_magnitude

Example

Left and right justification against the same x coordinate. The two right-justified fields both end at 700 dots however long their text is, while the left-justified one starts there and runs off the label:

^XA
^FO700,20,1^A0N,26,26^FDright at x=700^FS
^FO700,60,1^A0N,26,26^FDshorter^FS
^FO700,100,0^A0N,26,26^FDleft at x=700^FS
^XZ

Open in viewer