^FB defines a text block that automatically wraps text at a specified width and allows multiple lines within a single field. Without ^FB, a text field is a single line — any text that exceeds the label width simply runs off the edge. With ^FB, you get controlled word-wrap in a defined column.
The width parameter (w) defines the maximum width of the text block in dots. The maximum line count (l) caps how many lines are rendered — any additional text is discarded. The spacing parameter (s) adds extra vertical gap between lines.
The justification parameter (j) controls alignment within the block: L = left, C = center, R = right, J = justified (last line left). This is independent of the ^FO positioning.
You can embed hard line breaks in the ^FD string using the ZPL line-feed sequence: the backslash followed by `&`. A `\&` forces a new line within the field.
^FB is especially useful for address blocks, product descriptions, or any multi-line content that would otherwise require multiple ^FO/^FD/^FS field triplets with manually calculated y-coordinates.
Syntax
^FBw,l,s,j,i
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| w | integer | optional | Block width in dots. Text wraps at this boundary. |
| l | integer | 1 | Maximum number of lines. Text beyond this line count is discarded. |
| s | integer | 0 | Additional line spacing in dots (added to the normal line height). |
| j | L | C | R | J | L | Justification: L = left, C = center, R = right, J = full justify. |
| i | integer | 0 | Hanging indent in dots for lines 2 and beyond. |
Examples
Three-line address block, left-justified
Try in Viewer^XA ^FO50,50^A0N,28,28^FB350,3,4,L,0^FDJohn Smith&123 Main Street&Springfield, IL 62701^FS ^XZ
Centered multi-line label title
Try in Viewer^XA ^FO50,30^A0N,36,36^FB500,2,6,C,0^FDHazardous Material&Handle With Care^FS ^XZ
Common Mistakes
- !Setting w too narrow for the font size — the text wraps mid-character and looks broken.
- !Exceeding the l (max lines) parameter — extra lines are silently discarded, not shown.
- !Using newline characters (\n) inside ^FD — ZPL line breaks require the \& sequence, not \n.
- !Omitting ^FB and manually stacking multiple fields — works but is harder to maintain for dynamic content.