GrI*_*sHu 3 fonts android android-fonts android-xml
I have a custom fonts BebasNeue.otf which i want to set in the strings variables. I have searched a lot but did not get any solution.
I know we can set the custom fonts in views like textView.setTypeface(font);. But now i want to set the fonts to the Strings which i have as below :
String Name,Contact;
Name="ABCD";
Contact="97696538";
Run Code Online (Sandbox Code Playgroud)
This all the strings contains some values. Now i want to set the custom fonts to all the strings which is below:
Typeface fontString = Typeface.createFromAsset(m_context.getAssets(),
"BebasNeue.otf");
Run Code Online (Sandbox Code Playgroud)
Can any one tell me how can i set the above fonts in my Strings variable.
Any help will be appreciated .
Thanks.
我已经解决了我的问题,如下所示,并在 提供的评论的帮助下@ASP。
Typeface fontString = Typeface.createFromAsset(m_context.getAssets(),
"BebasNeue.otf");
Paint paint = new Paint();
paint.setTypeface(fontString);
mCanvas.drawText("ID :" + m_sId, dw - 450, dh - 350, paint);
Run Code Online (Sandbox Code Playgroud)
感谢大家对我的快速帮助。
| 归档时间: |
|
| 查看次数: |
6955 次 |
| 最近记录: |