Custom font all characters on top of each other
I'm trying to create a custom font to use (just for numbers). I've divided a 1280x512 file into a 5x2 grid of 256x256 spaces, put my custom drawing into the boxes through 0 to 9, saved it as transparent PNG. Here is a screenshot from Photoshop:
I've created a custom font, made the ASCII start offset 48, left everything default, created 10 character rects from index 0 through 9. Here is a screenshot showing everything clearly instead of writing everything one by one:
On the sixth element UV Y becomes 0, the rest goes the same.
I create a default GUI text, select my font and write 0123, but all the characters are on top of each other. The font is not obeying the Advance property. I've tried different values but it doesn't work for any positive value for the advance property. If I give a negative value, it works (e.g. puts the character at the right, as if I'm using a RTL language like Arabic) but of course, this is not what I want. If I type just one character it displays perfectly at the right place so I don't think there's any UV issue here. It really looks like I'm doing something wrong with the Advance value, but whatever I've tried (positive, negative, zero, huge numbers, fractions etc.) it doesn't work (with the exception of negatives that I've explained) I'm on Unity Personal 5.5.
What am I doing wrong?
I can't. I try to upload the zip file (271 kB) click the attach icon select my file and tap upload and it just stays there forever (pretty sure its not my fiber connection, it might be this site's restriction as it didn't allow me to upload a third image when I was trying to add a third screenshot in the question).
But, the image is the one you see at the first screenshot. 1280x512 transparent image at a 5x2 grid. Not sure why you want the image though, UV mapping works correct anyway?
That is because UA only allows attachments on questions or answers and not comments or replies (with a max of 2). Edit the original post/question and replace one of the images with the zip file.
I've uploaded the original image to Google Drive: https://drive.google.com/file/d/0BzBrnnSvTuDFZ2d6RUJtOExxVE0/view?usp=sharing
Answer by TBruce · Dec 03, 2016 at 09:00 PM
Attached is the zip file Number Font.zip. It contains the necessary files required for your bitmap font
Number font.fontsettings (font character data)
Number font (actual font)
Number font.psd (packed font .psd file)
I have also included two screen shots in the zip file Examples.zip showing inspector example settings for using the font with a UI.Text
component and a 3DText
component.