|
META TOPICPARENT |
name="WebHome" |
TFT Displays
Introduction |
|
Since font loading in the SSD1351 driver takes ages (the demo-font program using 9 different fonts took ~ 30s before the first character could be written. After that text writing was fast) I searched for another method and ended up asking the MicroPython forum. I got a link to the micropython-font-to-py git repository explaining how the font data can be kept in flash and you can nevertheless get fast access to the them. The fonts are implemented as Python source files providing not only the font data but also access routines to the pixel data. These font files can be frozen into MicroPython and are thus stored in flash. When a character is written, only the pixel data for this character is loaded into RAM. |
|
< < | The problem was now how to convert the font files in C supplied with the SSD1351 driver to Python font files compatible with micropython-font-to-py. I wrote a Python script doing exactly this. The output is actually executable (on the PC) and will print the pixel data of the letter "A" for this font. |
> > | The problem was now how to convert the font files in C supplied with the SSD1351 driver to Python font files compatible with micropython-font-to-py. I wrote a Python script:
https://afnog.iotworkshop.africa/pub/IoT_Course_English/TFTDisplay/convertFont.py.txt
doing exactly this. The output is actually executable (on the PC) and will print the pixel data of the letter "A" for this font. |
|
![font.png font.png](https://afnog.iotworkshop.africa/pub/IoT_Course_English/TFTDisplay/font.png) |
|
META FILEATTACHMENT |
attachment="lolon2.4inch.png" attr="" comment="" date="1593855908" name="lolon2.4inch.png" path="lolon2.4inch.png" size="224064" user="UliRaich" version="1" |
META FILEATTACHMENT |
attachment="tftJumpers.png" attr="" comment="" date="1595002607" name="tftJumpers.png" path="tftJumpers.png" size="641474" user="UliRaich" version="1" |
META FILEATTACHMENT |
attachment="font.png" attr="" comment="" date="1595323325" name="font.png" path="font.png" size="2814" user="UliRaich" version="1" |
|
|
> > |
META FILEATTACHMENT |
attachment="convertFont.py.txt" attr="" comment="" date="1595330819" name="convertFont.py.txt" path="convertFont.py.txt" size="8820" user="UliRaich" version="1" |
|