我想在 Android 4.0 及以上的设备中显示泰卢固语字体 泰卢固语字体将自动支持,但我在 4.0 以下的设备中遇到问题。我使用了以下代码,但泰卢固语无法正确呈现。
Typeface tf= Typeface.createFromAsset(this.getAssets(), "fonts/gautami.ttf");
TextView telugu=(TextView)findViewById(R.id.telugu);
telugu.setTypeface(tf);
telugu.setText("హైదరాబాద్");
请帮我解决这个问题。提前致谢。
最佳答案
删除 /font
以解决您的问题
您可以使用名为 fonts 的子文件夹,但它必须位于 assets
文件夹中,而不是 res
文件夹中.
assets/res
安卓
TextView telugu = (TextView) findViewById(R.id.telugu);
Typeface Typefacetf = Typeface.createFromAsset(getAssets(), "gautami.ttf");
telugu.setTypeface(Typefacetf);
telugu.setText("హైదరాబాద్");
关于android - 如何在android中显示泰卢固语字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23424724/