How to Change the FontFamily in a TextView
android:fontFamily added in API Level 161. Add a TextView to your activity.
2. Ensure your minSdkVersion is 16, or greater.
3. In the main.xml file, add the below line
<TextView
....
android:fontFamily = "sans-serif"
/>
4. To make other fonts
android:fontFamily="sans-serif" // roboto regular
android:fontFamily="sans-serif-light" // roboto light
android:fontFamily="sans-serif-condensed" // roboto condensed
android:fontFamily="sans-serif-thin" // roboto thin (android 4.2)
5. Compile and run!
....
android:fontFamily = "sans-serif"
/>
4. To make other fonts
android:fontFamily="sans-serif" // roboto regular
android:fontFamily="sans-serif-light" // roboto light
android:fontFamily="sans-serif-condensed" // roboto condensed
android:fontFamily="sans-serif-thin" // roboto thin (android 4.2)
5. Compile and run!
Resources:
http://developer.android.com/reference/android/widget/TextView.html#attr_android:fontFamily
http://developer.android.com/reference/android/R.attr.html#fontFamily
http://stackoverflow.com/questions/12128331/how-to-change-fontfamily-of-textview-in-androidhttp://commondatastorage.googleapis.com/androiddevelopers/design/Roboto_Specimen_Book_20111129.pdf