Larger fonts on SSD1306 OLED displays

Showroom for MicroPython related hardware projects.
Target audience: Users wanting to show off their project!
User avatar
pythoncoder
Posts: 1429
Joined: Fri Jul 18, 2014 8:01 am

Larger fonts on SSD1306 OLED displays

Postby pythoncoder » Tue Nov 15, 2016 9:41 am

The official driver supports a single 8x8 pixel monospaced font. This extends it to support larger fonts.

A Python3 utility to run on a PC enables arbitrary monospaced and variable pitch fonts in standard formats to be converted to Python source files. This SSD1306 driver enables them to be rendered to the device. Sample Python font files are included. https://github.com/peterhinch/micropython-samples/tree/master/SSD1306.

Aside from general use it is intended as a practical demonstrator for a suggested way of handling one bit per pixel fonts in MicroPython. The solution is intended to be device independent and to support the official framebuffer module. The proposal defines the file format, the utility for creating them and suggests device driver design guidelines for their use. Details are here https://github.com/peterhinch/micropython-font-to-py.git (currently these docs are a work in progress).
Peter Hinch

User avatar
kfricke
Posts: 312
Joined: Mon May 05, 2014 9:13 am
Location: Germany

Re: Larger fonts on SSD1306 OLED displays

Postby kfricke » Tue Nov 15, 2016 10:41 am

Sounds cool! I gave not had any time to look into this. But how about font licences? We must not ignore those!

User avatar
kfricke
Posts: 312
Joined: Mon May 05, 2014 9:13 am
Location: Germany

Re: Larger fonts on SSD1306 OLED displays

Postby kfricke » Tue Nov 15, 2016 12:43 pm

Yesterday I did start to rework the display driver from mbirth to work with the current (re-iterated) machine API. Adding the frambuffer support and/or bytearray() backed buffer is next on my list.

Will this automatically enable the use of your recent work in this area? As far as i have gathered by a quick read all of the "font-work" is done on the framebuffer, right?

User avatar
pythoncoder
Posts: 1429
Joined: Fri Jul 18, 2014 8:01 am

Re: Larger fonts on SSD1306 OLED displays

Postby pythoncoder » Tue Nov 15, 2016 2:38 pm

kfricke wrote:As far as i have gathered by a quick read all of the "font-work" is done on the framebuffer, right?
Yes, it works on the framebuffer's underlying bytearray. But the framebuffer's scroll method is buggy. Owing to the moratorium on PR's I implemented a workround in Python in my SSD1306 driver.

Re font licensing. My code merely converts one file format to another. As far as I'm concerned the user must take responsibility for the legality of the source, but perhaps I should put a warning in my docs. I believe that the example files I provided with the SSD1306 example are appropriately licensed.
Peter Hinch


Return to “Hardware Projects”

Who is online

Users browsing this forum: No registered users and 1 guest