zpl.tools
Memory and storage

^CO - Cache On

Turns the scalable-font glyph cache on or off and sizes it.

^CO resizes the character cache, the block of DRAM that holds built scalable glyphs. It controls print speed and nothing else: a larger cache makes a label print faster, and never makes it look different. On firmware x.12 and later the printer grows the cache by itself, so the guide says the command is not needed.

Syntax

^COa,b,c

Support

Recognised, deliberately skippedparsed: none · state: none · rendered: none

Accepted and skipped, because it configures the printer rather than the label. It cannot change the rendered output, and Labelary skips it too.

The renderer recognizes this command and ignores it. The glyph cache only makes repeated use of the same scalable glyph faster, and is invisible in the output. An off cache changes print time, not pixels. We measured this on 2026-07-30. On Labelary, ^CON and ^COY,9999,1 both render a label pixel-identical to the same format with no ^CO at all. The renderer does not parse this command. It reports IGNORED_COMMAND at info severity, which does not reach X-Warnings. Labelary is also silent, so the rendered label is identical in both engines. — not pinned by a test

Labelary renders this command.

Parameters

aCache enabledoptional · Y or N

Whether the printer uses the glyph cache.

Default
Y
Invalid value
discarded, and the default applies
Test coverage
No documented value is exercised by a test (Y, N). The invalid-value rule is not pinned by a test.
Y
Cache on (default)
N
Cache off
bExtra cache sizeoptional · integer

Additional memory to give the cache, on top of the printer's built-in allocation.

Default
40
Accepted range
1 to 9999 KB
Invalid value
not documented, and we have not measured it. The guide's accepted value is "any size up to total memory available", and does not say what a larger size does. Labelary's reference is the source of the 1 to 9999 bounds. The renderer does not parse the command.
Test coverage
No test at the minimum, maximum or one step outside the range.
cCache typeoptional · one of a set

Which of the printer's two caches this command configures.

Default
0
Invalid value
not documented, and we have not measured it. The guide gives the default as 0, and does not say what any value except 0 or 1 does. The renderer does not parse the command.
Test coverage
No documented value is exercised by a test (0, 1).
0
External cache, used for regular scalable fonts (default)
1
Internal cache, used for Asian fonts

Behavior

A bitmapped font is already a bitmap and goes straight to the label. A scalable glyph — ^A0, or a TrueType face recalled with ^A@ — needs a build at the requested size and rotation first. The same character at a second size is a second build. The cache keys each built glyph by character, size and rotation, and a repeat is a lookup. A full cache evicts the glyphs it uses least.

Two limits matter. The built-in cache holds a single character up to 450 by 450 dots. The largest character any cache holds is 1500 by 1500 dots, which needs 274K. When the cache is too small for the style in use, the guide's symptom is unusual. The smaller characters still appear, and the larger ones do not.

^CO adds a separate block, and does not extend the built-in cache. ^COY,78 on top of a 22K cache gives 100K in two pieces of 22K and 78K. A glyph that needs 90K contiguous bytes fits in neither. Ask for the full size in one call rather than build up to it.

The guide contradicts itself on the built-in size. Its description gives every printer a 40K cache that is always on, and its worked examples on the same page assume 22K. Treat the starting figure as approximate, and size b from the largest glyph.

A resize discards everything in the cache, and takes its memory from the same pool as label bitmaps, graphics and downloaded fonts. A cache that is too large also costs time, because the printer searches for every glyph before it builds it. Asian fonts are the case for c set to 1. They need a working buffer much larger than the normal cache, and that buffer reduces the memory left for everything else.

The renderer does not parse this command. It reports IGNORED_COMMAND at info severity, which does not reach X-Warnings. Labelary is also silent, so the rendered label is identical in both engines. ^CON and ^COY,9999,1 each render a label pixel-identical to the same format with no ^CO in it (measured against Labelary 2026-07-30).

Differences from the specification

Labelary against the ZPL II guide

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

  • Labelary limits the extra cache size to 1 to 9999 KB. The guide gives no numeric maximum, only "any size up to total memory available", so the upper limit is Labelary's own. — not pinned by a test

Example

A cache sized for large glyphs before two lines of the same 90-dot scalable text, the second of which is the cache hit:

^XA
^COY,300,1
^FO40,40^A0N,90,90^FDCached glyphs^FS
^FO40,150^A0N,90,90^FDCached glyphs^FS
^XZ

Open in viewer