OLED with SPI SSD1306/SH1106 --> additional fonts

Moderator: Benj

Post Reply
Jörg Güldner
Posts: 77
Joined: Wed Jun 22, 2011 3:32 pm
Has thanked: 17 times
Been thanked: 11 times
Contact:

OLED with SPI SSD1306/SH1106 --> additional fonts

Post by Jörg Güldner »

Hello Matrix team,
I must write a menue to a OLED 124x64. The font "0" is to little to read for older people. The next size is to big for long words. What I`m missing is a font like 7x10, if possible. So this font fill up the space between the fonts "0" and "2". Can you manage that? This will be very helpfully for me.

BYTE Font (Oled display):
Range: 0 to 31 - 0=5x8, 1=10x8, 2=10x16, 3=5x16, 4-31=Extended Sizes
Oled_fonts missing.jpg
Oled_fonts missing.jpg (19.57 KiB) Viewed 11402 times
]


Best regards
Jörg

There is another article with the same inquire: viewtopic.php?f=77&t=20689

chad
Posts: 198
Joined: Sun Nov 04, 2018 7:13 pm
Has thanked: 27 times
Been thanked: 33 times
Contact:

Re: OLED with SPI SSD1306/SH1106 --> additional fonts

Post by chad »

I agree, additional fonts would be really useful. The stock one Is kinda chunky..
Or at least a tutorial on how to import our own..

Chad

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: OLED with SPI SSD1306/SH1106 --> additional fonts

Post by Benj »

Hello,

GLCD fonts is something I've spent a fair amount of time thinking about. With your 7x10 font would you be happy using just this font or would you also need access to the 5 x 8 font on a single display.

Each font would consume an amount of your program flash area so adding more then one is possible but gets quite costly.

I've also used variable width fonts before and these can look really good but again at the cost of ROM space and additional code in the string printing routine.

chad
Posts: 198
Joined: Sun Nov 04, 2018 7:13 pm
Has thanked: 27 times
Been thanked: 33 times
Contact:

Re: OLED with SPI SSD1306/SH1106 --> additional fonts

Post by chad »

The way I look at it is if people are going to be using a oled or lcd they are going to be on a chip with a little more program space, or would be willing to bump up to a bigger chip. You aren't going to be spending dollars , tens of dollars on a nice display and fret over a single dollar for a bigger chip.

Second the Arduino has several great graphics libs like u8glib , adafruit , that littleGL from that other thread. The Arduino isn't a power house but it has an order of magnitude more code available for it and it is open so people can look at it and tweak it to do what they need. FC is so DRM'd and 'monetize everything'd ' that in my opinion really limit's its popularity and limits peoples ability to expand components. This is 180 degrees apart from the entire rest of the world that is going open source.

I don't know, It's just frustrating to have to start over on everything in FC if there isn't a component, or one that is minimally functional.
I get that there are only two of you writing this stuff and that there are lots of people that have different needs and there a lot of 'supported' chips and that makes it difficult to please everyone despite your best efforts. /end rant

TLDR:
Don't hobble an expensive led,oled worrying about running on a tiny chip..

Chad

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: OLED with SPI SSD1306/SH1106 --> additional fonts

Post by Benj »

Thanks for the input Chad.

Regarding fonts on Arduino can you use multiple fonts on a single display using Arduino? Also do you get to choose your font?

It's all possible it's just finding a way that's both functional and straightforward to use.

chad
Posts: 198
Joined: Sun Nov 04, 2018 7:13 pm
Has thanked: 27 times
Been thanked: 33 times
Contact:

Re: OLED with SPI SSD1306/SH1106 --> additional fonts

Post by chad »

I don't remember if you can have different fonts on the screen at the same time. I do know that there are many fonts to choose from.
Here is the u8g2 font list.https://github.com/olikraus/u8g2/wiki/fntlistall.

If you want to emulate a good display package this would be where I would start.
https://github.com/olikraus/u8g2/wiki

What I don't know is if it just loads characters that are used or if it loads the entire font set.

Chad

Jörg Güldner
Posts: 77
Joined: Wed Jun 22, 2011 3:32 pm
Has thanked: 17 times
Been thanked: 11 times
Contact:

Re: OLED with SPI SSD1306/SH1106 --> additional fonts

Post by Jörg Güldner »

Hello Benj,
I found some pictures from the arduino with fonts in that size, I´m missing in FC8.
Please have a look to the size, where the pictures are selcted by a red ellipse.

Jorg
Attachments
Oleds fonts missing in Flowcode.jpg
Oleds fonts missing in Flowcode.jpg (94.64 KiB) Viewed 10608 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: OLED with SPI SSD1306/SH1106 --> additional fonts

Post by Benj »

Hello,

I can confirm that font selection will be in the next version of Flowcode which is scheduled for release later this year. I've had a go at the code this morning and it is looking very promising but there's still lots to do before this is complete.

I would give you it for v8 but it's a lot of new work and requires many component modifications so I don't want to release things half baked that will potentially have many knock on effects at this stage.

Currently trying to see just how many useful fonts I can pack in. The selection will only allow for a single font to be used at any one time but will allow for things like variable width fonts and should be expandable as new fonts are requested.

Here's my current list.
Fonts.jpg
Fonts.jpg (25.58 KiB) Viewed 10586 times
If you are desperate for this in v8 then let me know and I will see what I can do.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: OLED with SPI SSD1306/SH1106 --> additional fonts

Post by Benj »

Got a bit further with this now and it's simulating at least. The change is massive and I can see all kinds of knock on problems that will need resolving but it's a good start.
Font.jpg
Font.jpg (10.24 KiB) Viewed 10561 times
I'm thinking about dropping the ability to multiply the font in x and y when printing text as this will help simplify things a lot. Would anyone miss this if there were enough fonts available. Note that you would only be able to use a single font size on the display if this happened. I'll try and keep it in but for now my working code does not include it.

An alternative workaround for this would be to allow multiple fonts to be used with a single display, this would have ROM usage knock on effects to store the active font sets but would look much nicer. The more I think about it the more I am liking this option.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: OLED with SPI SSD1306/SH1106 --> additional fonts

Post by Benj »

I've gone for the multiple fonts approach and removed the font scaling, as I say this cleaned up the code a lot. The font parameter now selects which font you want to use. Currently I have enabled up to four fonts to be loaded into a single display and it's all working nicely in the sim.
Fonts.jpg
Fonts.jpg (76.46 KiB) Viewed 10548 times

chad
Posts: 198
Joined: Sun Nov 04, 2018 7:13 pm
Has thanked: 27 times
Been thanked: 33 times
Contact:

Re: OLED with SPI SSD1306/SH1106 --> additional fonts

Post by chad »

Hi Ben,

Been away for a while but I was just scanning new threads and Saw some updates on this one.
Thanks! I can't wait to try it. I probably won't be updating to fc9 at least not soon so I would be a yes vote for v8 support. Bu...


Chad

ronaldlijs
Posts: 139
Joined: Tue Jan 05, 2010 10:07 am
Has thanked: 20 times
Been thanked: 25 times
Contact:

Re: OLED with SPI SSD1306/SH1106 --> additional fonts

Post by ronaldlijs »

Ben at al,

We also can't wait to try this.
Jac Kersing implemented VFD 256x64 (parallel) control for us on FC6, he included a way to save fonts that was invaluable, but we had to convert the files to binary, put them in a text file, etc...
Having the possiblity to use fonts from within Flowcode would be just fantastic!

Keep it up!
R

Post Reply