Custom Font to alphanumeric characters only Android.?

544 views Asked by At

I need to apply font for alpha numeric characters only. All special characters must be drawn with degault font. Is this possible in Android if yes then how ?

1

There are 1 answers

11
Phantômaxx On BEST ANSWER

See if this does match your needs

You can let all upper and lower case characters, as well as numbers have different styles, sizes, colors, ...

[EDIT 1]

You can:

mBox = new TextView(context);
mBox.setText(Html.fromHtml("<b>" + title + "</b>" +  "<br />" + 
    "<small>" + description + "</small>" + "<br />" + 
    "<small>" + DateAdded + "</small>"));

where you can use the HTML tag font-face

[EDIT 2]

Here's an example of using two different fonts on the same Spannable

link 1

Here it is shown how to load several different fonts from assets

link 2

By combining these two (and adding your code to compare each character to see if it falls in a case or the other) you should be able to get the results you're pursuing

I hope I helped.