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); } }
Read more of this post
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.