~DU - Download Unbounded TrueType Font
Downloads a TrueType font with a full, unrestricted character set.
~DU is ~DT without the 256-character limit. It is the command for a font with a
large glyph inventory, which means Chinese, Japanese and Korean. The catch is not
in the arguments but in what the font cannot work with. The guide states plainly
that ^FB does not support large TrueType fonts, so the printer cannot word-wrap a
CJK field.
Syntax
~DUd:o.x,s,dataSupport
Recognised as valid ZPL and not implemented yet, so it has no effect on the output.
The renderer does not parse this command yet. It serves CJK and other large character sets, so affected text defaults to a built-in font that can lack the glyphs. — not pinned by a test
Absent from Labelary's command table. Scheduled for milestone 5.9.
Parameters
d:o.xFont fileoptional · textWhere to store the font: device R:, E:, B: or A:, a name of up to eight characters, and the fixed extension .FNT.
- Default
- R:UNKNOWN.FNT
- Invalid value
- discarded, and the default applies
- Test coverage
- The invalid-value rule is not pinned by a test.
sFont sizerequired · integerSize of the converted font in bytes. The data must carry exactly this many two-digit hexadecimal values.
- Invalid value
- enough to make the whole command be ignored. The printer ignores the whole command when no data follows.
- Test coverage
- The invalid-value rule is not pinned by a test.
dataFont datarequired · hexadecimalThe font file, as ASCII hexadecimal.
- Invalid value
- enough to make the whole command be ignored
- Test coverage
- The invalid-value rule is not pinned by a test.
Behavior
~DU acts on receipt and belongs outside ^XA … ^XZ. It prints nothing. The
printer stores the font under the given path, in volatile memory by default. A
power cycle then needs the font again, unless it went to flash or a card. These
payloads are the largest in ZPL, and the guide's example is an 86,753-byte Kanji
font. The memory to hold one is a real constraint on a small printer.
The size counts bytes, and the payload is two hexadecimal digits per byte. The guide ignores the whole command where no data follows.
A large font usually needs a companion ~DE encoding table, unless the field data
is UTF-8 and ^CI28 is in force. After storage, ^CW or ^A@ reaches the font
like any other download.
The renderer does not parse the command, so a field that names the font defaults to a built-in one. A built-in Zebra font has no CJK glyphs, so the text does not merely change typeface: it disappears.
Differences from the specification
Labelary against the ZPL II guide
Where Labelary — our compatibility target — behaves differently from the printed specification.
- Labelary's command table does not list
~DU. — not pinned by a test
Example
The download, then a field asking for the font:
~DUR:KANJI,86753,60CA017B0CE7
^XA
^CI28
^FO50,50^A@N,40,40,R:KANJI.FNT^FDDownloaded font, or a fallback^FS
^XZ
Related commands
~DTDownload TrueType FontDownloads a TrueType font.~DYDownload ObjectsDownloads a font or image in a native file format such as PNG, TrueType or GRF.^CIChange International Font / EncodingSelects the character encoding of the field data.^A@Use Font Name to Call FontSelects a downloaded or built-in font by file name rather than by letter.