~DB - Download Bitmap Font
Downloads a Zebra bitmapped font.
~DB sends a bitmapped font to the printer glyph by glyph. The command header
gives the font's cell metrics, and the data that follows is one hand-drawn bitmap
per character. It is the oldest of the font download commands and the only one
with a legible payload. Nothing writes it any more: a .TTF with ~DU covers the
same ground without a bitmap per size.
Syntax
~DBd:o.x,a,h,w,base,space,#char,©,dataSupport
Recognised as valid ZPL and not implemented, with no plan to.
Labelary does not support it either, so no compatibility target exists. Fields with the downloaded font default to a built-in font. — not pinned by a test
Labelary does not implement it either, so there is no parity reference.
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.
aOrientation of the native fontoptional · one of a setOrientation the glyph bitmaps use. Fixed at normal.
- Default
- N
- Invalid value
- discarded, and the default applies. The guide fixes this to normal, and Labelary's reference calls the argument ignored.
- Test coverage
- No documented value is exercised by a test (N). The invalid-value rule is not pinned by a test.
N- Normal, the only value the guide accepts (default)
hMaximum cell heightrequired · dotsHeight of the tallest character cell in the font.
- Accepted range
- 1 to 32000 dots
- Invalid value
- enough to make the whole command be ignored
- Test coverage
- No test at the minimum, maximum or one step outside the range. The invalid-value rule is not pinned by a test.
wMaximum cell widthrequired · dotsWidth of the widest character cell in the font.
- Accepted range
- 1 to 32000 dots
- Invalid value
- enough to make the whole command be ignored
- Test coverage
- No test at the minimum, maximum or one step outside the range. The invalid-value rule is not pinned by a test.
baseBaselinerequired · dotsDot rows from the top of the cell down to the character baseline.
- Accepted range
- 1 to 32000 dots
- Invalid value
- enough to make the whole command be ignored
- Test coverage
- No test at the minimum, maximum or one step outside the range. The invalid-value rule is not pinned by a test.
spaceSpace character widthrequired · dotsWidth used for the space character and for any character the font does not define.
- Accepted range
- 1 to 32000 dots
- Invalid value
- enough to make the whole command be ignored
- Test coverage
- No test at the minimum, maximum or one step outside the range. The invalid-value rule is not pinned by a test.
#charCharacter countrequired · integerNumber of characters the font defines.
- Accepted range
- 1 to 256
- Invalid value
- enough to make the whole command be ignored. The count must match the number of character definitions that follow.
- Test coverage
- No test at the minimum, maximum or one step outside the range. The invalid-value rule is not pinned by a test.
©Copyrightrequired · textCopyright holder recorded with the font, up to 63 characters.
- Invalid value
- not possible — any value is accepted
- Test coverage
dataFont datarequired · textOne #xxxx.h.w.x.y.i.data block per character: character code, bitmap height and width, x and y offset, typesetting displacement, and the bitmap as hexadecimal.
- Invalid value
- enough to make the whole command be ignored
- Test coverage
- The invalid-value rule is not pinned by a test.
Behavior
~DB acts the moment the printer reads it, and belongs outside ^XA … ^XZ. It
prints nothing. The printer stores the font under the given path, and keeps it
until an overwrite or a clear of that memory.
Each glyph in the data is a #xxxx.h.w.x.y.i.data block. It holds the character
code, the bitmap's own height and width, its offset within the cell, the advance to
the next character, and the bitmap itself as hexadecimal. The character code takes up to
four digits, so a font can define positions beyond one byte. The count in #char
must agree with the number of blocks. The header h and w are the largest cell
any glyph uses, and base fixes where the baseline sits inside it.
After the download, ^CW reaches the font and binds it to a letter that ^A and
^CF can name, or ^A@ reaches it directly. A printer magnifies a bitmapped font
in whole multiples of its cell only, so a font downloaded at one size does not
scale smoothly to another.
The renderer never stores the font, so a field that names it defaults to a built-in font, and its metrics and line breaks do not match the intended typeface.
Differences from the specification
Labelary against the ZPL II guide
Where Labelary — our compatibility target — behaves differently from the printed specification.
- Labelary's table marks
~DBunsupported. — not pinned by a test
Example
A font of one glyph, then a field that asks for it:
~DBR:SMALL.FNT,N,10,8,7,8,1,ACME,#0041.10.8.0.0.9.00FF00FF00FF00FF00FF
^XA
^FO50,50^A@N,40,40,R:SMALL.FNT^FDAAA^FS
^XZ
Related commands
~DSDownload Scalable FontDownloads a scalable Zebra font.~DTDownload TrueType FontDownloads a TrueType font.~DUDownload Unbounded TrueType FontDownloads a TrueType font with a full, unrestricted character set.^CWFont IdentifierAssigns a downloaded font to one of the single-letter font slots.