SSD1322 Display Component Fonts

For general Flowcode discussion that does not belong in the other sections.
canary_wharfe
Posts: 78
http://meble-kuchenne.info.pl
Joined: Thu Dec 10, 2020 3:54 pm
Has thanked: 6 times
Been thanked: 11 times

Re: SSD1322 Display Component Fonts

Post by canary_wharfe »

chipfryer27 wrote:
Wed Feb 21, 2024 10:23 am
Hi Ben

Congratulations on the new addition.

Regards
Ben

Congratulations from me also on the addition to your family.

You asked for feedback on the font creation tools for display components and while i understand that there is a general desire to try and maintain some type of standard in keeping with industry resources I would say that as the Flowcode display components are specific to the Flowcode CAE tool and as the previous font generation methods through Arduino based libraries have become 'user unfriendly', then I would suggest Flowcode creates a Flowcode specific plugin that allows font customisation of flowcode display components. Probably easier said than done but as new display components become available in the market then I can see the custom font creation topic repeatedly coming to the fore. The only way I see a solution working is for the development of a custom high level font software tool that acts as a plugin to a standardised flowcode display component interface. Whether this tool becomes offered as part of flowcode under licensing or whether the tool is kept in-house and then Matrix uses it as an additional service to commercial users requiring custom fonts is something that only Matrix Multimedia can determine.

Best regards etc.

BenR
Matrix Staff
Posts: 1739
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 440 times
Been thanked: 603 times

Re: SSD1322 Display Component Fonts

Post by BenR »

Having our own tool is a good option to keep us in control and ensure it's as simple and straightforward to use as possible, I'll explore this option with Steve and see how easy this would be to acheive.

BenR
Matrix Staff
Posts: 1739
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 440 times
Been thanked: 603 times

Re: SSD1322 Display Component Fonts

Post by BenR »

Hello,

I think I have got somewhere with this now and after some back and forth and huting around (thanks Steve) I think we have a fairly nice way to add fonts and some ways of moving forward.

Doing our own tool is certainly an option but the code behind all of this isn't trivial and isn't really something we want to get into. Others have done this and shared their code but the deeper you dig the more and more libraries are involved and it gets quite messy fast.

Saying this we can create the font data using a tool called The dot factory - http://www.eran.io/the-dot-factory-an-l ... generator/

For the input string I use this data to create the printable ASCII characters between 33 and 126. This is a full font set, of course you can pick and choose which characters are included.

!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

For the configuration settings I use these.
DotFactoryConfig.jpg
DotFactoryConfig.jpg (66.35 KiB) Viewed 304 times
On clicking generate it creates three arrays.

The first is the bitmap pixel data. This would become your main data array.

The second contains the width of the character and the byte offset in the bitmap pixel data. This with some manipulation would become your width array.

The third is some stats such as pixel height. This would be used to configure some of the properties.

For use with the existing font component you need to do a bit of manipulation specifically to array 2 to remove the byte addresses. You will also need to remove the comments by turning these off in the dot factory options. edit - It doesn't look like turning this off makes a difference so the comments will need to be manually removed.

I'm going to see if there's an easy way to use the files that this spits out so we can have say a folder of these files and parse them as needed.

This way it should be simple for a user to generate the specific font they want and only include characters that they are going to use meaning there is no wasted ROM space.

canary_wharfe
Posts: 78
Joined: Thu Dec 10, 2020 3:54 pm
Has thanked: 6 times
Been thanked: 11 times

Re: SSD1322 Display Component Fonts

Post by canary_wharfe »

There is no wasted ROM space? That's a major benefit. Also being able to to use a subset of the full font set in the input string is good. If we can get an easy way to spit the files out and parse them as and when that would be the icing on the cake. If there isn't an easy way, at least it looks like this tool we do the job - just with a bit of work to remove the byte addresses and comments.

If your idea of finding a method to produce and parse the files doesn't work Ben is there any chance of a short tutorial with an example of taking the 3 arrays from the tool and showing the before and after edits on sample data? I think then we would have a working template that users can follow with dotfactoryconfig? Perhaps this could act as a working placeholder workaround until you have a bit more available time? I appreciate your efforts to produce something that has been a bugbear. I have tried several Arduino based tools only to find that by the time they have been updated (or worse - not updated at all), they end up being full of holes and never provide a complete solution. And more kudos then to the Flowcode environment if the dotfactoryconfig becomes a solution :-)

BenR
Matrix Staff
Posts: 1739
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 440 times
Been thanked: 603 times

Re: SSD1322 Display Component Fonts

Post by BenR »

Hello,

Right I've not had time to test this in action but it looks to be working and should allow you to point Flowcode at the dot factory .c file output directly.

First go to library updates and get the latest Font component, then restart Flowcode.

Next in your display properties set the font to custom, it should be right at the bottom of the list.

Finally go to View and Component Debugger and then enable Expose Full Component tree.

In the drop down at the top of the properties window select the Font component inside the GLCD_BASE that has the custom font selected.
Tree.jpg
Tree.jpg (22.73 KiB) Viewed 277 times
Change the Custom Font File property to point to the unedited dot factory .c file.
CustomFont.jpg
CustomFont.jpg (58.15 KiB) Viewed 277 times
Fingers crossed that should all work and this should both simulate and download to target.

If this works ok for you then I'll roll out the new custom file property to all the displays so you don't have to use the full tree view.

BenR
Matrix Staff
Posts: 1739
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 440 times
Been thanked: 603 times

Re: SSD1322 Display Component Fonts

Post by BenR »

I've now added instructions for generating and using custom fonts to the Font component wiki page.
https://www.flowcode.co.uk/wiki/index.p ... l_Library)

I've not had a reply from you so I'll assume it's working ok for you there as it is woring correctly here for me and continue rolling it out.

canary_wharfe
Posts: 78
Joined: Thu Dec 10, 2020 3:54 pm
Has thanked: 6 times
Been thanked: 11 times

Re: SSD1322 Display Component Fonts

Post by canary_wharfe »

Hello Ben
Once again sorry for the delay in response. I went down wit flu last week!
Wow!!!! It works. I am blown away with the ease of it all. And many many thanks for the the added instructions in the WiKi. I converted that page to a PDF and then followed your instructions to the letter. I couldn't believe dot factory would work as the accompanying info on that utility specifically states it has been tested on Windows XP, NT and Win7. I thought ooops .... what will happen when I try installing on my main Windows 10 PC? Well it works on Windows 10 ..... but I discovered you need to install and run the EXE file as an ADMINISTRATOR or the app will throw up an error.
So we now have custom fonts. That is fantastic! :-)

Post Reply