参考资料如下
1.下载安卓字体库,后缀名是.ttf
2.在项目工程下assets 目录下创建fonts 文件夹
3.把.ttf 放入assets\fonts文件夹下
4. 在activity onCreate()下编辑代码
TextView scoreText = (TextView)findViewById(R.id.textView);
Typeface fontFace = Typeface.createFromAsset(getAssets(), "fonts/brlnsb.ttf");//brlnsb是字体库的名
scoreText.setTypeface(fontFace);
我自己的测试代码如下,在java下
TextView scoreText = (TextView)findViewById(R.id.textView);
Typeface fontFace = Typeface.createFromAsset(getAssets(), "fonts/brlnsb.ttf");//brlnsb是字体库的名
Typeface fontFace = Typeface.createFromAsset(getAssets(), "fonts/comic.ttf");//comic是字体库的名
Text_View1.setTypeface(fontFace);
Typeface fontFace1 = Typeface.createFromAsset(getAssets(), "fonts/GARAIT.TTF");//GARAIT是字体库的名
Text_View1 = (TextView)findViewById(R.id.textview1);
Text_View2 = (TextView)findViewById(R.id.textview2);
Text_View2.setTypeface(fontFace1);
CharSequence text1="名称123456";
CharSequence text2="名称123456";
Text_View1.setTextSize(20);
Text_View1.setText(text1);
Text_View1.setTextColor(0xffff0000);
Text_View2.setTextColor(0xffff0000);
Text_View2.setTextSize(20);
Text_View2.setText(text2);