Unicode and Bitmap fonts

BlitzMax Forums/BlitzMax Programming/Unicode and Bitmap fonts

Grey Alien(Posted 2007) [#1]
So I figured out how to read Unicode text files and to use DrawText in BMax to output the foreign characters. But how can you use Unicode with bitmap font files?

Obviously you don't want to have a bitmap font file with every character set in it, you just want to make a Russian one for example. Then how do you index the letters in the Bitmap Font file from the Unicode characters? Are the Unicode characters for a language like Russian stored in a linear sequence of numbers that you can just subtract a base value from and then use that as the index for the Bitmap Font? Or is it more complicated than that?

Does anyone have any experience in this area? Thanks.


Brucey(Posted 2007) [#2]
Or is it more complicated than that

Depends :-)

Well, no.. each character has its own code :
Cyrillic Capital A is : Unicode - 410 : UTF8 - D090
Cyrillic Capital BE is : Unicode - 411 : UTF8 - D091
etc...

Cyrillic characters are in the unicode range 400-499. With a supplemental list from 500-529.

The Mac is a wonderful tool for looking at the different character sets. Open the Character Palette, view by Code Tables. Very nice utility. I find it more intuitive than the Windows one.

Enjoy :-)


Grey Alien(Posted 2007) [#3]
Thanks Brucy. I assume the Cyrillic uncodes you mentioned were in Hex right? I say this because I found lowercase a to be something like $444 earlier.

So if each char has it's own code, bitmap font support should be easy.

Yeah I've got a Mac I could check that out.

Do you know if it's safe to just use the Latin set for French, German and Italian? i.e. does it contain the few extra characters (e.g the large B thing in German) and accents in those langauges? Or do you still need unicode? Thanks!