https://developer.android.com/preview/features/working-with-fonts.html
Android API 26 supports this but do we have a support library that can provide use of fonts as a resource in res? [ font in XML ] If yes, up-to what API is it supported?
I am talking about the Android O SDK feature which allows us to set font in XML as given in the link above. This is not a native feature in MM I m sure.
GO Launcher Long press on the home screen and select GO Settings > Font > Select Font. Pick the font you want or tap Scan to add files stored on your device.
According to Google it is supported on Android 4.0+ (API 14+) as long as these conditions are met:
Sources:
Fonts in XML - Using the support library
Support Library revision history
I was hoping I could use this in app widgets on Android versions earlier than 8 (API 26), however it's not possible, as AppCompatTextView cannot be used in app widgets. None of the third party alternatives to Android O's 'Fonts in XML' such as the Caligraphy library work in app widgets either.
The only alternative for app widgets is using an ImageView instead of a TextView and using RemoteViews methods such as setImageViewUri(...) and setImageViewBitmap(...), both of which are problematic.
To support font family on API
lower than 26, we need to use
<font app:fontStyle="normal" app:fontWeight="400" app:font="@font/myfont-Regular"/>
instead of
<font android:fontStyle="normal" android:fontWeight="400" android:font="@font/myfont-Regular"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With