複数の言語で SMS アプリを作成しています。ヒンディー語の場合、DroidHindi.ttf ファイルを assets/fonts フォルダーに含めました。これを使用して、テキストビューとボタンにこれを実装できます:-
Typeface face;
face = Typeface.createFromAsset(this.getAssets(), "fonts/DroidHindi.ttf");
TextView font1 = (TextView) findViewById(R.id.tv1font);
font1.setTypeface(face, Typeface.BOLD);
TextView font2 = (TextView) findViewById(R.id.tv2font);
font2.setTypeface(face, Typeface.BOLD);
Button bfont = (Button) findViewById(R.id.btnsend);
bfont.setTypeface(face, Typeface.BOLD);
そして、それは完全に正常に機能しています。
ただし、トースト メッセージを表示している間は実装できません。
Toast.makeText(getBaseContext(), R.string.toast_msg ,Toast.LENGTH_SHORT).show();
このコードに加えて、DroidHindi.ttf ファイルを実装する必要があります。
それを行う方法はありますか?