Rotating text in ZPL: the command that works and the one that does nothing

^FW looks like the rotation command and is ignored on conversion. What actually rotates is the letter inside ^A0, and not knowing the difference costs an afternoon.

Rotation lives inside the font command

In ZPL, every field carries its own orientation, and it is the first letter after the font command. ^A0N draws normally; ^A0R turns it 90 degrees.

^XA
^FO40,40^A0R,50,50^FDgirado^FS
^XZ

That label comes out with the text on its side, reading top to bottom. We checked all four letters as images, against the renderer EasyZPL uses:

LetterEffect
NNormal, left to right.
RTurns 90 degrees clockwise.
ITurns 180 degrees: the text comes out upside down.
BTurns 270 degrees: the text reads bottom to top.

The same letter works for barcodes: ^BCR rotates a Code 128 the way ^A0R rotates text, and we rendered that too.

^FW does nothing here

^FW exists to set a default orientation for every field that follows, saving you the letter on each one. It is the command that turns up in every search for "rotate ZPL label".

On conversion it is ignored. We rendered ^FWR followed by an ^A0N field, and the same field without the ^FWR: the output is identical byte for byte, upright text in both cases.

So if you wrote ^FWR expecting the label to turn and nothing happened, it is not your mistake and not a broken file. The way out is the letter on each field: what ^FW would do in one line, ^A0R does per field, and that works.

Rotating the whole label is a different thing

There is a difference between rotating the content and rotating the page. Rotating every field with ^A0R keeps the page upright, with the text lying sideways inside it. That is nearly always what you want for a label that leaves the roll sideways.

If what you want is a landscape page, 152 mm wide by 101 mm tall, the route is not the file: it is swapping width for height in the fields on screen. Conversion builds the page at the size you ask for, and swapping the two numbers rotates the whole page without touching a single command.

^PO, which on a printer would flip the label 180 degrees, is also ignored, and we tested ^POI as well. The guide on ignored commands lists everything in that category.

The position does not rotate with the text

The trap that remains: rotating the text does not rotate ^FO. The position still counts from the same origin in the top left corner, and rotated text grows in a different direction from there.

The practical consequence: a field that fitted horizontally from ^FO40,40 can run past the bottom edge once rotated, because the length that used to consume width now consumes height. On a 4 × 6 inch label there is room to spare; on a 2 × 1 inch label there is not.

The way to check is the usual one: convert one and look. Text that runs off the edge gives no warning, it simply disappears, like all content placed outside the label area.

← All guides