如何添加字体在Android应用程序 [英] how to add font in Android Application

查看:175
本文介绍了如何添加字体在Android应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在该应用程序使一个应用程序的Andr​​oid 2.2 我想显示在TextView中的Andr​​oid应用程序印地文文本。 (如何添加मैंछात्रहूँ的文字字)

i am making one application in Android 2.2 in that application i want to show hindi text in TextView in Android application. (how to add "मैं छात्र हूँ" word in Text view)

请帮我..

推荐答案

添加您的字体资产的文件夹中的项目并使用下面的代码片段

Add your font to assets folder in your project and use the below snippet

 TextView hindiTextView=(TextView)findViewById(R.id.txtbx);
 Typeface hindiFont=Typeface.createFromAsset(getAssets(),"fonts/fontname.ttf");
 mytextView.setTypeface(hindiFont);

希望它帮助。

Hope its helpful.

这篇关于如何添加字体在Android应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆