zpl.tools
Fields

^FR - Field Reverse Print

Inverts the field where it overlaps what is already on the label.

^FR inverts the field that follows against what the label already holds: black ink turns white where it crosses a black area, and stays black over white. It is not a "white text" switch, because a printer has no white ink. Reverse text needs something dark underneath it, normally a ^GB block drawn first.

Syntax

^FR

Support

Supportedparsed: full · state: full · rendered: full

Every documented parameter renders the same output Labelary produces.

The field inverts as one mask wherever ^FR stands in it, so a ^GS mark that crosses itself inverts once. A field whose content is an image does not reverse yet. — pinned by test_fr_reversed_shape_is_the_exact_negative_of_the_plain_shape

Labelary renders this command.

Parameters

^FR takes no arguments.

Behavior

^FR applies to one field, and every field that needs it must repeat it. ^LR reverses a whole label once.

^FR works against what the label already holds, so order decides the result. An earlier field must draw the dark area: reorder the ^GB and the text, and the text inverts against blank stock and prints nothing visible. Labelary calls it XOR drawing, so a second reversed field over the first inverts the overlap back.

^FR inverts only the ink of the field itself: the glyph strokes, the bars of a symbol, the border of a box. It does not invert the blank space around them. Reverse text therefore reads as white letters inside the block underneath, and the block must be large enough to contain them.

Known issues

One known divergence from the reference render. It is measured, tracked, and pinned by a test — so the output stays wrong in exactly this way until the issue is fixed, rather than drifting.

Wrong content

Reverse print does not reach an image field, so a barcode or a graphic under ^FR prints in its own color over the ink an inversion would cut out

What the label says differs — a scanner or a person reads something other than the reference.

Tracked in project/var/claude/parity-issues/FINDINGS.md. Pinned so it cannot change unnoticed by test_fr_does_not_reverse_an_image_field.

Tested behavior

Differences from the specification

zpl.tools against the ZPL II guide

Where our renderer behaves differently from the specification.

  • The ^GS CSA symbol (^FDE) inverts once under ^FR where it crosses itself. The field's ink is composed into one mask, and a PDF transparency group inverts that mask as a single object. — pinned by test_fr_gs_over_filled_box

Example

A solid block, then reversed text over it. The block is 60 dots thick over a 60-dot height, which is ^GB's way of drawing a filled rectangle:

^XA
^FO40,30^GB300,60,60^FS
^FO50,40^A0N,40,40^FR^FDRUSH ORDER^FS
^FO40,120^A0N,40,40^FDplain^FS
^XZ

Open in viewer