Fonts feature can be used from Android O version. You can create "font" folder in resources folder of your application. Below Font features are providing in Android O release.
Fonder name in Android application: res/font/
- Fonts in XML
- System Fonts
Fonder name in Android application: res/font/
Using Fonts in XML file:
Using Fonts Programatically:
For more information, Check in official Android developer documentation.
https://developer.android.com/preview/features/working-with-fonts.html
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:fontFamily="@font/lobster"/>
Typeface typeface = getResources().getFont(R.font.myfont); textView.setTypeface(typeface);Retrieving System Fonts:
FontManager fontManager = context.getSystemService(FontManager.class); FontConfig systemFontsData = fontManager.getSystemFonts();
https://developer.android.com/preview/features/working-with-fonts.html
great
ReplyDelete