Miguel is a professional software developer that has helped (volunteer and consulting) for dozens of companies through his firm Eridem AB.
Follow my @softwareInANutshell comics on Instagram!
In order to use custom fonts in some
Views, we need to import the font files to the folder
/assets/font/ and apply the typeface to the
View (not all views support it, some examples are
RadioButton, and so on). Here an easy example using
+ assets + font - Arial.ttf
// YourActivity.java Typeface fontResource = Typeface.createFromAsset( context.getAssets(), "font/Arial.ttf"); TextView textView = (TextView) this.findViewById(R.id.tv1); textView.setTypeface(fontResource);