From 19179449669d649e8df5040cf57f179635fecc83 Mon Sep 17 00:00:00 2001 From: Christoffer Viken Date: Tue, 21 Mar 2017 22:27:37 +0000 Subject: [PATCH] Ok, new try to get it working WTF debian --- barcode_helpers.py | 9 ++++----- printer_helpers.py | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/barcode_helpers.py b/barcode_helpers.py index 27c2bf5..35785c0 100644 --- a/barcode_helpers.py +++ b/barcode_helpers.py @@ -11,6 +11,7 @@ class BrotherLabelWriter(ImageWriter): def __init__(self, typ='62', max_height=350, rot=False, text=None): super(BrotherLabelWriter, self).__init__() assert typ in label_type_specs + self.rot = rot if self.rot: self._h, self._w = label_type_specs[typ]['dots_printable'] if self._w == 0 or self._w > max_height: @@ -44,21 +45,19 @@ class BrotherLabelWriter(ImageWriter): super(BrotherLabelWriter, self)._paint_text(xpos+self._xo, ypos+self._yo) def _finish(self): - if self.rot: - self._image.rotate(90) if self._title: width = self._w+1 height = 0 max_h = self._h - mm2px(self._yo, self.dpi) fs = int(max_h / 1.2) - font = ImageFont.truetype("arial.ttf", 10) + font = ImageFont.truetype("./arial.ttf", 10) while width > self._w or height > max_h: - font = ImageFont.truetype("Stranger back in the Night.ttf", fs) + font = ImageFont.truetype("./Stranger back in the Night.ttf", fs) width, height = font.getsize(self._title) fs -= 1 pos = ( (self._w-width)//2, - mm2px(0, self.dpi) + 0 - (height // 8) ) self._draw.text(pos, self._title, font=font, fill=self.foreground) return self._image diff --git a/printer_helpers.py b/printer_helpers.py index 7e3011a..1457cab 100644 --- a/printer_helpers.py +++ b/printer_helpers.py @@ -13,7 +13,7 @@ def print_bar_code(barcode_value, barcode_text, barcode_type="ean13", rotate=Fal test = bar_coder(barcode_value, writer=wr) fn = test.save(barcode_value) - print_image(fn, printer_type, label_type) + #print_image(fn, printer_type, label_type) def print_image(fn, printer_type="QL-700", label_type="62"):