ZPLToolkit

^FT

Field TypesetPreview: partial

Places a field by its baseline rather than its top-left corner, so text of different sizes lines up.

Syntax

^FTx,y,z

Parameters

ParameterDescription and accepted valuesIf omitted
xDistance from the left edge, in dots. Omit it to keep the current position.0 to 32000 dots from the left edgeCurrent position
yBaseline position measured from the top edge, in dots. Omit it to keep the current position.0 to 32000 dots from the top edgeCurrent position
zJustification for the field. Requires firmware V60.14.x or later.0 left, 1 right, 2 autoLast ^FW value, otherwise 0

How it works

^FT positions a field by the baseline of the text — the line the letters sit on — instead of the top-left corner used by ^FO. When you place two pieces of text of different heights, ^FT is what makes them share a bottom edge instead of a top edge.

Both coordinates are optional. ^FT,180 keeps the current x and moves only vertically, and ^FT100 keeps the current y. This makes it convenient for laying out a column of fields that share a left margin.

For barcodes, ^FT places the bottom of the bars, not counting the human-readable line. That is a real difference from ^FO, which places the top of the symbol, and it is worth checking when converting a template from one to the other.

Example

ZPL
^XA
^FT50,120^A0N,40,40^FDBaseline^FS
^FT,180^A0N,40,40^FDSame x^FS
^XZ

Rendering…

The second field omits x, so it inherits 50 from the first.
Open in the viewer

How the preview on this site handles it

Positions and the omitted-parameter behaviour are reproduced. The justification parameter z is ignored, and the baseline is approximated with a browser font rather than the printer-resident one.

Common mistakes

  • Swapping ^FO for ^FT without adjusting y. The field moves up by roughly the character height, because y now means the baseline.
  • Assuming ^FT,180 resets x to zero. It keeps whatever x the previous field used.
  • Forgetting that ^FT on a barcode positions the bottom of the bars, so tall barcodes grow upwards.

See also