Does anyone know how I can use a TTF font in libGDX? I have looked around and have seen things about StbTrueTypeFont but it doesn’t seem to be in the latest release.
EDIT: I found the StbTrueType font stuff, the jar file is located in the extensions directory. I’ve added it to my project. Now I just need to figure out how to use it. Any examples?
Yes you will definitely need to add the
gdx-stb-truetypejars to your project as you stated in your edit. Here is how you will use it, pretty straighforward…First you need to declare your
BitmapFontand the characters you will use…Then you need to create the font…
You can play with the arguments you pass to
createBitmapFont()and you will see what they do.Then to render the font you would do it as you normally do…