zpl.tools
Fields

^FW - Field Orientation

Sets the default rotation and justification for the fields that follow.

^FW sets the rotation that every following field takes unless it names one of its own. It saves a repeated R on a whole column of rotated fields, and one edited line turns a format sideways. ^XZ does not clear ^FW, so it carries into the labels after it in the same stream.

Syntax

^FWr,z

Support

Partially supportedparsed: partial · state: full · rendered: partial

The command renders, with the caveat below.

The rotation argument works, and the justification argument accepts 0 (left) and 1 (right) as well as the letters; 2 (auto) falls back to the default, which is how Labelary renders it. — pinned by test_fw_justification_digit_right_justifies, test_fw_rotates_a_field_that_omits_its_own_orientation

Labelary renders this command.

Parameters

rRotationoptional · one of a set

Rotation for every later field that does not set its own. ^XZ does not reset it: the setting carries into the labels that follow.

Default
N
Invalid value
discarded, and the current value is kept. An unrecognized rotation leaves the previous ^FW setting in place, and reports an invalid argument.
Test coverage
Values exercised: N, R. Not exercised: I, B. The invalid-value rule is pinned by 3 tests.
N
Normal (default)
R
Rotated 90° clockwise
I
Inverted 180°
B
Read from bottom up, 270°
zJustificationoptional · one of a set

Default justification for ^FO and ^FT when they omit their own third parameter.

Default
the value last accepted, or 0
Invalid value
discarded, and the current value is kept
Test coverage
Values exercised: 0, 1, 2. The invalid-value rule is pinned by 1 test.
0
Left justify (default)
1
Right justify
2
Auto justify, chosen from the field's rotation

Behavior

Only fields that leave their own rotation argument empty follow ^FW. ^A0N,70,60 prints upright under ^FWR, and ^A0,70,60 — the same command without the rotation — rotates. ^FW is therefore easy to test: set it, and whatever does not move names its own orientation. Bar codes follow ^FW through their o argument in principle, but the renderer never applies ^FW to a bar code field, so a symbol after ^FWR stays upright.

The rotation is a property of the field, not of the label. A rotated field keeps the origin from ^FO or ^FT, and grows away from that point in the rotated direction, so a rotated field normally needs a new origin too. ^PO inverts the whole label instead, and the two compose.

Nothing in ^XA resets the orientation, so a ^FWR in one label rotates the next label in the same request unless that label sets ^FWN. Set the orientation explicitly at the top of every format.

Known issues

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 ^FWr: the justification argument appears in Labelary's reference and in later firmware, not in the guide. — not pinned by a test

zpl.tools against the ZPL II guide

Where our renderer behaves differently from the specification.

  • A bar code field whose own o argument is omitted inherits its rotation from ^FW, matching Labelary; an explicit o still wins over it. — pinned by test_fw_is_not_applied_to_barcode_fields

zpl.tools against Labelary

Where our output differs from Labelary for the same input. These are the differences that break a migration.

  • The justification argument accepts the documented digit values: 0 is left and 1 is right, matching Labelary. Value 2 (auto) renders exactly like the default with either origin command (measured 2026-08-14), so it stays unmapped and falls back. — pinned by test_fw_justification_digit_right_justifies, test_fw_documented_justification_digits_are_mapped

Example

The guide's own demonstration, condensed: under ^FWR the field that names N stays upright and the one that omits its rotation follows ^FW:

^XA
^FWR
^FO300,40^A0N,30,30^FDexplicit N^FS
^FO300,40^A0,30,30^FDinherits FW^FS
^XZ

Open in viewer