【发布时间】:2014-12-12 10:37:11
【问题描述】:
有谁知道如何在 WebView 中加载自定义字体?
我尝试过的:
@font-face {
font-family: 'Gloria Hallelujah';
font-style: normal;
font-weight: 400;
src: url(Gloria.woff);
}
根据this。
但问题是,这仅在我们调用WebView.Navigate(urlToHtmlDocWithCustomFonts);时才有效
但在我的情况下,我打电话给WebView.NavigateToString(htmlStringWithCustomFonts);,在这种情况下自定义字体不起作用!
如果您想复制,这里是该教程的源代码:link。
所以我的问题是,是否可以使用自定义字体将 html 字符串加载到 webview 中?
【问题讨论】:
标签: c# fonts webview windows-runtime microsoft-metro