nanocode93
Posts: 1
Joined: Sat Jul 28, 2018 10:57 am

Waveshare E-paper - ImageFont Error

Sat Jul 28, 2018 11:05 am

Hello,

I have been following the tutorial https://www.waveshare.com/wiki/7.5inch_ ... spberry_Pi to get started with the Waveshare 7.5inch E-paper display.

Hardware: RaspberryPiZeroW
OS: Raspbian Stretch (Headless)
Python Version: Python 2.7.13

I have followed the tutorial step-by-step but get the following error when running the demo code in /python main.py

Code: Select all

[email protected]:~/epaper-install/raspberrypi/python $ sudo python main.py
Traceback (most recent call last):
  File "main.py", line 59, in <module>
    main()
  File "main.py", line 43, in main
    font = ImageFont.truetype('/usr/share/fonts/truetype/freefont/FreeMonoBold.ttf', 24)
  File "/usr/lib/python2.7/dist-packages/PIL/ImageFont.py", line 238, in truetype
    return FreeTypeFont(font, size, index, encoding)
  File "/usr/lib/python2.7/dist-packages/PIL/ImageFont.py", line 127, in __init__
    self.font = core.getfont(font, size, index, encoding)
IOError: cannot open resource
Can someone explain what this means and how to rectify it please?

Many thanks,
Alex

Return to “Graphics programming”