google-fonts icon indicating copy to clipboard operation
google-fonts copied to clipboard

Readme doesn't show current way to load fonts using expo-splash-screen

Open theafolayan opened this issue 2 years ago • 4 comments

I was confused as to how to load google font's through the expo-splash-screen and I believe a couple more developers using the new SDK (45) would face the same as well.

Is it okay if I create a PR updating the current README to demonstrate that?

theafolayan avatar May 15 '22 14:05 theafolayan

so, when I received the log saying that the expo-app-loading was deprecated, I started to insert the new expo-splash-screen and it seems like it's required the Font.loadAsync() from expo-font... But after several tries, I think there's something wrong with the SDK, even following the documentation I keep receiving that the font I'm trying to use isn't being loaded by Font.loadAsync(), even though it is.

image

And this happens with any font I'm trying to use and have it downloaded locally, which I already think is bad because it can affect the application performance

How do you guys managed to use the new expo-splash?

herbertfuchs avatar Jun 01 '22 18:06 herbertfuchs

herbertfuchs Do you mind sharing the content of your App.js file here?

theafolayan avatar Jun 01 '22 20:06 theafolayan

herbertfuchs Do you mind sharing the content of your App.js file here?

So this is the way I'm currently using expo-google-fonts, it works perfectly excepts the fact that AppLoading is deprecated.

current


Since I knew that AppLoading is deprecated, I started inserting the new expo-splash-screen, but it requires a font loaded through Font.loadAsync, so seeing the examples in the docs I tried this way:

othermethod

  • I'm not receiving any error logs, but the application doesn't leave the SplashScreen

And just giving u more infos, I have a global theme to use the fonts ;)

globaltheme

herbertfuchs avatar Jun 02 '22 04:06 herbertfuchs

Hey @herbertfuchs ,

Can you explain a bit more about how you are loading it font with the theme?

itsdarrylnorris avatar Jun 27 '23 13:06 itsdarrylnorris