From 6ebdcd1cde234702eb8575351b7d540c08135041 Mon Sep 17 00:00:00 2001 From: Paul Mathieu Date: Thu, 15 Aug 2024 10:21:57 +0200 Subject: [PATCH] Fix text size? Not sure --- catclient.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/catclient.py b/catclient.py index cf50346..49ee081 100644 --- a/catclient.py +++ b/catclient.py @@ -11,14 +11,14 @@ import PIL.ImageFont import qrcode HERE = os.path.dirname(__file__) -font = PIL.ImageFont.truetype(os.path.join(HERE, 'inconsolata.ttf'), 20) +font = PIL.ImageFont.truetype(os.path.join(HERE, 'inconsolata.ttf'), 25) DEFAULT_SOCKET = '/tmp/catprint.s' def text2img(text): maxwidth=384 - height=21 + height=26 img = PIL.Image.new('1', (maxwidth, height)) d = PIL.ImageDraw.Draw(img) tw, th = d.textsize(text, font=font) @@ -47,7 +47,7 @@ def get_template0(qr_payload, line0, line1, line2=''): height = qrh textheight = 21 texttop = (height - 3 * textheight) / 3 - textleft = qrw + 20 + textleft = qrw + 10 img = PIL.Image.new('1', (width, height)) img.paste(qr) d = PIL.ImageDraw.Draw(img)