Friday, March 6, 2015

Set a TTF font to TextView

Place the font in assets folder

Example for Android studios: app/src/main/assets/font.ttf

Typeface typeface = Typeface.createFromAsset(getAssets(), "font.ttf");
TextView textView = (TextView) findViewById(R.id.textview_name);
textView.setTypeface(typeface);

No comments:

Post a Comment