Thank you! Unicode??

Sep 24, 2009 at 4:47 PM
Edited Sep 24, 2009 at 4:48 PM

First of all i have to say thank you!!! You make my dream truth!!

I want to use unicode characters, but i can't! Every unicode character is displed as space. Is there a way to use unicode?

 

Thank you again!

Coordinator
Sep 24, 2009 at 5:40 PM

For the moment, there are only some characters available. this is because FontSprite creates a texture with all characters. The size of a texture is limited to 1024x1024 pixels. Due to that fact and to save memory, I'm currently rendering only the most frequent characters. However with next betas, it will be possible to specify what characters a font should know and then it will be possible to use any unicode.

 

Nov 25, 2009 at 4:33 AM

A quick workaround could be: 

        static FontSprite()
        {
            StringBuilder sb = new StringBuilder();
            for (int c = 32; c < 255; c++)
            {
                sb.Append((char)c);
            }
            sb.Append("€√±≠≤≥÷∞µ←");

            for (int i = 1040; i <= 1103; i++) sb.Append((char)i);//Russian chars

            DefaultCharacters = sb.ToString();
        }
Nov 28, 2009 at 4:27 PM

Hi Tom, the above fix will work for Russian and Greek, but for Japanese (for example) it won't.

Some characters will show fine but some others show like broken/distorted/split.

Any hint on what could be? I know you are not focused on this now but maybe there is quick code edit or "line comment" for this?

Thanks!

Dec 20, 2009 at 8:38 AM

Hi, I also met this problem, for example can't display Chinese . The only way I found is to set the charMap of FontSprite, but if there are a lot of characters to show, this solution is not efficient and practical. Can someone give some hints to solve this problem?