我要显示在Arial字体的文本。但是,Arial字体是不是在android系统字体可用。我不想用Arial字体TTF文件在我的应用程序。是否有申请文本Arial字体任何其他方式。
I want to show text in Arial font. But Arial font is not available in android system fonts. I don't want to use arial ttf file in my application. Is there any other way to apply text with Arial font.
如果字体未在Android系统中可用,那么你必须要使用的字体文件来应用特定的字体说宋体你的的TextView
。我可以知道你为什么不愿意使用的字体文件的应用,因为它提供了相同的功能。
If the font is not available in the android system, then you have to use the font file to apply that particular font say arial to your textView
. May I know why you are not willing to use the font file to apply as it gives the same functionality.
用法示例使用的字体文件是:
Sample usage for using the font file is:
Typeface tfArial = Typeface.createFromAsset(getAssets(), "arial.ttf");
TextView tv = null;
// find the textview id from layout or create dynamically
tv.setTypeface(tfArial);
编辑:
您需要把字体文件 arial.ttf
在资产
文件夹。
You need to put the font file arial.ttf
in your asset
folder.