zpl.tools
Fonts and text

^A - Scalable / Bitmapped Font

Selects the font, rotation and size for the following field.

^A chooses the font, the rotation and the character size for one field. The scope is that single field: after ^FS the format defaults to the font set by ^CF, so a second line of text needs its own ^A. Only font 0 is scalable. Fonts A to H are bitmaps, and a printer magnifies them in whole multiples of their cell and no other way.

Syntax

^Afo,h,w

Support

Partially supportedparsed: full · state: full · rendered: partial

The command renders, with the caveat below.

The renderer honors every font slot, rotation and size, and the character cells match Labelary's. But slots D and H draw in the font 0 typeface rather than a monospaced face and OCR-A. So letter shapes and text widths differ, which can change where a line wraps or clips. A height below 10 dots also scales literally here, where Labelary floors it at 10. The typeface gap is an asset-licensing matter for the font-matching work, not a parser defect. — not pinned by a test

Labelary renders this command.

Parameters

fFont nameoptional · one of a set

Which font to use. Only font 0 is truly scalable; the bitmapped fonts scale in whole multiples of their base size.

Default
the font set by ^CF, or A
Invalid value
discarded, and the default applies. The renderer reports ARGUMENT_INVALID for an unrecognized letter, and names the font. The field falls back to the ^CF font, or to font A when no ^CF appeared, and still draws: we measured on 2026-08-21 that ^CF0,50,50 followed by ^AMN,50,50 draws font 0, so the fallback is the current default rather than the previously active font.
Test coverage
Values exercised: 0, A, B, C, D, E, F, G, H, P–V, N. Not exercised: GS, I–O, W–Z, 1–9. The invalid-value rule is pinned by 5 tests, including the diagnostic it emits.
0
Scalable CG Triumvirate Bold Condensed, the only font whose height and width are freely scalable
A
Bitmapped, 9 × 5 dots, upper and lower case (default)
B
Bitmapped, 11 × 7 dots, upper case only
C
Bitmapped, 18 × 10 dots, upper and lower case
D
Bitmapped, 18 × 10 dots, upper and lower case
E
Bitmapped, 28 × 15 dots, OCR-B
F
Bitmapped, 26 × 13 dots, upper and lower case
G
Bitmapped, 60 × 40 dots, upper and lower case
H
Bitmapped, 21 × 13 dots, OCR-A
GS
Symbol font, 24 × 24 dots
P–V
Bitmapped fonts from 20 × 18 to 80 × 71 dots, present on some printer models
N
Labelary's standard font, an extension rather than a Zebra font
I–O, W–Z, 1–9
The guide accepts this letter, but no built-in font uses it; ^CW must assign a downloaded font first
oOrientationoptional · one of a set

Rotation of the text. Written immediately after the font letter with no delimiter, as in ^A0N.

Default
the orientation set by ^FW, or N
Invalid value
discarded, and the default applies
Test coverage
Values exercised: N, R, I, B. The invalid-value rule is pinned by 1 test.
N
Normal (default)
R
Rotated 90° clockwise
I
Inverted 180°
B
Read from bottom up, 270°
hCharacter heightoptional · dots

Height of the character cell in dots. Only font 0 takes any value; a bitmapped font magnifies in whole multiples of its base height.

Default
the height set by ^CF, or the font's own base height
Accepted range
10 to 32000 dots
Invalid value
discarded, and the default applies. For a bitmapped font the renderer rounds the height to the nearest multiple of the base height. ^ADN,35 and ^ADN,36 both print at twice the base 18 dots.
Test coverage
Bounds pinned: below the minimum (0), past what the shape can hold (99999999999999999999). No test at the minimum or maximum. The invalid-value rule is not pinned by a test.
wCharacter widthoptional · dots

Width of the character cell in dots.

Default
the width set by ^CF, or a width proportional to the height
Accepted range
10 to 32000 dots
Invalid value
discarded, and the default applies. For a bitmapped font the renderer rounds the width to the nearest multiple of the base width, independently of the height.
Test coverage
Bounds pinned: above the maximum (32001). No test at the minimum or maximum. The invalid-value rule is not pinned by a test.

Behavior

The font letter and the orientation run together with no separator — ^A0N, ^ADR — because f is a single character. Everything after that is comma-delimited, and both are optional: ^A,40 keeps the current default font and sets the height only.

Bitmapped font size

The renderer draws a bitmapped font at a whole multiple of its cell only. It rounds the height to the nearest multiple of the font's base height, and the width to the nearest multiple of its base width, independently. Font D has an 18 by 10 cell, so ^ADN,35 and ^ADN,36 print at the same size, and ^ADN,36,20 doubles both axes. The guide limits the magnification to ten times the base size, so font A at 300 dots does not give 300 dots of text.

Font 0 takes the height directly. Scalable fonts use points, and the guide gives the conversion as dots = points × dpi / 72, so 12 pt on a 203 dpi printer is 34 dots. Its baseline sits three quarters of the way down the cell at every size.

Where the text lands

^FO places the top-left corner of the character cell, so the text hangs below the coordinate. ^FT places the baseline instead, so the text sits above it and fields of different sizes line up on one row.

The renderer never shrinks text to fit and never wraps it. It draws a field wider than the label up to the edge and drops the rest, which is a common cause of a truncated address line. Use ^FB where the text must wrap.

Interaction with ^CF

^CF supplies the default for anything ^A leaves out, and the guide warns about the trap. Where ^CF sets a size, an ^A that names a new font but no height and width inherits those dots, and the printer magnifies the new font to them. ^CFD,26,10 and then a bare ^AA prints font A three times its normal size rather than at its base 9 by 5. Name a size with every font change after a ^CF.

The renderer reports an unrecognized font letter as invalid, and uses the previous or default font, so the field still prints.

Tested behavior

Differences from the specification

Labelary against the ZPL II guide

Where Labelary — our compatibility target — behaves differently from the printed specification.

  • Labelary adds a font N of its own, which no Zebra printer has. — not pinned by a test
  • Labelary's reference gives the height and width range as 1 to 32000, not the guide's 10 to 32000. We measured that a height below 10 renders the same as 10, so the guide's floor holds. — not pinned by a test
  • Labelary stops magnifying a bitmapped font at ten times its character cell, well short of the guide's 32000 dots. We measured that ^AB,114, ^AB,240 and ^AB,900 all print at 110 dots. — not pinned by a test
  • Labelary draws fonts P to V at an em smaller than the guide's character cell, and three of the seven are not whole dots. We measured P 16.2, Q 23, R 30, S 33.8, T 40.8, U 50.2 and V 67.5 dots. — not pinned by a test
  • Labelary steps the height and width of fonts P to V apart from each other, where a bitmapped font A to H keeps its aspect. We measured that ^ARN,60 prints twice as tall as ^ARN at the same width. — not pinned by a test

zpl.tools against the ZPL II guide

Where our renderer behaves differently from the specification.

  • The renderer accepts font N so that labels written against Labelary render the same way. — pinned by test_font_n_sizing
  • When ^A supplies only a height or only a width, the renderer derives the other proportionally, and does not take it from the last ^CF. We measured that after ^CF0,26,10, ^A0N,40 prints at 40 dots wide-proportional here, and at 40 by 10 on a printer and on Labelary. — pinned by test_font_0_scaling_width_only

zpl.tools against Labelary

Where our output differs from Labelary for the same input. These are the differences that break a migration.

  • We measured that ^AD and ^AH draw in the font 0 face rather than a monospaced one and OCR-A. So the cell sizes match Labelary, but the letter shapes and text widths do not. — not pinned by a test

Example

Three fonts at three sizes, and a fourth field left to the default:

^XA
^FO50,40^A0N,40^FDScalable font 0^FS
^FO50,100^ADN,36,20^FDBitmapped D at 2x^FS
^FO50,160^AHN,42,26^FDOCR-A 12345^FS
^FO50,220^FDNo font command: font A^FS
^XZ

Open in viewer