- Home /
unity font error
when i import my own fonts into unity, instead of the writing being in the font its just a load of jumbled up writing that no one can read. please can anyone help?
Answer by dissidently · Dec 19, 2010 at 02:21 PM
Font's are a nightmare in Unity. Not because the way Unity handles them is bad, but because the way it handles them is completely unique to Unity in the graphics/design world as we know it today. And it harks back to a bunch of methods used by the demoscene in days long gone.
That is to say, a font texture is created in order for fonts to be displayed. It's not rendering fonts in the methods you're accustomed to, or with any of the logical ways that you'd think of fonts in a traditional business computing sense.
What it means is this: Unity has various ways to create a texture that features all the letters needed to display the characters of the font that you're wanting to show. It then uses a combination of alpha channel separation of the font from the background of the texture it creates and positional referencing to the letter rendered on the texture to display the individual letters.
From what I know from memory, version 3 onwards adds a "dynamic" mechanism for doing this texture creation, (don't think it was in earlier versions) in which only the letters originally called for are rendered to this texture, not all the letters of the alphabet or character set. This dynamic rendering means that if you decide to change the letters shown AFTER this texture of letter images is rendered, it's not going to be able to find the right letters and going to call upon the wrong space within the texture to display your desired letters or result in an error.
But other things can go wrong as well. If you change font without updating this letter texture as it was created with another font, the different spacings of a different font will mean that the program is calling for the wrong positions within the letter texture map to find the letter you really want. And then you'll get gibbledegook.
So what you've gotta do is be anal about creating a font, making it create a font texture for itself to use, and THEN choosing your letters to display and make sure that it's not dynamic if you're going to change the letters you want to display at anytime. And remember to never change font without going through the whole process of either updating the font texture, or easier, just create a new font and subsequent font texture.
Further, if you want to use textmesh, you're going to need learn about the diddle that is font shaders, since there's a deliberate setting of absolutely no use to the majority of people in the text mesh shader that makes it go through every object in a scene as if it's transparent.
I'm sure this is confusing... it took me forever to figure out how they've implemented fonts, and I'm still not sure about it... so if this doesn't answer, fire more questions, no one can blame you for needing answers to this... it's VERY different from how it's done in just about every other software you'd use in normal life on a computer.
Font textures are generated for the characters needed on screen. They require the font to exist on the machine, otherwise it will use a fallback font which may not have the characters you are using. If this is not working as expected please file a bug report.
Answer by uhahaha · Dec 19, 2010 at 01:43 AM
Is the font .TTF?
You created the font, so you should know it. What program did you use to create it? Does it have the .ttf extension?
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
How do you import Blender water into unity 3D 3 Answers
Importing .FBX with a lot of animations. 1 Answer
blender crashing test play 1 Answer
Unity wont recognize High Definition Models from blender 0 Answers