Crate thermal_print

Crate thermal_print 

Source
Expand description

Support for the CSN-A2 thermal printer via embedded_hal. This crate also supports bitmap printing via tinybmp.

§Usage

Create a new Printer on a serial port on your platform and write text via the implemented core::fmt::Write trait. You can use the write! and writeln! macros to accomplish this.

See the Printer struct documentation for advanced capabilities, such as printing barcodes and bitmaps.

Structs§

PrintMode
Configures print options such as the font used, white-on-black, upside-down or bold printing, as well as double-width, double-height and strikethrough modes via individual bool flags.
PrintModeBuilder
Builder for PrintMode.
PrintSettings
Defines the printer’s heat settings.
PrintSettingsBuilder
Builder for PrintSettings.
Printer
A representation of the thermal printer. Implements the core::fmt::Write trait for printing normal text.

Enums§

BarCodeSpecialCharacter
These are special characters described in the printer documentation.
BarCodeSystem
Defines the barcode system to be used.
BarcodeWidth
See the table below for barcode width options depending on the barcode type. The default is Width3.
CharacterSet
Determines the used international character set. Default: USA.
CodeTable
Determines the used code page. Default: CP437.
Font
Specifies the used internal printer font. User-defined fonts are currently not supported by this driver.
Justification
Determines whether text is aligned left, center, or right.
PrintModeBuilderError
Error type for PrintModeBuilder
PrintSettingsBuilderError
Error type for PrintSettingsBuilder
RasterBitImageMode
Defines the raster bit-image mode.
Underline
Sets no, normal, or thick underlining.

Constants§

PIXEL_COLOR_CUTOFF
Determines a cutoff value each pixel in a RawBmp is compared against. Pixels below this value get printed as a dot, pixels above not.