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§
- Print
Mode - 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
boolflags. - Print
Mode Builder - Builder for
PrintMode. - Print
Settings - Defines the printer’s heat settings.
- Print
Settings Builder - Builder for
PrintSettings. - Printer
- A representation of the thermal printer. Implements the
core::fmt::Writetrait for printing normal text.
Enums§
- BarCode
Special Character - These are special characters described in the printer documentation.
- BarCode
System - Defines the barcode system to be used.
- Barcode
Width - See the table below for barcode width options depending on the barcode type.
The default is
Width3. - Character
Set - Determines the used international character set. Default:
USA. - Code
Table - 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.
- Print
Mode Builder Error - Error type for PrintModeBuilder
- Print
Settings Builder Error - Error type for PrintSettingsBuilder
- Raster
BitImage Mode - 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
RawBmpis compared against. Pixels below this value get printed as a dot, pixels above not.