^CF - Change Alphanumeric Default Font
Sets the font and size used by fields that do not specify their own.
^CF sets the font and character size that every following text field uses where
the field carries no ^A of its own. It is the opposite of ^A in scope. ^A
lasts for one field, and ^CF lasts until the next ^CF, and past ^XZ into the
next label in the same data stream.
Syntax
^CFf,h,wSupport
Every documented parameter renders the same output Labelary produces.
Labelary renders this command.
Parameters
fDefault fontoptional · one of a setFont used by any following field that omits its own ^A.
- Default
- A
- Invalid value
- discarded, and the default applies. An unrecognized letter leaves the default font unchanged, and reports
ARGUMENT_INVALID. - Test coverage
- Values exercised: A. Not exercised: 0, B–H, GS, P–V, I–O, W–Z, 1–9. The invalid-value rule is pinned by 3 tests, including the diagnostic it emits.
0- Scalable CG Triumvirate Bold Condensed
A- Bitmapped, 9 × 5 dots, the value at power-up (default)
B–H- The other built-in bitmapped fonts
GS- Symbol font
P–V- Bitmapped fonts present on some printer models
I–O, W–Z, 1–9- The guide accepts this letter, but no built-in font uses it;
^CWmust assign a downloaded font first
hCharacter heightoptional · dotsDefault character height in dots. Zero, or an omitted value, lets the font's own matrix decide.
- Default
- 9, the base height of font A
- Accepted range
- 0 to 32000 dots
- Invalid value
- discarded, and the default applies
- Test coverage
- Bounds pinned: minimum (0), past what the shape can hold (99999999999999999999). No test at the maximum. The invalid-value rule is not pinned by a test.
wCharacter widthoptional · dotsDefault character width in dots. One value alone makes the other magnify proportionally.
- Default
- 5, the base width of font A
- Accepted range
- 0 to 32000 dots
- Invalid value
- discarded, and the default applies
- Test coverage
- No test at the minimum, maximum or one step outside the range. The invalid-value rule is not pinned by a test.
Behavior
The three arguments are independent defaults: f for the font, h and w for
the size. A field that names neither font nor size takes all three. A field with
its own ^A overrides them for that field only, and the ^CF settings return at
the next field.
One size alone makes the other magnify proportionally. The guide is explicit that "defining only the height or width forces the magnification to be proportional to the parameter defined". A zero, or an omitted value, returns the decision to the font's own matrix.
Watch the interaction with a later ^A. The ^CF height and width are not tied
to the font it names. They stay in force when a field switches font without a
size, and the printer magnifies the new font to those dots. After ^CFD,26,10, a
bare ^AA prints font A at roughly three times its base size. The guide calls
this a defect in the format rather than in the printer: "any ^A commands that
follow must have the height and width parameter filled in".
The renderer reports an unrecognized font letter as invalid, and keeps the previous default font, so text still prints.
Tested behavior
Differences from the specification
zpl.tools against the ZPL II guide
Where our renderer behaves differently from the specification.
- A later
^Athat names a size for one axis only loses the^CFvalue for the other axis, and scales that axis proportionally. The^CFpair applies only to a field that names no size. — not pinned by a test
Example
One ^CF for the whole label, overridden for a single field:
^XA
^CF0,40
^FO50,40^FDDefault font^FS
^FO50,100^FDStill the default^FS
^FO50,160^ADN,36,20^FDThis field only^FS
^FO50,220^FDBack to the default^FS
^XZ
Related commands
^AScalable / Bitmapped FontSelects the font, rotation and size for the following field.^A@Use Font Name to Call FontSelects a downloaded or built-in font by file name rather than by letter.^GSGraphic SymbolPrints one of the built-in legal symbols, selected by the following `^FD`.^FDField DataSupplies the text or barcode content of the field.