Page 1 of 1

CWriter and nano-gui Performance boost. Sharp displays.

Posted: Thu Oct 08, 2020 7:44 am
by pythoncoder
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.

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

Posted: Fri Oct 09, 2020 8:15 am
by skylin008
@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!

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

Posted: Fri Oct 09, 2020 10:03 am
by pythoncoder
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.