2 font download methods – Microcom 322M User Manual

Page 70

Advertising
background image

Downloadable Fonts

Chapter 8

66

322M Operator’s Manual

8.2

Font Download Methods

The printer supports both compressed and uncompressed graphic and font downloads. The
compressed (^D107) format shortens the download time by reducing the number of bytes
sent to the printer. Please note that the compressed format is only usable on 8-bit data
connections and will not function on 7-bit data connections. The uncompressed (^D104) is
usable on either 7 or 8-bit connections and is more flexible but encodes using ASCII-HEX.
This results in a much larger file size. Microcom Corporation recommends the use of the
compressed format when possible.

8.2.1

Compressed Binary Image (^D107)

This command allows graphic images or fonts (fonts must be less than 64KB
uncompressed) to be transmitted in binary, thereby reducing the number of bytes sent to the
printer. Furthermore, this command allows for data compression by converting strings of 0
HEX or FF HEX to shorter byte-plus-count sequences. These sequences are then
expanded to the original number of bytes inside the printer. This command is only useable
on data connections that support 8-bit data such as a serial port configured for 8 Data Bits
and no parity or a parallel port. This command will not function correctly with a serial port
configured to 7-bit data bits.

The following is the format of the ^D107 command when used with a graphic image file.

^A<Memory Slot Number>^D107<CR>
<Rotation> <Count> <Image Data>

Where:
<Memory Slot Number> is the memory slot location (1-255) where the graphic will be saved
in the printer’s memory. The printer uses the same TCI of “8” to select downloadable fonts
or graphics. Therefore a font and a graphic cannot have the same Slot Number or CGN
number.

<Rotation> is an 8-bit integer, 0 for an upright font and 1 for a 90-degree rotated image.

<Count> is a 32-bit integer, least significant byte first. This is the number of uncompressed
bytes that the image uses, not the number of bytes that will actually be transmitted. Due to
compression, the number of bytes transmitted will normally be less than this number.

<Image Data> is the compressed binary image.

Compressed Algorithm
The binary data that makes up the image file is a run-length compressed version of the
image data described in section 7.2. Bytes with a value of 0 HEX of FF HEX are followed
by another byte indicating the number of times that value is repeated.

For example: Suppose the original (uncompressed) image file has a sequence of bytes like:
(All values are listed in Hexadecimal)

“00 01 02 03 04 00 00 00 00 00 00 FF FD FF FF FF FF FF 00 FF”

Advertising