# How can I use OpenType Font in libGDX

Is there a way I can use an OTF file with libGDX.

The following throws an exception:

gameFont = new BitmapFont(Gdx.files.internal("data/font.otf"));


Not directly, but you could create a font for libgdx from a .otf using the Hiero tool to convert your font, or create one at runtime but (like the author of this site says), it's something that you should try to avoid.
An example of how to load an .otf font can be found here