Compare commits
No commits in common. "paul/tweaks" and "main" have entirely different histories.
paul/tweak
...
main
@ -11,14 +11,14 @@ import PIL.ImageFont
|
||||
import qrcode
|
||||
|
||||
HERE = os.path.dirname(__file__)
|
||||
font = PIL.ImageFont.truetype(os.path.join(HERE, 'inconsolata.ttf'), 25)
|
||||
font = PIL.ImageFont.truetype(os.path.join(HERE, 'inconsolata.ttf'), 20)
|
||||
|
||||
DEFAULT_SOCKET = '/tmp/catprint.s'
|
||||
|
||||
|
||||
def text2img(text):
|
||||
maxwidth=384
|
||||
height=26
|
||||
height=21
|
||||
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 + 10
|
||||
textleft = qrw + 20
|
||||
img = PIL.Image.new('1', (width, height))
|
||||
img.paste(qr)
|
||||
d = PIL.ImageDraw.Draw(img)
|
||||
|
Loading…
Reference in New Issue
Block a user