'How to add local font sizes from your app to AutoHeightWebView in React Native?

I have such component when I put some html and I want to have possibility to add font styles which I have locally in my project on both platforms (IOS and Android).

For example, in IOS I have such font style:

<key>UIAppFonts</key>
<array>
    <string>Gobold.otf</string>
</array>

When I add in html like <div style="font-style: Gobold"> - it doesn't work.

Also I tried to add it in customStyle but it also doesn't work:

            <AutoHeightWebView
                ref={(ref) => {
                    this.webview = ref;
                }}
                onNavigationStateChange={async (event) => {

                    if(event.url === 'about:blank'){
                        return
                    }

                    this.webview.stopLoading();
                    await navigationService.navigateToUrl(event.url);
                }}
                customStyle={`
                    div {
                        font-size: Gobold;
                    }
                `}
                style={styles.webViewStyle}
                source={{html: `<div>${html}</div>`}}
                scrollEnabled={false}
            />

So can anydobdy help me to solve this issue because it



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source