Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use Typeface with EditText in widget

Is it possible to use somehow Typeface font definition loaded from assets with EditText in widget ?

like image 253
hsz Avatar asked Oct 22 '22 21:10

hsz


1 Answers

The font you want to use needs to reside in the assets/fonts directory, and you access it like so:

Typeface myFont = Typeface.createFromAsset(getAssets(), "fonts/myfont.ttf");
edittext.setTypeface(myFont);
like image 177
Nipun Gogia Avatar answered Oct 28 '22 15:10

Nipun Gogia