0
点赞
收藏
分享

微信扫一扫

字体的使用


今天用到了这个东西 搜索到一个网站

http://www.urbanfonts.com/fonts/Xtrusion.htm

 

里面是字体下载的

关于字体的使用很简单

在asset里面建一个文件夹Fonts

然后直接

/* Setting up fonts */
Typeface fontFace = Typeface.createFromAsset(getAssets(), "fonts/xtrusion.ttf")
Typeface fontFace2 = Typeface.createFromAsset(getAssets(), "fonts/other.ttf");
TextView someText = (TextView)findViewById(R.id.TextView01);
TextView someOtherText = (TextView)findViewById(R.id.TextView02);
someText.setTypeface(fontFace);
someText.setTextSize(40.f);someText.setText("Hello Android");
someOtherText.setTypeface(fontFace2);
someOtherText.setTextSize(55.f);
someOtherText.setText("Some other text");

举报

相关推荐

0 条评论