Custom font completely broken in Unity 4.

When I imported my project into Unity 4, it completely bricked my custom font. I made the font by importing a texture (after hand-painting the characters) and used that texture as a basis for a custom font within Unity. I spent a long time arranging the letters so they were spaced nicely in the font inspector.

Looked and worked great in 3.5. Used it on my text meshes.

Now it’s just a garbled mess and ruined. Everything is just shards of letters/numbers at best, and at worst, blank. All the settings are different now for custom fonts, and none of them do or change anything. I’ve randomly fiddled with Index, UV, Vert, Flip, all the X/Y H/W values… nothing.

Can nothing be done? Has support for custom fonts been officially removed?

I seem to have figured out how the new custom font system works, but it’s extremely convoluted, so you’ve been warned. I figured it out thanks to memememememe’s explanation.

I have a font I custom painted, and the image dimensions on it are 2048x1024; 16 characters across, 8 down.

To get the values you need to place into the UV area, you need to figure out how your characters are positioned on a scale of 0 to 1. You divide 1 by the number of characters on a dimension. 1 divided by 16 got me 0.0625. Therefore, this is the number of my UV Width for all characters. 1 divided by 8 is 0.125. This is the UV Height for all characters.

For UV X and Y, it’s just a matter of deciding which character you want and multiplying the width or height value times the column/row of the letter.

Note: For Vert, it seems that Vert Y must be negative, or else you’ll get an upside-down character. It also seems that the Vert size is based on the pixel size of the characters. Since my characters are each 128x128, putting 128 and -128 into the Vert Width and Height give me properly proportioned letters.

In other words, if you want to sit there and work out your entire font, it’s going to take about an hour, a calculator, and a lot of patience to get the positioning right. It’s a vastly inferior system to the old way of doing it, but since this is now the only way, this is how it’s done.

Hope it helps.

I just had this happen to me too, looks like Unity4 decided to rearrange the font when it converted the project and now the painted custom textures no longer match the font file. I’m assuming I’m going to have to export the newly arranged font and paint over it in photoshop again. Groan. :frowning:

EDIT: so I went to the wiki for the SaveFontTexture script and according to Eric the script is no longer needed as unity now has a way of creating an editable copy of your fonts from the gear menu in the inspector, see: http://wiki.unity3d.com/index.php?title=SaveFontTexture

I’m going right ahead and converting my fonts this way now.

Im waiting for an answer on this as well. Technically it is still a custom font but dealing with them is alot more difficult. Index refers to the decimal mapping in an ascii table to that character. (here’s a good list for that ASCII Table / character codes – SS64.com). UV XY/HW refers to the UV mapping on the font mesh in relation to the position in the texture (XY = Position, HW = height and width). Vert XY/HW refers to the position and scaled of the actual font mesh. (this is how you would get superscript and subscript characters)

Check out this on the Asset Store:

Lets you visually define the UV Rectangles for font bitmaps