nspsck / RM67162_Micropython_QSPI

This is a C driver as a user module for the T-AMOLED-S3 using QSPI-protocol.
MIT License
7 stars 4 forks source link

Variable bitmap fonts #4

Closed dobodu closed 6 months ago

dobodu commented 6 months ago

I've been playing a lot with Pico/st7789 library, and I find the Write fonction much better thant the Text function.

It allows to use variable width bitmap fonts (better looking on the screen) It allows mainly to import any fonts with font2bitmap that offers the world TTF fonts access.

I know the repository is on halt due to the buffer allocation timeout, but if you find the time, I'll appreciate testing the Write function. I gave a look to the C library and tried to import Russ Hughes routines but they need too much adaptation I cannot manage.

nspsck commented 6 months ago

This is kinda hard for me to do at the moment. Time-wise... I am trying to learn rust right now and will be starting my college in August...

I'll try to squeeze some time to do this till this weekend, but there is absolutely no guarantee.

nspsck commented 6 months ago

So, the function is implemented. But the reset bug is still there. To fix that might cost me 4-8 days hence I left it there. That bug doesn't affect your product unless you need to initialize the qspi-bus more than 1 time.

dobodu commented 6 months ago

Very nice,

I've been testing, it's working perfectly !

If I find the time this week-end I'll show you my project (already running well on a Pico + waveshare st7789 screen.

The bug is of course annoying, mostly when you restart the program on Thonny but that's nothing important.

Thanks a lot

nspsck commented 6 months ago

Hi

I fixed the resetting bug, at least for the mpy v1.23. If you want, you can give it a try. Worked for me. There might also be a slight performance hit since I also added an Error message to tell the user when they are trying to use more ram than they supposed to be. (There was a bug in color.py, I was too stupid to code that example late night and ye... it cost me today a lot. Tho, this was not the cause for the resetting, but now still fixed.)

best regards and cheers if you are also drinking coffee

dobodu commented 6 months ago

Hi, I'll give a try by the end of the day.

I spend yesterday evening, writing the touch driver support for the screen (you can see it on my github). The CTS8xx series lacks a good reference manual (or at least not in Chinese).

By the way, I'd like to try importing the JPG function and maybe the polygon/fill_polygon. That may be reachable in C with the inspiration of st7789 library. Let's see if I will have success...

nspsck commented 6 months ago

Hi, polygon and fill_polygon should be easy to adapt, jgp and png support are not that easy and the implementation of st7789 is not very fast. For jpg, it only uses 40KB RAM, which is great on lower-end devices, but for this device, it ist just not fully utilizing its potential.

dobodu commented 6 months ago

Well, Short time, high efficiency ;-)

I confirm the annoying reset bug has gone away also on my Micropython build !

By the way, I managed to implement (let's better say copy) the Polygon, Fill_polygon and Polygon_Center in your code. And it works perfectly !