- Home /
How to add a font texture to a custom text mesh?
Hi! The thing I'm having problem with is that I was using this custom shader http://wiki.unity3d.com/index.php?title=3DText So that the 3d text should not be visable through walls. Then I used a app called BM font to get a font texture: http://www.angelcode.com/products/bmfont/
And now I'm a bit stuck cause I got the targa image file with the font texture but the associated font file is a fnt and not a ttf that unity uses.
So it feels like I took a wrong turn somewhere :) Please point me in the right direction!
I don't think you can import a font using bmfont for use with a text mesh. I've used bmfont to import fonts into Unity for use with EZGUI. In order to get them to work I had to rename the .fnt file to a .txt file. But I believe you must import fonts directly for a text mesh. That is just drag and drop your TrueType font file into the project.
Yeah the problem is that if I use a TrueType font they seem to get imported with their own material that can't be replaced and their materials shader is grayed out and can't be changed. So then I'm back at the original problem of the text mesh being visable through walls. And the first link I linked implies that this problem can be worked around but I can't get it to work.
Ohhh... I don't have time to verify, but I believe what you have to do is:
Import the font
Select the font and change the 'Character' setting to Unicode in the Inspector.
Click on the gear icon in the upper right of the Inspector and select 'Create Editable Copy'.
O$$anonymous$$G thanks! That's some well hidden stuff :)
Answer by Toonk · Nov 11, 2016 at 06:25 PM
It worked for me by simply importing the font as a .dfont - file (how fonts seem to be usually stored on mac pc's).
When imported, the font texture is visible in the inspector.