我将自定义字体应用于a TextView,但似乎没有更改字体.
这是我的代码:
Typeface myTypeface = Typeface.createFromAsset(getAssets(), "fonts/myFont.ttf");
TextView myTextView = (TextView)findViewById(R.id.myTextView);
myTextView.setTypeface(myTypeface);
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮我解决这个问题吗?
我已经阅读了一些文章并在谷歌上搜索过,但我没有做到.
我的问题是关于font-face.
在Android中,只有4个属性"android:typeface":Normal,Sans,Serif,Monospace.
那么在我的应用程序中使用"Verdana"需要做些什么呢?
请建议我在Android应用程序中使用此字体的正确方法.