Parse .FNT files text to ignore # and empty lines

A user Nivelle on discord now others here on forums reported that bitmap fonts exported by https://snowb.org

Simply do not work
It was Nivelle who pinpointed that now SnowB are adding additional lines on top of .FNT files
Which are more or less this

And unless you open your .FNT file with some text editor and remove these lines including that empty new line like here

And then save changes

Gdevelop will not recognize this file
Where removing these lines fixes it like a charm

So i ask for parser that will ignore lines that starts with # and ones that are empty
Which would fix the issue

2 Likes

Props to you guys for noticing

Holy what an unnecessary change from snowb… and their website is so easy to use!

Actually i would say it is necessary cause that is leaving info on font itself

Only issue here is gdevelop did not parse this stuff
Well to be fair who would think about it to begin with when .fnt files never had it
So gdevelop is also not to blame here

This is normal when stuff is changing
We just need to adapt
Until gdevelop will be able to parse it i am keeping the warning

This is more of a bug, I’m changing the category.

A file format is something that should be standardized, but a .fnt isn’t.

Ideally, PixiJS, which loads the font, should clean the content before loading it, but they don’t, so it crashes.
It will be faster for us to correct this with a wrapper in GDevelop before sending the font to be loaded via PixiJS.

2 Likes

I was able to make a fix, it was quite easy to do. I hope it gets released quickly and that everything will run smoothly as before.

3 Likes

Thank you very much cause for me its kinda personal

And now will that be in patch notes if ever?
I mean i want to remove warning from my tutorial about it
So i could know that its implemented just by reading patch notes

Or it will not and i gonna need to test it each release?

Logically, a line will be included in the patch notes about this.

1 Like

Just saw the PR, smart to have it pull out lines starting with disallowed special characters. Good work!