如何在 UIWebview 中包含自定义字体?
How to include custom font in UIWebview?
如何将 info.plist 中添加的自定义字体包含到 Webview 的 html 页面中。
html 作为字符串包含在内
目前包括字体为
@font-face{font-family:'PrStart';src:local('PrStart'),url('PrStart.otf') format('opentype');}
但它不起作用
您可以执行以下操作:
let string = "<font face='font-name' size='2'>" + "Your String"
并从此字符串加载 webview。
如何将 info.plist 中添加的自定义字体包含到 Webview 的 html 页面中。 html 作为字符串包含在内
目前包括字体为
@font-face{font-family:'PrStart';src:local('PrStart'),url('PrStart.otf') format('opentype');}
但它不起作用
您可以执行以下操作:
let string = "<font face='font-name' size='2'>" + "Your String"
并从此字符串加载 webview。