1

Hello I try to display special charscters "äöü". I using I18NBundle to store strigs. But the problem shouldn't be here becose if I print it to the console

System.out.println(bundle.get(key));

It does display "äöü".

If I try to get the glyph out of the LabelStyle:

    BitmapFont.Glyph glyph = labelStyle.font.getData().getGlyph('ö');
    Gdx.app.log(String.valueOf(glyph.id), glyph.toString());

I get a NullPointerException.

I did get my BitmapFont from Hiero-4 and did pack the png into TexturePacker.

TextureAtlas background = manager.get(Const.BACKGROUNDS_PATH);
skin_bg = new Skin(Gdx.files.internal(Const.BACKGROUNDS_STYLE_PATH), background);

"com.badlogic.gdx.graphics.g2d.BitmapFont": {
    "arial": { "file": "images/arial.fnt" }
}

EDIT: I cecked the lwjgl version: 2.9.2 it shouldn't be because of this lib. Bug is after 2.9.1

How could I test if the BitMapFont can display Special Characters

Dario Kowalski
  • 599
  • 4
  • 14
  • What lwjgl library version are you using? Perhaps your problem is related to [this question](http://stackoverflow.com/questions/21416741/special-characters-in-libgdxs-textfield-i-can-set-but-input-from-keyboard-does/21570364#21570364)? – Balder Oct 10 '15 at 07:23
  • 1
    Are you sure you put those characters in your font in Heiro? – Tenfour04 Oct 10 '15 at 14:02
  • Question 1: I don't know what version I use. I just have downloaded the last version of LibGDX 1.6.1 Question 2: I use the first one: Arial and do change nothing. Just save.. If i try "äöü" the terminal from heiro-4 does show them corectly. – Dario Kowalski Oct 10 '15 at 21:00

1 Answers1

0
"com.badlogic.gdx.graphics.g2d.BitmapFont": {
    "arial": { "file": "images/arial.fnt" }
}

This just makes the font available on the skin, you need to add it to the actual styles, so that it is used:

com.badlogic.gdx.scenes.scene2d.ui.Label$LabelStyle: {
    default: { font: arial, fontColor: white }
}
Pinkie Swirl
  • 2,295
  • 1
  • 18
  • 25