From b767a4c73ea705b2b34df32ac4497345c7b8c6ee Mon Sep 17 00:00:00 2001 From: "Tony M.Jenkins" Date: Tue, 23 Apr 2024 10:32:47 +0200 Subject: [PATCH 1/2] Update writer.py Added human text option to ImageWriter --- barcode/writer.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/barcode/writer.py b/barcode/writer.py index b3d32fd..77c5c8d 100755 --- a/barcode/writer.py +++ b/barcode/writer.py @@ -465,11 +465,16 @@ def _paint_module(self, xpos: float, ypos: float, width: float, color): def _paint_text(self, xpos, ypos): assert ImageFont is not None + + # check option to override self.text with self.human (barcode as + # human readable data, can be used to print own formats) + barcodetext = self.human if self.human != "" else self.text + font_size = int(mm2px(pt2mm(self.font_size), self.dpi)) if font_size <= 0: return font = ImageFont.truetype(self.font_path, font_size) - for subtext in self.text.split("\n"): + for subtext in barcodetext.split("\n"): pos = ( mm2px(xpos, self.dpi), mm2px(ypos, self.dpi), From 389dc5fac558c89f189cef850febf56209f72b9d Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Fri, 20 Sep 2024 11:02:00 +0200 Subject: [PATCH 2/2] Configure tox to use system Python This makes it usable by contributors by default. CI pipelines explicitly override the version of Python used. --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 3d1f037..632f990 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = {py38,py39,py310,py311}{,-images} +envlist = py,py-images skip_missing_interpreters = True [testenv]