How to load system fonts in Libgdx? Mostly for android. And how can I get a list of available fonts?

I have been working with libgdx for some time. And I know that to download fonts from .ttf files added to the resource folder, I can use "FreeTypeFontGenerator".

FreeTypeFontGenerator generator = new FreeTypeFontGenerator(gdx.files.internal("data/samplefont.ttf")); font = generator.generateFont(12); generator.dispose(); 

But I could not find anywhere how to use the fonts available in Android. Please, help.

+4
source share
1 answer

You cannot use system-installed fonts in android. You need to put the ttf file in the resource directory in order to use the above library in android.

+4
source

Source: https://habr.com/ru/post/1484227/


All Articles