Using custom fnt won't work with nifty?

Hi, I’m trying to use a custom font in my game for the text.

I can see my image, and on it theres white text. Problem is, It does not write letters, just rubbish.



I cant do screenshot as Im working on android, but heres my xml file.

[xml]<?xml version=“1.0” encoding=“UTF-8”?>

<nifty>

<screen id=“ingame” controller=“gui.GuiListener”>

<layer id=“layer2” childLayout=“vertical”>

<panel id=“launch2” childLayout=“center” height=“10%” width=“80%”>



<image filename=“assets/textures/button.png” valign=“center”

imageMode=“resize:6,20,6,6,6,20,6,20,6,20,6,6”>

<interact onClick=“resumeGame()” />



</image>

</panel>

</layer>

<layer id=“layer” childLayout=“vertical”>

<panel id=“launch” childLayout=“center” height=“10%” width=“80%”>



<text id=“text” text=“RESUME” style=“nifty-label”

textLineHeight=“10” textMinHeight=“10” font=“assets/etc/visitor.fnt”

align=“center” valign=“center” />

</panel>

</layer>



</screen>



<screen id=“end”>

</screen>

</nifty>[/xml]



I use the ingame screen.

The button works fine, the text is renderd upon it great, but it fails to write correct letters.

The fnt was converted from ttf to fnt using Hiero v2.0.

-I tried just converting it without changing anything, and it doesn’t work.

-I tried converting with just one image.

-I’v tried converting without special characters.

Originally the textLineHeight=“10” textMinHeight=“10” was not included. Nor was style=“nifty-label”

So, am I doing something wrong, or doesn’t custom text work yet on android?

You know that we have a fnt maker in the SDK that works flawlessly?

custom fonts works fine on android i’m using them all the time with or without nifty.



maybe you could look how the nifty’s default fault looks like and see what’s wrong with yours.

Or use the SDK :stuck_out_tongue:

1 Like

Hiero writes the font image upside down, therefore producing garbage for nifty. As nehon said, use the builtin Font Editor: File->New File->GUI->Font

1 Like

The problem is the sdk does not work on my computer.

I spent 2 days, total of 24 hours trying to fix it. It’s IMPOSIBURU!! :stuck_out_tongue:

But thanks :slight_smile:

All I needed to do was flip the image and it works fine! :smiley: