Java 如何在Android中支持unicode字体?

Java 如何在Android中支持unicode字体?,java,android,web-services,unicode,Java,Android,Web Services,Unicode,我需要在我的应用程序中显示印地语和孟加拉语字体支持。如何做到这一点。请帮助。 另外,请告诉我如何从XML获得支持,因为我需要通过web服务获取数据。我所做的是将一种特定的字体放在assets文件夹中,并使用以下代码: public class CustomTextView extends TextView{ public CustomTextView(Context context, AttributeSet attrs, int defStyle) { super(co

我需要在我的应用程序中显示印地语和孟加拉语字体支持。如何做到这一点。请帮助。
另外,请告诉我如何从XML获得支持,因为我需要通过web服务获取数据。

我所做的是将一种特定的字体放在assets文件夹中,并使用以下代码:

public class CustomTextView extends TextView{
    public CustomTextView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        initFont();
    }

    public CustomTextView(Context context, AttributeSet attrs) {
        super(context, attrs);
        initFont();
    }

    public CustomTextView(Context context) {
        super(context);
        initFont();
    }

    private void initFont() {
        Typeface tf = Typeface.createFromAsset(getContext().getAssets(),"myfont.ttf");
        setTypeface(tf);
    }
}
但我面临的问题是,即使我在模拟器中获得字体,一些字体模式也不正确


如果有人想在我的答案中添加更多内容,欢迎回复。

我想+1表示对印地语和孟加拉语字体的请求,但-1表示对XML的支持,因此不会对这一项进行投票。标准android API中提供了XML支持。请仔细阅读。我遇到了这个问题。我所做的是将unicode字体转换为标准ASCII字体。现在它可以在所有API上工作。