[修改] 修改LED标题显示

[详细说明]
    1. 使用系统字体ttf文件:DejaVuSans.ttf;
    2. 调整字体大小:12
This commit is contained in:
2023-07-02 22:48:51 +08:00
parent 1d4229f7c1
commit 21d0363765
2 changed files with 4 additions and 3 deletions

View File

@ -58,7 +58,9 @@ class OLED(object):
image = self.image
# Load default font.
font = ImageFont.load_default()
# font = ImageFont.load_default()
font_path = "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"
font = ImageFont.truetype(font_path, size)
# Write two lines of text.
draw.text((x, y), text, font=font, fill=255)