[Nifty] Custom font ? -- Solved

Hello,



What do you people use to create new fonts ?

I will need to create mines soon :slight_smile:

I used the Slick2d Bitmap Font tool which is written in Java and available open source too. It was available online as a webstart somewhere too but I can’t find it at the moment.



Another solution would be to use the original bitmap font tool from angelcode. The .fnt format should be the same.

Ok, thanks!

I will try that tomorrow ( it’s 2:33 AM where I live )



Happy Christmas !

Hello,



I’ve found the jnlp :

http://slick.cokeandcode.com/demos/hiero.jnlp



I tried to use it - but I get font like that :





Seems like it gives me the font in the glyph format - don’t understand why xD

I will try to seach further more on my own but if it’s a problem you have already experienced … :smiley:



Edit :

With BMFont I manage to create my own fonts.

There is some configuration to do on the export format.



Here is something that works ( The important part is ‘output file’ ) :


# AngelCode Bitmap Font Generator configuration file
fileVersion=1

# font settings
fontName=Andalus
charSet=0
fontSize=25
aa=1
scaleH=100
useSmoothing=1
isBold=0
isItalic=1
useUnicode=1
disableBoxChars=1
outputInvalidCharGlyph=0

# character alignment
paddingDown=0
paddingUp=0
paddingRight=0
paddingLeft=0
spacingHoriz=1
spacingVert=1

# output file
outWidth=256
outHeight=256
outBitDepth=32
fontDescFormat=0
fourChnlPacked=0
textureFormat=png
textureCompression=0
alphaChnl=0
redChnl=4
greenChnl=4
blueChnl=4
invA=0
invR=0
invG=0
invB=0

# outline
outlineThickness=0

# selected chars
chars=32-127,160-255,305,338-339,352-353,376,381-382,402,710-711,732,1548,1563,1567,1569-1594,1600-1618
chars=1620-1621,1632-1642,1645,1648-1649,1652,1662,1670,1688,1700,1705,1711,1740,1749,1764,1776-1785,8204
chars=8205-8207,8211-8212,8216-8218,8220-8222,8224-8226,8230,8240,8249-8250,8364,8482,9676,64336-64337
chars=64342-64345,64362-64365,64378-64381,64394-64395,64398-64405,64488,64508-64509,64606-64610,64754
chars=64755-64756,64828-64831,65010,65020,65136-65138,65140,65142-65276,65279,119155-119162,917505,917536
chars=917537-917631

# imported icon images

That looks odd :smiley:



It looks like some font coordinates are messed up. How many pages of font bitmaps did hiero produce? Did you copy them all over?



I’ve seen this kind of effect before and it always was a problem that the .fnt file did not match the bitmaps (f.i. if you use a .fnt from one font together with the images of another).



How many pages did you create (the Glyph cache option in Hiero)?

Can you make the fnt and the images you’ve created somewhere online available?

Oh, and you’re still using a JME3 Nightly Build, right? Fonts are currently rendered by the Nifty RenderDevice implementations, so it is possible that the JME3 Bitmap Font rendering has a problem with this specific Font. I’d like to check tho :slight_smile:

My web server is currently down for maintenance. I will upload a fontTest when it will be back. :slight_smile:





For the screenshot of the previous post I had 13 png file with some strange characters inside each ( at most 6 characters inside each file )

13 png files? That’s a lot! Can you consider having a bigger texture size, like 512x512 or so? I’m pretty sure older versions of the font rendering only supported a single texture for this - maybe this explains the issue :slight_smile:



As you’re using JME3 and I’m sure that the Nifty Renderer for JME3 uses the build in BitmapFont of JME3. Anyone aware of some limit of texture count for the bitmap font rendering inside JME3? Maybe that’s the issue here…

Ha, you’re right ! Page Width = 32



I will try to change that !



I specified the same page width I used for BMFont but that doesnt solve the problem :frowning:

Inside the exported png file, I have only characters like


ÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷
øùúûüýþÿ

Perhaps it's the hiero.jnlp I used that is not good....

Here is a link to a zip file that contains my jnlp file and the exported font test : http://www.aschiehle-tribulations.net/voyage/public/divers/testFont.zip
If you want to check something :)

can you try to flip the png upside down? I think that hiero writes the png upside down! :smiley:



you could try to use the NEHE characterset instead of the full ASCII that will get rid of all that special characters (if you don’t need them that is)

That was the tip !



With a glyph 256x256, NEHE characters, and a flip after export it works !



Another little tips for those who want to try :

Don’t forget to set the font Color to White if you want to specify it inside the nifty xml !