How to Set the Typeface to Sans, Serif, or Monospace in a TextView/EditText
added in API Level 1Default typeface (normal, sans, serif, monospace) for the text.
1. Create an Android project, if you don't already have one.
3. In the main.xml file, add the code below.
This will set the text to monospace.
...
android:typeface = "monospace"
/>
4. To set it to sans, android:typeface = "sans"
Sans is a simple font.
To set it to serif, android:typeface = "serif"
In Serif, the characters are a little bit wider than in sans. Serif has the extra little horizontal lines on the fonts.
Monospace: is similar to sans, but has more spacing between characters. Monospace is wider than serif.
To set it to normal (which defaults to sans), android:typeface = "normal"
5. Compile and run!
Related Articles:
Resources:
http://developer.android.com/reference/android/R.attr.html#typeface
http://mobile.tutsplus.com/tutorials/android/customize-android-fonts/