如何在android应用程序中使用punjabi字体? [英] how to use punjabi font in the android application?

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

问题描述

嗨我想开发一个应用程序,我想在其中使用旁遮普语文本.但是我的模拟器不显示旁遮普语文本.是否有任何 api 或其他东西,以便我的模拟器可以显示旁遮普语文本或建议我在我的应用程序中实现旁遮普语的任何其他方式.

hi i want to develop an application in which i Want to use punjabi text. But my emmulator does not show Punjabi text. Is there any api or something else so that my emulator can show the punjabi text or suggest me any other way to implement punjabi language in my application.

提前致谢.

推荐答案

您可以通过将 .ttf 文件复制到项目的assets"文件夹中来使用自定义 TrueType 字体.

You can use custom TrueType fonts by copying the .ttf file into your projects's 'assets' folder.

然后在您的应用程序中您可以使用这样的字体;

Then in your application you can use the font like this;

final Typeface customF = Typeface.createFromAsset(this.getAssets(), "custom.ttf");
final TextView textV = (TextView) findViewById(...);
textV.setTypeface(customF);

但是,我在尝试使用 TrueType 字体时遇到了很多问题,因此您可能想对您的 (pubjabi) 字体进行一些实际测试.

However i've had so many problems trying to use TrueType fonts so you might want to do some real life testing with your (pubjabi) font.

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

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