code cleanups

This commit is contained in:
Ace 2020-12-05 00:18:14 +01:00
parent 9d3823876e
commit 598d2b2614
2 changed files with 13 additions and 11 deletions

View File

@ -185,8 +185,10 @@ def write(image, xy, box_size, text, font=None, **kwargs):
draw = ImageDraw.Draw(image) draw = ImageDraw.Draw(image)
space = Image.new('RGBA', (box_width, box_height)) space = Image.new('RGBA', (box_width, box_height))
ImageDraw.Draw(space).text((x, y), text, fill=colour, font=font) ImageDraw.Draw(space).text((x, y), text, fill=colour, font=font)
# Uncomment following two lines, comment out above two lines to show # Uncomment following two lines, comment out above two lines to show
# red text-box with white text (debugging purposes) # red text-box with white text (debugging purposes)
#space = Image.new('RGBA', (box_width, box_height), color= 'red') #space = Image.new('RGBA', (box_width, box_height), color= 'red')
#ImageDraw.Draw(space).text((x, y), text, fill='white', font=font) #ImageDraw.Draw(space).text((x, y), text, fill='white', font=font)