首页 > 移动平台 > 详细

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

时间:2014-04-10 03:55:14      阅读:444      评论:0      收藏:0      [点我收藏+]

先上图片;

bubuko.com,布布扣

bubuko.com,布布扣

bubuko.com,布布扣


部分关键代码:

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));

字体库文件加载位置;

bubuko.com,布布扣

android 自定义字体 字体库 字体格式 使用攻略,布布扣,bubuko.com

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

原文:http://blog.csdn.net/jiaruihua_blog/article/details/23269943

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!