public TextView makeText(String type,int size) {Typeface face = Typeface.createFromAsset(getAssets(), type);TextVie" />
欢迎访问移动开发之家(rcyd.net),关注移动开发教程。移动开发之家  移动开发问答|  每日更新
页面位置 : > > > 内容正文

android 自定义字体 字体库 字体格式 使用攻略

来源: 开发者 投稿于  被查看 1910 次 评论:114

android 自定义字体 字体库 字体格式 使用攻略


先上图片;

\

\

\


部分关键代码:<喎?http://www.Bkjia.com/kf/ware/vc/" target="_blank" class="keylink">vcD4KPHA+PHByZSBjbGFzcz0="brush:java;">public TextView makeText(String type,int size) { Typeface face = Typeface.createFromAsset(getAssets(), type); TextView tv = new TextView(this); tv.setText(R.string.helloChina); tv.setTypeface(face); tv.setTextSize(size); return tv; }

showLay.addView(makeText("fonts/MetaSerifOT-Book.ttf",12));
		showLay.addView(makeText("fonts/MetaSerifOT-Book.ttf",18));
		showLay.addView(makeText("fonts/MetaSerifOT-Book.ttf",24));
		showLay.addView(makeText("fonts/MetaSerifOT-Book.ttf",36));

字体库文件加载位置;


用户评论