Commit Graph

17 Commits

Author SHA1 Message Date
Patrick Kanzler 87b33367c0
add magic coding comment 2018-05-16 02:02:35 +02:00
Patrick Kanzler 9b8e56cd59
cleanup imports, first part 2018-05-16 01:23:04 +02:00
Patrick Kanzler c0af9aaaf4
remove bad quotes 2018-05-16 01:09:48 +02:00
Romain Porte b648cfd67f First attempt at centering images and QRs (#250)
This was tested on ZJ-5890 with success. By default centering is
deactivated for backward compatibility. Trying to center a QR code in
native mode will raise an exception as we do not know ATM if the native
rendering is centered by default or not.

* Added basic tests for center feature

* Check image size before centering
2017-08-31 09:25:35 +02:00
Sergio Pulgarin 99034d0575 Fixed outdated example file: should be font 'b' not 'B'
Updated AUTHORS using script.
2017-08-31 08:38:32 +02:00
Patrick Kanzler 19663ec574 fix cut function in example 2017-08-10 21:54:52 +02:00
mrwunderbar666 b494c9a4bd Weather Forecast Example Script (#239)
* Example Weather forecast script

Used Adafruits example as base and adapted it for python-escpos
Weather icons taken from 
http://adamwhitcroft.com/climacons/

* Weather Icons from Adam Whitcroft

Weather Icons from http://adamwhitcroft.com/climacons/

* update authors

* Minor improvements

* Weather Script Debugged

Added one more Icon
Attributed Icons in readme.md
changed folder structure

* Change formatting

* Fixed pathing to graphics issue

* fixed image size

* autopep8 to clean up the code
2017-08-01 11:13:45 +02:00
Romain Porte c7080165a7 Added test script for hard and soft barcodes (#243) 2017-07-27 22:45:51 +02:00
Romain Porte 5bd6dcf471 Ensure QR codes have a border large enough (#235)
*  Ensure QR codes have a border large enough
(The QR code spec requires a border at least 4*box_size thick but we can't
 just set border=16 because that results in a QR code more than 255px tall
 and I'm not yet ready to use fullimage() as a backend for it)
This fix was originally commited by Stephan Sokolow on 2014-05-22
* Let the user print stuff using qr example
* fix tests
2017-07-24 15:04:54 +02:00
Romain Porte d348712439 PEP8 software barcode example 2017-05-22 20:25:51 +02:00
Romain Porte 737cc3176e First implementation of software barcode
Actually the hardware barcode implementation is very specific and not
generic enough for just adding a `soft_render=True` argument to it. This
is a first work that can be improved with other commits, maybe for
merging this method in the `barcode` method after some cleanup.

The width, height and text_distance were set using empiric
print-and-retry tests so that the generated barcode looks nice to the
eye (and to the eye of an Android scanner tool.

!WARNING! Printing a barcode that is too large in width will result in
the printer to go crazy trying to print an image that is too large for
it. This may be fixed by raising an exception in the `image` method.
2017-05-16 20:56:27 +02:00
Patrick Kanzler 1579f05cb7
use print function in example 2017-01-30 03:00:23 +01:00
Patrick Kanzler 972c7a2238
use explicit import from constants 2017-01-30 00:44:54 +01:00
Patrick Kanzler c2fc464c55
reformat PEP8 and similar issues 2017-01-30 00:10:14 +01:00
Patrick Kanzler 2ea8e69c66
style fixes 2017-01-29 23:39:26 +01:00
Patrick Kanzler e4a21e94fc
improve doc, improve codepage_tables.py 2017-01-29 23:36:33 +01:00
Michael Elsdörfer 94e1944d16 Add script to output codepage tables. 2016-10-05 12:14:51 +02:00