引用: 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(安卓)统计图表引擎 AChartEngine(三) - 示例源码折线图
  2. Android实现录制视频
  3. android沉浸式状态栏和虚拟按键
  4. Android里面WebView加载HTML里面点击按钮调我Android方法
  5. android之ArrayAdaper之Spinner
  6. android通知栏Notification用法
  7. Android(安卓)同个TextView设置字体大小不一样
  8. Android(安卓)之 ProgressBar用法介绍
  9. Android自定义Dialog以控制其位置和宽高

随机推荐

  1. Android菜单的使用Menu
  2. Android 4.0市场份额增至21%,Android4.1仅
  3. Android图形库Skia(四)-生成PDF
  4. Android 扫码盒子全局接收付款码(全局事件
  5. Android根文件系统的启动过程
  6. 采用XMPP协议实现Android推送
  7. Parcalable接口使用(android传递结构体数
  8. android中的gravity和…
  9. Android 的 SQLLite数据库
  10. Android SQLite框架greenDAO的使用