Page 1 of 1

Using Chinese fonts with an ST7789 display

Posted: Thu Oct 21, 2021 10:42 am
by tusabez
Hi all,

I'm interested in getting Chinese characters to display on an st7789 display but haven't I figured out how to do it yet. I have no problem printing out text in English. I'm using the following drivers with the Pico [/url]https://github.com/russhughes/st7789py_mpy[url]. I'm assuming either I need to download a font file or need to make my own but I'm not that advanced yet.

Thanks

Re: Using Chinese fonts with an ST7789 display

Posted: Fri Oct 22, 2021 6:29 pm
by russ_h
You can convert a True Type font using the font2bitmap.py utility. The display driver is not currently unicode aware so it would require some modifications to make unicode fonts work easily. I will look into adding support for unicode fonts.

Re: Using Chinese fonts with an ST7789 display

Posted: Sun Oct 24, 2021 5:53 pm
by russ_h
The write method now accepts UTF8 encoded strings. You will have to create a python font file containing the characters you are going to use with the font2bitmap.py utility. See the proverbs.py and proverbs_font.py files in the examples/T-Display folder for an example. UTF8 support is not optimized, but it is usable.

Image

Re: Using Chinese fonts with an ST7789 display

Posted: Sun Oct 24, 2021 7:29 pm
by tusabez
Thank you! I will take a look and give it a try.