一部の要素のフォントの書体を変更するアプリがあります。ほとんどの人にとってはうまくいきますが、フォントを変更しようとすると、0.5% の例外が発生する可能性があります。スタック トレースの重要な部分は次のとおりです。
Caused by: java.lang.RuntimeException: native typeface cannot be made
at android.graphics.Typeface.<init>(Typeface.java:147)
at android.graphics.Typeface.createFromAsset(Typeface.java:121)
私が言うように、それはほとんどの人にとって機能するので、フォント ファイルや私のコードの問題ではないと思います。これを解決する方法について何か提案はありますか?
編集:これは私のコードです:
Typeface phoneticFont = Typeface.createFromAsset(getAssets(),
"fonts/CharisSILR.ttf");
TextView tv;
tv = ((TextView) findViewById(R.id.searchPronunciationTitle));
tv.setTypeface(phoneticFont);