ZPL guide 3 of 9

Text and fonts in ZPL

Choose a font and size, set a default font, wrap paragraphs in a block, and print accents and the caret and tilde characters. Includes the guide's own advice on ^FB versus ^TB.

Choosing a font and a size

Question How do I print text at a size I choose?

^A chooses the font, the orientation and the character height and width in dots, for the next field only. After that field, the default font set with ^CF applies again.p. 60

The guide says most printers come standard with 15 bitmapped fonts and one scalable font. The scalable one is font 0, and it accepts any height and width from 10 to 32000 dots.pp. 50, 60, 1580

A bitmapped font has a fixed dot matrix and only grows in whole multiples, from 1 to 10 times its standard height and width. Ask for a size in between and the printer rounds to the next size it recognizes.pp. 50, 60

Because that matrix is counted in dots, its physical size changes with the printhead. Font A is 9 by 5 dots; the guide lists it as 1.12 by 0.76 mm on an 8 dots per millimeter head and 0.75 by 0.50 mm on a 12 dots per millimeter head.pp. 1583, 1584

If you give only a height or only a width, the font's standard matrix supplies the other. For scalable fonts, setting both equal gives balanced-looking characters.pp. 61, 1583

^CF sets the default font, height and width used by every field that has no ^A of its own, so you need not repeat ^A on every field. At power-up the default is font A at height 9 and width 5, though the guide says the width can instead be the last permanently saved value.p. 154

TipA sensible habit for a modern layout is one ^CF at the top and an ^A only where a field differs.

^FT positions a field by an origin tied to its contents instead of its upper-left corner; for a ^FB block the guide says that origin is the baseline of the last line, so a bigger font grows the block upward from it. ^FP changes the character direction (horizontal, vertical or reverse), mainly for Asian fonts. ^FV takes the place of ^FD for a variable field and, unlike ^FD, is cleared after the label prints.pp. 187, 202, 205, 207

Rotation is the orientation parameter of ^A, with ^FW supplying the default. The coordinates guide covers how it interacts with ^FO.

example.zplZPL
^XA
^CF0,34
^FO40,30^FDProduct name^FS
^FO40,80^A0N,24,24^FDDetail line^FS
^XZ

^CF makes font 0 at height 34 the default, and the first field uses it. The second field overrides it with ^A for that field only.

Paragraphs that wrap

Question How do I print a paragraph, and should I use ^FB or ^TB?

^FB turns the following ^FD data into a block with automatic word wrap. Its values are the block width in dots, the maximum number of lines, extra spacing between lines, justification (left, center, right or justified) and a hanging indent.p. 186

WarningMind the defaults: a width of 0, or one smaller than the font, prints nothing, and the line limit defaults to 1. Text beyond the limit does not spill; it overwrites the last line.p. 186

Inside a block, \& is a line break. The data string is limited to 3K, each block needs its own ^FB, and ^FS ends it.p. 187

^TB is the same idea with a fixed box: it takes a rotation, a width and a height in dots, wraps text automatically, and truncates what does not fit. The guide calls ^TB the preferred command for blocks of text instead of ^FB, but it exists only on firmware V60.14.x, V50.14.x or later. Use ^TB where your firmware has it, and ^FB elsewhere.p. 356

WarningIn ^TB, data between the characters less-than and greater-than is treated as an escape sequence, so plan for that if your text contains them.p. 356

example.zplZPL
^XA
^CF0,28
^FO40,30^FB360,3,4,L^FDA paragraph that wraps inside the block.^FS
^XZ

^FB makes a left-justified block 360 dots wide with at most three lines and 4 extra dots between lines. The text after ^FD is the paragraph.

example.zplZPL
^XA
^FO40,30^A0N,28,28^TBN,360,90^FDA paragraph inside a box.^FS
^XZ

The ^TB equivalent: a normal-rotation box 360 dots wide and 90 dots high. The guide says text that does not fit the block height is truncated.

Accents, symbols and the caret and tilde

Question How do I print accented letters, symbols and the ^ and ~ characters?

Field data can be any printable character except the two prefixes. For a character above 127, or for ^ and ~ themselves, put ^FH before the ^FD and write each such character as a hexadecimal value after an indicator. The default indicator is an underscore, and two hex characters must follow it.pp. 190, 193

The hex values come from the guide's ASCII chart: 5E is the caret and 7E is the tilde. Choose your character set first, though: the guide's chart of national sets shows a different character at 7E in sets 5 to 9 and 11, and at 5E in sets 5 and 8, so these escapes are only dependable with a set that keeps both characters, such as ^CI0 or ^CI13.pp. 159, 1579

Tip^FH takes one optional parameter, the indicator character, which can be anything except the format and control prefixes. If your data may contain an underscore, change the indicator.p. 193

^CI chooses the character set or encoding. It starts at 0 at power-up, values 0 to 12 are national variants of Zebra Code Page 850, 13 is Code Page 850 itself, 27 is Code Page 1252, and 28 to 30 select UTF-8 and the two UTF-16 byte orders. The Unicode values need firmware V60.14.x, V50.14.x or later. The font you select determines the shape of the printed symbol.pp. 156 to 158

The guide recommends putting a ^CI command (or a Unicode byte-order mark) at the start of each script, so scripts in different encodings can share one printer. Save your file in the same encoding you select.pp. 58, 158

WarningTo print a backslash you must select ^CI13.pp. 187, 190

The standard Zebra character set is Code 850 for values above 20 hexadecimal.p. 1581

example.zplZPL
^XA
^FO40,30^A0N,28,28^FH^FDCaret _5E and tilde _7E^FS
^XZ

^FH enables hex escapes in this field. With the power-up character set, _5E and _7E print the two prefix characters.

White on black and your own fonts

Question How do I print white text on a black box, or use a font I downloaded?

^FR reverses one field against whatever is under it, and must be repeated for each field. ^LR applies the same effect to every field that follows. The boxes guide draws the black areas.pp. 203, 295, 1752

A font stored in the printer can be called by its full name with ^A@, which takes a drive (R:, E:, B: or A:, default R:), a name and an extension of .FNT, .TTF or .TTE; .TTE needs firmware V60.14.x, V50.14.x or later.pp. 62, 63

Alternatively ^CW gives a downloaded font a one-character identifier. If you reuse a built-in font's character, the downloaded one replaces it until power is turned off.p. 168

The same label with BarcoderX

Question How does BarcoderX handle text?

BarcoderX is pre-launch and its API is not final. It is designed to let you describe the label once in .NET and emit ZPL or EPL. The published samples on the Developers page do not yet show text calls, so there is no code here. For fonts and accented characters in BarcoderX, see Fonts and accents.

Questions

Which command should I use for a wrapped paragraph?

The guide calls ^TB the preferred command for blocks of text, but it needs firmware V60.14.x, V50.14.x or later. ^FB works where ^TB is not available.pp. 186, 356

How do I print a caret or tilde in my text?

Use ^FH before ^FD and write the character as a hex escape, for example _5E for the caret.pp. 190, 193, 1579

Why is my text a different size than I asked for?

A bitmapped font only scales in whole multiples, so the printer rounds to the next size it recognizes. Font 0 is scalable.pp. 50, 60

Commands in this guide

BarcoderX is a .NET SDK for thermal labels and barcodes. See how it prints and exports labels.

Source Zebra, ZPL II, ZBI 2, Set-Get-Do, Mirror, WML Programming Guide, P1134473-11EN Rev A, 2026/07/05, pages 50, 58, 60 to 63, 154, 156 to 159, 168, 186, 187, 190, 193, 201 to 205, 207, 295, 356, 1579 to 1581, 1583, 1584, 1752.

Written by BarcoderX in its own words. Checked against the guide on 2026-11-14.

ZPL and ZPL II are trademarks of Zebra Technologies Corporation. This reference is written by BarcoderX in its own words from Zebra's published programming guide. BarcoderX is an independent product and is not affiliated with, endorsed by or sponsored by Zebra Technologies.