CWriter and nano-gui Performance boost. Sharp displays.

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
Post Reply
User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

CWriter and nano-gui Performance boost. Sharp displays.

Post by pythoncoder » Thu Oct 08, 2020 7:44 am

Thanks to a contribution from @jimmo rendering text to color displays can be greatly speeded up merely by copying a native C .mpy file to the target. This is detailed here. In addition to the framebuf_utils.mpy you will need to update writer.py. There is no need to update nano-gui: this uses the CWriter class for color displays and will automatically gain the improvement.

In my tests the performance boost to glyph rendering was 5x, but this is likely to be dependent on font size.

This has no effect on monochrome displays which already use fast rendering.

See also support for Sharp displays.
Peter Hinch
Index to my micropython libraries.

skylin008
Posts: 88
Joined: Wed Mar 11, 2015 6:21 am

Re: CWriter and nano-gui Performance boost. Sharp displays.

Post by skylin008 » Fri Oct 09, 2020 8:15 am

@pythoncoder, Thank you shared your impressive gui project. If nano-gui can be support Chinese char,is there detail guide to convet Chinese char to use to nano-gui.Thanks!

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: CWriter and nano-gui Performance boost. Sharp displays.

Post by pythoncoder » Fri Oct 09, 2020 10:03 am

Fonts are created using font-to-py which converts .otf or .ttf files to Python source. I have no experience of Chinese characters but if they can be encoded in those file formats it should be possible to make them work. People have had success with Russian and Cyrillic scripts.
Peter Hinch
Index to my micropython libraries.

Post Reply