Format of .BIN fonts.

Place where find documentation
Post Reply
AndyGadget
Posts: 222
Joined: Mon Feb 15, 2021 1:44 pm
Has thanked: 119 times
Been thanked: 132 times

Format of .BIN fonts.

Post by AndyGadget »

Francesco, you mentioned some time back you intended to provide a way of generating .BIN files to use as Annex custom fonts.
Doing a hex dump of one it does appear to be a fairly simple bitmapped file.
I know you've got a lot on your plate at the moment, but could you possibly give some detail on the format of a .BIN font file?
BeanieBots
Posts: 315
Joined: Tue Jun 21, 2022 2:17 pm
Location: South coast UK
Has thanked: 168 times
Been thanked: 102 times

Re: Format of .BIN fonts.

Post by BeanieBots »

Seconded.
User avatar
cicciocb
Site Admin
Posts: 1889
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 405 times
Been thanked: 1260 times
Contact:

Re: Format of .BIN fonts.

Post by cicciocb »

Thirded :D
AndyGadget
Posts: 222
Joined: Mon Feb 15, 2021 1:44 pm
Has thanked: 119 times
Been thanked: 132 times

Re: Format of .BIN fonts.

Post by AndyGadget »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Mon Nov 07, 2022 8:59 pm . . . it does appear to be a fairly simple bitmapped file.
And there again, maybe not :lol:
Looks like it's continuous, not byte constrained data, with the first block (434 bytes in the TomThumb font) pointing to offsets in the main data block.

That's like the Arduino GFX Glyph library format these originated from, but I was hoping they'd be decompressed for Annex use.
Ah well :D

Francesco, does your cryptic comment mean you don't know either? :o
(You were using someone else's code to convert these?)
User avatar
cicciocb
Site Admin
Posts: 1889
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 405 times
Been thanked: 1260 times
Contact:

Re: Format of .BIN fonts.

Post by cicciocb »

No, it was simply a joke.
The format is simply the GFXfont format, (the include .h files simply converted in .bin) but using a simple little trick to have all in the same contiguous memory space.
In fact these fonts contains several tables (3, if I remember well) that can be allocated in different memory places when imported in the code as .h
What I did is simply put these tables in sequence with an offset reference and computing back the absolute memory address when loaded in memory.
This has been done to be compatible with the original tft_espi functions and font format.

The problem is that I forgot how I did and I need to find where is the program I did for the conversion.

The good news is that I'm working on the WS28B12 and I want implement text scrolling so I'm motivated in the research
User avatar
cicciocb
Site Admin
Posts: 1889
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 405 times
Been thanked: 1260 times
Contact:

Re: Format of .BIN fonts.

Post by cicciocb »

I have a good news for you :D

Always using the web simulator, I created a little example and written a simple procedure in the sketch available here
https://wokwi.com/projects/347765374091002450

You will find the instructions with an already included font in the tab "sketch.ino"

Enjoy and let me know; you could also share the converted fonts on the forum.

cicciocb
AndyGadget
Posts: 222
Joined: Mon Feb 15, 2021 1:44 pm
Has thanked: 119 times
Been thanked: 132 times

Re: Format of .BIN fonts.

Post by AndyGadget »

Francesco, you're a marvel!
I'll have a go with this tomorrow.
AndyGadget
Posts: 222
Joined: Mon Feb 15, 2021 1:44 pm
Has thanked: 119 times
Been thanked: 132 times

Re: Format of .BIN fonts.

Post by AndyGadget »

. . . or even tonight.

Just tried running through the process for making an Annex font from a TTF and it works perfectly. :D
Post Reply