Languge support for Gujrati and Hindi in android

前端 未结 3 1390
慢半拍i
慢半拍i 2021-02-04 19:24

Hi any body know how we can support Hindi and Gujrati Languge support in android. I used below code but it is not supported, I see only box.

I put string file in r

3条回答
  •  佛祖请我去吃肉
    2021-02-04 20:08

    As gujarati and hindi languages are not supported by Android, you can still give that support to your Application.

    For Gujarati copy the C:\WINDOWS\Fonts\Shruti.TTF file to your Assets folder click here to know how to make assets folder then use the following code.

    TextView text_view = new TextView(this);
    
    Typeface font = Typeface.createFromAsset(getAssets(), "Shruti.TTF");
    
    text_view.setTypeface(font);
    
    text_view.setText("ગુજરાતી");
    

    Shruti.TTF file is for Gujarati font. Similarly you can add support for hindi file.

提交回复
热议问题