1, set in the layout file
//set font
android:typeface="normal" //sans serif monospace
Settings and styles
android:textStyle="normal" //bold bold italic italic
android:fontFamily=""
2.java code settings
textVie.setTypeface(Typeface.DEFAULT); //Set the font, which is equivalent to setting the android:typeface attribute in xml
textVie.setTypeface(Typeface.DEFAULT,Typeface.BOLD_ITALIC); //Set the font and style
Equivalent to setting the android:typeface attribute and android:textStyle attribute in xml