public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Typeface font = Typeface.createFromAsset(getAssets(), "fonts/bebas_neue_regular.ttf");
TextView tvNormal = (TextView) findViewById(R.id.normal);
tvNormal.setTypeface(font);
TextView tvBold = (TextView) findViewById(R.id.bold);
tvBold.setTypeface(font, Typeface.BOLD);
TextView tvItalic = (TextView) findViewById(R.id.italic);
tvItalic.setTypeface(font, Typeface.ITALIC);
TextView tvBoth = (TextView) findViewById(R.id.boldItalic);
tvBoth.setTypeface(font, Typeface.BOLD_ITALIC);
}
}
Font plainFont = new Font("Arial", 0, 10); // PLAIN
Font boldFont = new Font("Arial", Font.Bold, 10); // BOLD
Font italicFont = new Font("Arial", Font.Italic, 10); // ITALIC
Font boldItalicFont = new Font("Arial", Font.Bold + Font.Italic, 10); // BOLD and ITALIC