- Home /
UTF-8 Support in Unity iPhone 1.6?
I am trying to write some equations that using some special characters, such as naught () or squared (). I am using Javascript and authoring in TextMate. File encoding in TextMate is set to UTF-8. The characters render in TextMate. The characters even render in a call to Debug.Log. However, these characters won't render when used with the GUI class, such as GUI.Label.
Does Unity iPhone support the display of UTF-8 characters via the Unity GUI class? If not, is there a work around (GUISkin or GUIStyle) or must I find a different method (display as image)?
Thanks, Christopher
Does unity have a TTF font size limit? I'm running into problems with fonts like Arial Unicode $$anonymous$$S and Bitstream Cyberbit and am wondering if their size is too large to handle as a texture due to the number of glyphs (50k and 30k, respectively).
Answer by Lipis · Mar 08, 2010 at 09:39 PM
Should work. Maybe the font that you are using doesn't support these characters. Try changing the font of the skin to something like Monaco
or Verdana
and check if you have the same result.
Clarification: The font applied in the GUI in Unity or the font used in the text editor?
@chrstopherbrown In the GUI in Unity.. if you change to $$anonymous$$onaco can you see the squared?
I've been using Font Book in conjunction with Special Characters in order to see which glyphs any font contains. The only problem I'm running into at this point is that not all the characters in any given font will render in Text$$anonymous$$ate, let alone Unity. Another stickler seems to be Arial Unicode; it has over 50k glyphs but won't render nicely in Unity GUI at all!
HUL$$anonymous$$ S$$anonymous$$ASH!
I'm marking this as "the answer," though I don't feel I've received satisfaction at no fault of the community. It seems rendering mathematical equations in text as I would like to do is not what Unity was built to do. Back to the drawing board!
Thanks.
@chrstopherbrown actually I also have to deal with some mathematical equations in Unity.. so if you ever come up with an actual solution, just let me know somehow :) $$anonymous$$aybe in version 3... it's co$$anonymous$$g soon!
Answer by Eric5h5 · Mar 08, 2010 at 09:47 PM
The squared character displays fine with the built-in font, although naught doesn't. If you're not using the built-in font, for the squared character at least, make sure you're importing using Unicode and not ASCII. The naught character may need a custom font.
I have verified that the font encoding is Unicode when I increased the font size. No success yet using $$anonymous$$onaco.
Your answer
Follow this Question
Related Questions
Umlaut shown as ?? in GUILayout.Button 3 Answers
how to prevent unity iphone from changing the orientation of the game and GUI? 1 Answer
How do I convert from unicode to surrogate pairs? 2 Answers
How to drag a scrollView with TouchPhase.Moved? 0 Answers
rotated GUI behaving differently on iphone and ipad 1 Answer