When I use the Downloadable Fonts feature on Android, I can add a preloading strategy by adding this code to AndroidManifest.xml
:
<meta-data android:name="preloaded_fonts"
android:resource="@array/preloaded_fonts" />
When exactly is this loaded? On app startup? On installation? If it's on app startup, and I am using the font on the very first screen, is there any performance difference at all?
https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts#predeclaring-fonts
Layout inflation and resource retrieval are synchronous tasks. By default, the first attempt to retrieve fonts triggers a request to the font provider, and therefore increases the first layout time. To avoid the delay, you can pre-declare fonts that need retrieving in your manifest. After the system retrieves the font from the provider, it is available immediately. If the font retrieval takes longer than expected, the system aborts the fetching process and uses the default font.
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