Search code examples
windowslibgdxcross-platformnon-ascii-characters

libGDX TrueTypeFont font working with accented characters on windows


So we made a small hangman game, and because we are Hungarians we have those irritating accented characters. libGDX can perfectly draw these on Android and Linux, but it just skips them on Windows. I have included 3 screenshots from the 3 systems. The font is self-made ttf font, I have also included, it only has the required letters.

When generating the font I included the characters like so:

parameter.characters = "aábcdeéfghiíjklmnoóöőpqrstuúüűvwxyz_"

Font (Mega link)

  • Windows: Supposed to say sütőlap(oventop)
    Windows
  • Linux: pöröly(sledge hammer)
    Linux
  • Android: színész(actor)
    Android

Solution

  • So I ended up using the Apache commons-IO library and specifying utf-8 encoding for reading the file, as it turned out that was the problem.