4

I have been working with libgdx for some time. And I know that to load fonts from .ttf files added to the assets 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

1 回答 1

4

您不能在 android 中使用系统安装的字体。您需要将 ttf 文件放在 assets 目录中才能在 android 中使用上述库。

于 2013-06-28T12:32:38.387 回答