Set custom fonts in strings
android, android-fonts, android-xml, fonts
Solution
I have resolved my issue as below and with the help of the comments provided by `@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);
Thanks all for helping me and quickly.
Problem
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"; ``` 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"); ``` Can any one tell me how can i set the above fonts in my Strings variable. Any help will be appreciated . Thanks.