0

I have updated UIWebView to WKWebView. Fonts are not getting applies you can check following attached screen shots.

Fonts .ttf files are added in project. also in Copy Bundle Resources.

self.webView.loadHTMLString(textHtml, baseURL: Bundle.main.bundleURL)

[enter image description hereon

Added font-face in style.

@font-face
{
    font-family: 'Lato-Bold';
    src: url(Lato-Bold.ttf) format('truetype');
}

Using Xcode 11.3. Any missing link ?

Thanks in advance.

the1pawan
  • 1,194
  • 9
  • 26
  • double-check this answer here: https://stackoverflow.com/questions/25785179/using-custom-fonts-in-wkwebview – Damyan Todorov Mar 05 '20 at 13:59
  • @DamyanTodorov same i have checked multiple types. Could not get help from it. – the1pawan Mar 06 '20 at 05:03
  • try loading this style as css using user script while initialising WKWebview as described here: https://www.amerhukic.com/determining-the-content-size-of-a-wkwebview – sandy Mar 06 '20 at 08:29

0 Answers0