Datasheet
also make use of the FONTSIZE parameter that we discussed earlier.
font = ImageFont.truetype('/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf', FONTSIZE)
Now we draw the text Hello World onto the center of the display. You may recognize the centering calculation was the
same one we used to center crop the image in the previous example. In this example though, we get the font size
values using the getsize() function of the font object.
text = "Hello World!"
(font_width, font_height) = font.getsize(text)
draw.text((display.width//2 - font_width//2, display.height//2 - font_height//2),
text, font=font, fill=TEXT_COLOR)
Finally, just like before, we display the image.
display.image(image)
display.display()
Now go to the command prompt on your Raspberry Pi and run the script with the following command:
python3 epd_pillow_demo.py
After a few seconds, your display should show this image:
© Adafruit Industries https://learn.adafruit.com/adafruit-eink-display-breakouts Page 53 of 61










