ssd1331 Multi-Language Font

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
danjperron
Posts: 51
Joined: Thu Dec 27, 2018 11:38 pm
Location: Québec, Canada

ssd1331 Multi-Language Font

Post by danjperron » Thu Dec 27, 2018 11:55 pm

I start to use the ssd1331 oled display with my ESP32 and found out that the current font converter from Adafruit wasn't doing any multi-language font and it converts the font into C code .

Then i modified the fontconvert.c to enable utf-8 character and create a python module containing the font.

This way I was able to write sentence in French. The code is not complete but works enough to make it available.

I did compile the C code using a rasbperry Pi and I had to upgrade the freeType library . First by remove it and then install it using the source code https://www.freetype.org.
I also change my locales on Linux to get the correct language settings.


The way it works is by looking at one index to check if the utf-8 character is inside the font .


This is Adafruit Github with the original font converter.
https://github.com/adafruit/Adafruit-GFX-Library

And this is my fontconverter to create Python font modules with multi-language.
https://github.com/danjperron/ssd1331_micropython

Just change/add into the contents of the variable List inside fontconvert.c and make

Daniel

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

Re: ssd1331 Multi-Language Font

Post by pythoncoder » Fri Dec 28, 2018 7:52 am

You might like to look at nano-gui which supports these displays. Fonts are created as Python source files uding font-to-py. This supports multi-lingual fonts and converts industry standard font files to Python source. The Python files are designed so that, if they are frozen as bytecode, their RAM usage is very small.
Peter Hinch
Index to my micropython libraries.

Post Reply