I have two files that I got to use on my game … The first file is an extension. “Fnt” and the other file is an archive. “Png”
In this file “png” there is some numbers and letters …
As far as I’m aware, only .ttf fonts (TrueType fonts) are supported. .fnt is specifically a bitmap font, and .png is just an image file (not an archive, although it may look like one).
Your choices are either:
find some way to convert .fnt into .ttf (might be possible)
recreate the font yourself (online utilities like FontStruct are quite good for bitmap fonts).
You can use bitmap fonts for GUIText and 3DText objects; OnGUI code can only use .ttf. There’s some info about using a texture as a font here, though if you don’t have a matching .ttf font to supply the spacing info, then you have to set it up manually by doing Create → Custom Font and then setting up the info properly. (In the per-character kerning array, “first” is the character and “second” is the spacing.)
In Unity4 i can “create custom font”. I must create material, then assign texture font.png to material. Then i assign material to font. In a font properties i see “Character rects”. I understand, that i input data, similar to data in myfont.txt (fnt,xml)
…
char id=51 x=115 y=0 width=56 height=84 xoffset=4 yoffset=21 xadvance=65 page=0 chnl=15
char id=52 x=0 y=170 width=59 height=82 xoffset=1 yoffset=22 xadvance=65 page=0 chnl=15
…
but some data fields not corresponding with text files.
You wrote “then setting up the info properly”, but HOW i can do it. I don’t mind do it manually per each letter, but in what fields i must enter what data?
For starters, try setting “index” to your char id, “Vert” x/y/w/h to your x/y/width/height, “Width” to xadvance, and “Uv” x/y/w/h to your x/y/width/height, divided by texture size (ie if your texture is 256x256, then x=128 becomes 128/256 = 0.5 for Uv: x).
If x=128 and your texture size is 256, you could divide x by 256 to get 0.5, but then you have to do that for every character. I find it easier to set the tiling value for the material to 1/256 (or -1/256 for the y value), which is 0.00390625. Then in your Custom Font asset you can just use the x values as they appear in the text file.
I found this online generator that let me import my fonts,style them and then export straight to unity as an .fnt. I can’t find it for the life of me now.