change text size

This commit is contained in:
robert 2024-01-31 22:21:12 +00:00
parent 4c073df6a8
commit e9960c0ef4

View File

@ -26,7 +26,7 @@ try:
# Drawing on the image
logging.info("Drawing")
font20 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 20)
font16 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 16)
font18 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 18)
# Drawing on the Horizontal image
@ -35,11 +35,11 @@ try:
HRYimage = Image.new('1', (epd.height, epd.width), 255) # 298*126 ryimage: red or yellow image
drawblack = ImageDraw.Draw(HBlackimage)
drawry = ImageDraw.Draw(HRYimage)
drawblack.text((2, 0), 'PV Production', font = font18, fill = 0)
drawblack.text((2, 20), 'Hausverbrauch', font = font18, fill = 0)
drawblack.text((2, 40), 'Strom Import', font = font18, fill = 0)
drawblack.text((2, 60), 'Batterie', font = font18, fill = 0)
drawblack.text((2, 80), 'Batterie Entladen', font = font18, fill = 0)
drawblack.text((2, 0), 'PV Production', font = font16, fill = 0)
drawblack.text((2, 20), 'Hausverbrauch', font = font16, fill = 0)
drawblack.text((2, 40), 'Strom Import', font = font16, fill = 0)
drawblack.text((2, 60), 'Batterie', font = font16, fill = 0)
drawblack.text((2, 80), 'Batterie Entladen', font = font16, fill = 0)
epd.display(epd.getbuffer(HBlackimage), epd.getbuffer(HRYimage))