我正在制作一个应用程序,其中我必须使用helvetica neue字体的文本,但问题是,我不知道如何在android中使用helvetica字体.我的问题是,做android支持helvetica字体,它是的然后如何使用那个字体,因为我无法在windows-preference-general-appreance-color和fonts中找到helvetica字体.任何帮助将不胜感激.谢谢.
use*_*305 22
place the TTF file in the ./assets directory (create it if it doesn’t exist yet).
Run Code Online (Sandbox Code Playgroud)
然后在你的活动中,
1. TextView txt = (TextView) findViewById(R.id.custom_font);
2. Typeface font = Typeface.createFromAsset(getAssets(), "<font file name>.ttf");
3. txt.setTypeface(font);
Run Code Online (Sandbox Code Playgroud)
欲了解更多信息,请查看: