Example code for using Custom Fonts in Android. Roboto Font is taken as an example. This font needs to be used as custom font for API level < 11.
CustomFontsInAndroid is hosted in the following web site
https://github.com/sanjaymeena/CustomFontsInAndroid
If you think the Android project CustomFontsInAndroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
The following table is the detailed list of CustomFontsInAndroid.
Item | Value |
---|---|
Java File Count | 2 |
Target SDK Version | 17 |
Minimum SDK Version | 14 |
Activity Count | 1 |
jar files used | android-support-v4.jar |
Asset File Names | assets\fonts\Roboto-Black.ttf assets\fonts\Roboto-BlackItalic.ttf assets\fonts\Roboto-Bold.ttf assets\fonts\Roboto-BoldItalic.ttf assets\fonts\Roboto-Italic.ttf assets\fonts\Roboto-Light.ttf assets\fonts\Roboto-LightItalic.ttf assets\fonts\Roboto-Medium.ttf assets\fonts\Roboto-MediumItalic.ttf assets\fonts\Roboto-Regular.ttf assets\fonts\Roboto-Thin.ttf assets\fonts\Roboto-ThinItalic.ttf assets\fonts\RobotoCondensed-Bold.ttf assets\fonts\RobotoCondensed-BoldItalic.ttf assets\fonts\RobotoCondensed-Italic.ttf assets\fonts\RobotoCondensed-Light.ttf assets\fonts\RobotoCondensed-LightItalic.ttf assets\fonts\RobotoCondensed-Regular.ttf |
CustomFontsInAndroid has the following Java source files.
com.sanjaymeena.customfont.MainActivity.java com.sanjaymeena.customfont.widgets.RobotoTextView.java