引用: http://blog.csdn.net/chenzheng_java/article/details/6233849


package cn.com.chenzheng_java;


import android.app.Activity;
import android.graphics.Typeface;
import android.os.Bundle;
import android.widget.TextView;
/**
* @description 有关字体设置
* @author chenzheng_java
*
*/
public class FontFaceActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fontface);

TextView textView = (TextView)findViewById(R.id.textView_fontface);
/**
* setTypeface(Typeface tf)设置字体
* setTypeface(Typeface tf, int style)设置字体,但是其中依旧还有一些倾斜度或者加粗等设置,则通过style进行设置
*/
/*textView.setTypeface(Typeface.DEFAULT_BOLD,Typeface.ITALIC);
textView.setText("中国人!");*/


Typeface tf = Typeface.createFromAsset(getAssets(), "font/ARIAL.TTF");
textView.setTypeface(tf,Typeface.BOLD_ITALIC);
textView.setText("中国人!字体设置则样!");

}
}


更多相关文章

  1. Android 同个TextView设置字体大小不一样
  2. android radiobutton选中字体颜色改变的方法
  3. android 按钮按下时改变字体颜色
  4. Android TextView 字体描边
  5. 调整recovery界面菜单字体大小
  6. android TextView的字体颜色设置的多种方法
  7. Android 字体加粗的两种方法
  8. android TextView自定义字体样式
  9. Android TextView使用HTML处理字体样式、显示图片等

随机推荐

  1. 解决Linux安装 VMware tools 工具的方法
  2. 为什么fork炸弹没有崩溃android?
  3. 汇总(之三):交叉编译工具链arm-none-linux-g
  4. yum和rpm安装zabbix 2.0.9 For centos 6
  5. 如何测试已部署的Web应用程序
  6. linux 使用yum给已安装的软件降级
  7. linux设置了 /etc/profile ~/.bashrc等配
  8. / usr / bin / ld:找不到-lcurl
  9. Linux-vfork与fork简单对比分析
  10. linux下Nload安装说明