Release date: `2024-12-17`
Bug Fixes
- Reworked images printing to, hopefully, fix all issues.
- Fixed printed lines counting in {meth}`ThermalPrinter.out()`.
Features
- Support for QR701 printers is confirmed ({issue}`15`).
- New extra: `calendar`, to print daily stuff from your calendar, and birthdays as a bonus! See {ref}`recipes <calendar>`.
- New extra: `persian`, to make your life easier when printing Persian text, see {ref}`recipes <persian-text>`.
- New extra: `weather`, to print the weather alongside with the saint of the day! See {ref}`recipes <weather>`.
- New text styles: {meth}`ThermalPrinter.font_b()`, and {meth}`ThermalPrinter.left_blank()`.
- New options to tweak printer behaviors: `byte_time`, `dot_feed_time`, `dot_print_time`, `read_timeout`, and `write_timeout`. See {class}`ThermalPrinter`.
- New option to control printer settings at initialization to {class}`ThermalPrinter`: `run_setup_cmd=bool` ({issue}`15`).
- It is now possible to pass barcode styling instructions in {meth}`ThermalPrinter.barcode()`, in the same way it's done for {meth}`ThermalPrinter.out()`.
- Introduced statistics persisted at exit. This behavior can be disabled by passing `use_stats=False` to {class}`ThermalPrinter`.
- Enhanced the demonstration code.
- Rewrote the entire documentation to cover all possible stuff, and it is way prettier now, (thanks to the awesome [Shibuya theme](https://shibuya.lepture.com)).
- Improved the documentation by fixing issues found with [Harper](https://github.com/elijah-potter/harper).
- 100% tests coverage!
- Added lot of logs.
Technical Changes
- Added the {const}`constants.Justify` constant to use in the {meth}`ThermalPrinter.justify()` method (**breaking change**).
- Added the {const}`constants.Size` constant to use in the {meth}`ThermalPrinter.size()` method (**breaking change**).
- Added the {const}`constants.Underline` constant to use in the {meth}`ThermalPrinter.underline()` method (**breaking change**).
- Added the {const}`constants.Defaults` constant. And they can be tweaked via `TP_*` environment variables.
- Added the {meth}`ThermalPrinter.__exit__()` method to properly close the printer when leaving the context manager.
- Added the {meth}`ThermalPrinter.has_paper` property.
- Added the {meth}`ThermalPrinter.close()` method.
- Added the {meth}`ThermalPrinter.demo()` method.
- Added the {meth}`ThermalPrinter.font_b()` method.
- Added the {meth}`ThermalPrinter.image_chunks()` method.
- Added the {meth}`ThermalPrinter.image_convert()` method.
- Added the {meth}`ThermalPrinter.image_resize()` method.
- Added the {meth}`ThermalPrinter.init()` method.
- Added the {meth}`ThermalPrinter.left_blank()` method.
- Added the {meth}`ThermalPrinter.status_to_dict()` method.
- Added the {func}`tools.stats_file()` function.
- Added the {func}`tools.stats_load()` function.
- Added the {func}`tools.stats_save()` function.
- Moved the {func}`tools.printer_tests()` function to the {meth}`ThermalPrinter.demo()` method (**breaking change**).
- Moved the {func}`tools.print_char()` function to the {meth}`ThermalPrinter.print_char()` method (**breaking change**).
- Moved the {func}`validate.validate_barcode()` function to the {meth}`ThermalPrinter.validate_barcode()` method.
- Removed the {file}`validate.py` file, and most `validate_*()` functions.
- Removed the {obj}`exceptions.ThermalPrinterConstantError` class.