Using Custom Fonts in Webview

Hey guys. I have some HTML that I am trying to inject in a WebView, and I would like to use some of the fonts I’ve bundled in the app on the text inside of the WebView. Do you guys have any ideas as to how I could go about doing this?

1 Like

I can’t think of an easy way to share fonts loaded between RN and the WebView, so you’ll probably have to use @font-face or something like that in your CSS to load them over the web by URL.

If you wanted, you could conceivably figure out the local URL on your device where Expo stores your bundled font, and then use that as the src of the font in the WebView. I don’t know if that would work but you could play around with trying it.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.