Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to return to default font in TextView

I know how to change the font of a TextView to my own font:

catTextView = (TextView)findViewById(R.id.CatText);
catTextView.setTypeface(Typeface.createFromAsset(getAssets(), "my_font_in_assets"));

However at a point during the app execution, I would like to set it back to the default font. I don't want to hardcode the font (write "Droid Sans") since the default font could change in future versions of Android (I think it actually did in ICS).

Is there any way to get the default font name of a TextView, and set it back to this after changing it?

Also, can I be sure the default font will always be able to show Russian or Japanese characters?

Thanks!

like image 600
zundi Avatar asked Dec 04 '22 06:12

zundi


1 Answers

Use setTypeface(Typeface.SANS_SERIF) on a TextView

like image 75
sinujohn Avatar answered Jan 02 '23 20:01

sinujohn