How can i show Hindi text in Android Tablet

后端 未结 3 858
北荒
北荒 2020-12-09 23:02

I am developing an application in Android Tablet. Now in my application, I want to show Hindi text for all EditText and Buttons and also I need to get data

相关标签:
3条回答
  • 2020-12-09 23:37

    your custom apps you will most probably want to use your own font. This post will show you how you can do so. This is a simple example... create a folder in the root of your project called assets/fonts/ then paste the TTF font file (in this case Verdana.ttf). Then, if you want to apply that font to, say a TextView, do the following

    TextView im = (TextView ) findViewById(R.id.im);
    Typeface face=Typeface.createFromAsset(getAssets(),
                                              "fonts/hindi.ttf");
            im.setTypeface(face);
            im.setText("Hindi font");
    
    0 讨论(0)
  • 2020-12-09 23:38

    On Android phones, if you install a Hindi (Devanagari) font - you will then see glyphs for the characters but the letters won't join up or form conjuncts properly, so all but the simplest text will be unreadable. This is due to the lack of proper complex text layout (CTL) or rendering support in Android phones - I don't know if the situation is better on Android tablets.

    Sadly, Indic text doesn't even work properly in the Android 4.0 (ICS) emulator even though it was supposed to be fixed there.

    0 讨论(0)
  • 2020-12-09 23:43

    you can use Unicode ...for क ख

    TextView tv=(TextView)findViewById(R.id.textViewmyView);
    
    final Typeface tf = Typeface.createFromAsset(this.getAssets(), "Hindi-SARAL1.TTF");
    
    tv.setText(Html.fromHtml("&# 2325;&# 2326;"));
    
    tv.setTypeface(tf);
    

    use Unicode value continues no gap....

    this code is working for all alphabets of Hindi except.क्ष,त्र and ज्ञ for this you can use......

    for क्ष:- tv.setText("9");

    for त्र :- tv.setText("5");

    and for ज्ञ:- tv.setText(")");

    after that

    tv.setTypeface(tf);
    
    0 讨论(0)
提交回复
热议问题