一 使用android提供的系统字体
在布局文件中添加 android:typeface=“ normal”
api文档中定义typeface共有4种其中normal为默认字体
Typeface (normal, sans, serif, monospace) for the text
二使用自定义的字体
首先需要将字体文件xxx.ttf文件放到asset/font/ 文件夹中
Typeface ty = Typeface.createFromAsset(getAssets(), "font/times.ttf");