Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Bitmap Font works only sporadically... — Gideros Forum

Bitmap Font works only sporadically...

stetsostetso Member
edited May 2017 in Bugs and issues
Hi there,
I got the Bitmap font to work, but it seems to only load sporadically. I am not sure why because there is no error message or warning. Does any of you encountered a similar problem? Sometimes the font appears like it should, sometimes it is all black and sometimes it does not appear at all. I will attach a simple example project. Just keep reloading the game.

Pretty weird...
Thanks for checking it out if you have time!

Comments

  • simwhisimwhi Member
    @stetso We use bitmap fonts extensively in our games and we have never experienced anything like this before. I substituted your font with one of ours and this works flawlessly. The only real difference is that the substituted font is much bigger.

    I would suggest that you create a bigger boxy font.

    Likes: stetso

    +1 -1 (+1 / -0 )Share on Facebook
  • @stetso I had a look at the txt file and couldn't find any obvious problems, but perhaps there is something wrong with it. If I were you I would look on the web for another 8 bit blocky ttf font that you can export yourself so you can be sure that the txt file is ok. Perhaps there is something with that one that doesn't agree with Gideros. Also, as simwhi, says it is a very small font

    Likes: stetso

    +1 -1 (+1 / -0 )Share on Facebook
  • stetsostetso Member
    Thanks for your input. Do I understand correctly that you see the same problems with this specific font?
    In that case I will really need to find another font or recreate this one although this seems to be an issue with the font rendering nonetheless. It is a pity that we cant use small pixel fonts because I really like them and there are many nice ones around :D Anyway, thanks again!
  • stetsostetso Member
    edited May 2017
    Small heads-up on the problem: I previously tried to use it only with the Desktop Player where the font did not work properly. It does not appear in the Android Player. It works all the time there (I did not try to export yet, though). So my current guess is that this is actually an issue with the Player on desktop and not with Gideros itself... I kind of consider that good news!
  • stetsostetso Member
    Oh well, now it suddenly stopped working there too. I did not change anything in the project, but now it wont load the font correctly on the Android Player as well. Sorry for the confusion. Problem remains!
  • antixantix Member
    Accepted Answer
    This is a formatting issue. Gideros is VERY fussy about how your .txt file is formatted. Try the attached file which works for me ;)
    txt
    txt
    boxy.txt
    11K

    Likes: stetso, NatWobble

    +1 -1 (+2 / -0 )Share on Facebook
  • stetsostetso Member
    @antix, awesome, thank you! That did the trick. Still funny that Gideros would sometimes manage to read the file and sometimes not. Now it works.

    Likes: antix

    +1 -1 (+1 / -0 )Share on Facebook
  • hgy29hgy29 Maintainer
    I had a look at how gideros read the file, and it expects three kind of lines:
    - lines starting with 'common' containing font info
    - lines starting with 'char' containing character data
    - lines starting with 'kerning' containing kerning data

    in @stetso original file, there was no line starting with 'common' so font info was left uninitialized and could have contained random values. I didn't find a precise documentation about how the file is supposed to be.
  • john26john26 Maintainer
    How was the .txt file created? If Gideros Font Creator was used it should be in the correct format...
  • hgy29hgy29 Maintainer
    It wasn't made by font creator, but the format is quite common. I found many references to Angelcode software related to this format.
  • SinisterSoftSinisterSoft Maintainer
    Anyway to feed in default values?
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • hgy29hgy29 Maintainer
    Well, information isn't missing, the original file just lacks a line break...
  • stetsostetso Member
    The file came from this forum post and indeed is referred to as AngelCodeFont. Fixing the formatting did fix the issue (thanks again @antix) and I was mainly confused by Gideros sometimes loading it correctly and sometimes wrong and sometimes not at all without giving any feedback. Maybe if a warning/error would be raised it would make it easier to spot and fix. There is some kind of documentation here but some of the spec does not seem to matter to Gideros (e.g. the page tag is not on a separate line in the fixed .fnt file and it still works). So yeah, seems to be Gideros' special personality at work here ;)
  • hgy29hgy29 Maintainer
    page tag isn't used by gideros :)
  • antixantix Member
    Personally I use BMFont which works very well, once you learn how to use it that is :)
  • john26john26 Maintainer
    edited May 2017
    @stetso I'm not sure it has anything to do with Gideros's "special personality" but more the fact that you downloaded some files from a random website which are not compatible with Gideros. Gideros guarantees ONLY that Bitmap fonts generated with Gideros Font Creator will work in Gideros. Alternatively you can use True Type Fonts directly with the Gideros TTFont class. If you DO want to insert random files into a Gideros project, that's fine, it MIGHT work but be preapared to do some hacking! (and be prepared for it to sometimes work, sometimes not, ie undefined behaviour from a non-compliant, not-supported file)

    Furthermore the .fnt file (.txt in a Gideros project) on the website was listed directly in the forum post you linked so you must have cut-pasted it out with all the problems with line breaks etc that always causes. None of this indicates an error in Gideros.

    IMO, you would have been better off looking through the thousands of TTF fonts available and using one in Gideros, either directly with TTFont, or indirectly using Gideros Font Creator.
  • stetsostetso Member
    @john26 Oh, I am really sorry if I hurt your feelings somehow. That was not my intention at all, I hope I did not come across too rude. It was just a (admittedly measly) joke. I completely agree with you that it was entirely my fault by using the random file. I also expected to do some hacking on my own (which I did btw), I simply did not know what the problem was and assumed that it had something to do with the formatting which is very similar but, as you mentioned, apparently not exactly like the BMFont format. That is why I asked here and got very helpful answers. In the process, I learned a lot.

    Additionally, please be not mistaken: I do not expect anything and Gideros does not need to deliver or guarantee anything. It is absolutely amazing what you guys are doing with the framework and that you invest your time and knowledge and give it to people like me for free to use. I do not deduce any demands from that, but am grateful that I can even use the software at all :-) If I sounded otherwise, I apologize and blame it to my non-native English!

    I also acknowledge your (and others) hint about using TTF-fonts. I agree that the selection is quite large but from my point of view there are still some things that are easier to solve with font-spritesheets (e.g. the font in question: I could not find anything of a similar quality and feel around) and I was really happy to discover that it is possible to use these type of fonts with Gideros as well, even if a little hacking is necessary. After some help of the community, I can now do it myself. Sorry, if I sounded like that was Gideros' fault!

    Likes: talis, keszegh

    +1 -1 (+2 / -0 )Share on Facebook
  • keszeghkeszegh Member
    i agree with you @stetso about your compliments to gideros and its developers, even though i think @john26's reaction was not really in correlation to your comments. i especially never thought that you are demanding/requesting things too crudely or that you would criticize gideros for the issues that are not due to gideros.

    Likes: stetso

    +1 -1 (+1 / -0 )Share on Facebook
  • talistalis Guru
    edited May 2017
    Actually we should not forget the fact that Gideros is open source. There are some benefits and some disadvantages of being an open source program like every other open sourced program around.


    When a program is community driven you don't expect to see that it will fit the needs of the end user, hence there is no requirement to create a commercial product that will sell and generate money. If things goes wrong it is also rely on the community, i mean to us to fix the problems in any way. Not only coding, whatever skills we have we can contribute. Some of can contribute by testing, some of us making tutorials, some of us can invite people and spread the word and of course every of us if we have the opportunity and have the money by donating to the maintainers.

    Let us look from the bright side of being open sourced. It is generally free. And continually evolving in realtime as far as we found people's interest in it. Anyone have the power to adapt and modify gideros. Friendly speaking our community so far is the best that i encountered.

    These thoughts are purely my objective ideas about this subject. So as a result i want to point out those key words last time;
    -Spread the word.
    -Test, code, share. make tutorials, help people in forum be active.
    -And lastly if you are somehow commercially gaining some money from gideros or just want to show your graduation to the people who is working behind this marvelous SDK surely consider donation .
    =D>

    Likes: stetso

    +1 -1 (+1 / -0 )Share on Facebook
  • john26john26 Maintainer
    @stetso, no problem at all, I'm not in the least upset. I just wanted to point out that the behaviour you found is not a bug. At least I don't think so. Sorry it came across a bit sharp, that's the trouble with cold text, you can't really tell the mood of the author.

    But sure, if you want to experiment that's absolutely fine and greatly encouraged. I guess if I have a tiny criticism it's that your original post should have mentioned you used a non-standard file.
Sign In or Register to comment.