- On Windows PC install Python 3.91 or later, find it here: https://www.python.org/downloads/
- Create an folder e.g.
C:\temp\images\
- Copy your source .JPG images to the folder e.g.
myimage.jpg
- Copy
imgconvert.py
located in this scripts folder toc:\temp\images\
- Start a Windows cmd prompt, and chage directory to the folder:
> cd C:\temp\images\
- To create an image for display, enter this at the command prompt:
> python imgconvert.py -i myimage.jpg - n myimage -o myimage.h
- The image file is now created, move the
myimage.h
file into your sketch folder and include the file in your code like this#include "myimage.h"
- Draw the image like this:
DrawMyImage(x, y); void DrawMyImage(int x, int y) { Rect_t area = { .x = x, .y = y, .width = 100, .height = 100 }; epd_draw_grayscale_image(area, (uint8_t *) myimage_data); }
-
On Windows PC install Python 3.91 or later, find it here: https://www.python.org/downloads/
-
Find a suitable Font Family e.g google opensans.ttf
https://fonts.google.com/specimen/Open+Sans -
Download the Font Family file
-
Create an accessible folder e.g.
C:\temp\fonts\
-
Unzip all *.ttf files to the folder. It now has all types of font files.ttf of the chosen font, like:
OpenSans-Bold.ttf
OpenSans-BoldItalic.ttf
OpenSans-Regular.ttf
...
-
Copy
fontconvert.py
located in this scripts folder toc:\temp\fonts\
-
Start a Windows cmd prompt, and chage directory to the folder:
> cd C:\temp\fonts\
-
Create fonts you need.
To create a Regular 10-point font, enter this at the command prompt: > python fontconvert.py OpenSans12 12 OpenSans-Regular.ttf > opensans12.h To create a Bold 10-point font, enter this at the command prompt: > python fontconvert.py OpenSans10B 10 OpenSans-Bold.ttf > opensans10b.h
-
The font files are now created. Move the
opensansNNx.h
file into your sketch folder and include the file in your code like this#include "opensans10b.h"