Closed yurembo closed 8 years ago
From a quick research, the .fnt file is parsed in /source/bitmapFont/bitmapFont.cc in function BitmapFont::parseFont
It doesn`t seem to check for a specific subset, just chars or char sections in the .fnt file.
That being said, I haven`t looked at how the .fnt file handles Russian characters.
It's based on ASCII characters. Any character that has an ASCII number should be fine. Try comparing the contents of your fnt file with some of the example fonts.
In ASCII table english letters took place the first part numbers (< 128), but russian letters took place above number 128. And these letters are not output I think
Can we extend a Torque's font to support a second part of an ASCII table? @greenfire27 do you test FontAsset and TextSprite with an extended ASCII table?
The TextSprite itself should be able to support anything that goes in the fnt file. Perhaps the problem is with the way Torque handles strings. Strings are just character arrays and a char in C is a value between -128 and 127. So passing in characters with ASCII values greater than 127 would probably wrap around and be processed as a negative value. Once I convert the character to an int I could try looking for negative values and un-wrap them. That might fix the problem. I'll add it to my to-do list.
This is looking so good!
By the way Torque 3D supports UTF-8 well
@yurembo
Well good news! After some experimenting I was able to get Russian letters (Cyrillic) to work just fine. The text sprite actually runs off of UTF-16 and can support any language that Bitmap font generator supports. All you have to do is create a font with Cyrillic checked on the right. Then when you save the font it will include Russian characters. Just use the font with your TextSprite and the characters will appear just fine.
Your problem was that you tried to use Russian characters in the 128 to 255 range. Russian characters actually fall above 1000. You have to use the right values for this to work. The nice part is that Bitmap font generator does it all for you.
Hope that helps. I'm closing the issue.
Thank you! But still it does not work for me. What software do you use?
I read it again and again. You use Bitmap font generator. Where do I switch to use numbers above 1000?
@greenfire27 please look my files: fnt as txt, cs as txt and visualisation as png I have no errors in the output rfont.txt sprite.txt
I see what's going on. Your font file has Cryllic characters but you're trying to use Latin Extended characters. Just create a font with the Latin Extended character selected like so:
And then you'll be able to do this:
I'm here if you still have problems.
These are not cyrillic characters. I made as you tell with a font file but my app outputs one line only
Right, but your font file has Cyrillic characters in it - not the needed latin ones. Create a font matching my first picture and you should be able to get my second picture.
Yep, I tryed this, nothing changes
Can you attach your new fnt file as a txt file?
This font file has all the characters you need. So if you're still not seeing them in the game then the problem is somewhere else. As I said before though, it is possible to do what you are trying to do (I have the screen shot to prove it). Walk though the steps carefully to see where things are going wrong. If you need more help then you should probably email me directly.
latin text renders well, cyrillic is not visible, latin extended != cyrillic
Lol, just create a font file with both latin extended and cyrillic.
Yesterday I tried this, bottom cyrillic line is not visible
Can you send me your font?
Does TextSprite support not latin text? I tried to make a symbol map with english and russian letters, english letters render well but russian letters are invisible