我无法理解为什么我收到一个控制台错误,指出浏览器拒绝加载字体。
我的CSS:
@font-face {
font-family: 'gt_walsheimmedium';
src: url('gt-walsheim-medium-web-webfont.eot.html');
src: url('gt-walsheim-medium-web-webfont.eot-.html#iefix') format('embedded-opentype'), url('gt-walsheim-medium-web-webfont.woff.html') format('woff'), url('gt-walsheim-medium-web-webfont.ttf.html') format('truetype'), url('gt-walsheim-medium-web-webfont.svg.html#gt_walsheimmedium') format('svg');
font-weight: normal;
font-style: normal;
}
错误
[Error] Refused to load the font 'data:font/woff;base64,d09GRgABAAAAAIw4ABEAAAABQcAAAQABAAAAAAAAAAAAAAAAAAAAAAAAAABHUE9TAAABgAAACU8AABMOD1XXMEdTVUIAAArQAAAAUwAAAHCOOI56T1MvMgAACyQAAABbAAAAYNrnrZBjbWFwAAALgAAAAIEAAAC0jBiQAGN2dCAAAAwEAAAAKgAAAC4HyBmgZnBnbQAADDAAAAOBAAAG5XJackBnYXNwAAAPtAAAAAwAAAAMAA0AGGdseWYAAA/AAABViQAAvQzAr6AGaGVhZAAAZUwAAAA2AAAANvzd8kdoaGVhAABlhAAAAB8AAAAkD/YHpGhtdHgAAGWkAAACFAAAA26BW0HVa2VybgAAZ7gAAB/3AABeRKoEucNsb2NhAACHsAAAAb4AAAG+1eip6m1heHAAAIlwAAAAIAAAACAByAf2bmFtZQAAiZAAAADEAAABYBoFNRJwb3N0AACKVAAAAZYAAAJBVvgNXnByZ...KKKqa4EkoqpbQyyiqnvAoqqqSyKqqqproaaqqltjrqqqe+BhpqpLEmmmqmuRZaaqW1Ntpqp70OOuqksy66BhE2m2Gms1Z5Z5ZF5ltrpy1BpHlemm65H35aaLU5Lnvru3V2+e2XPzbZ66br9ummuyV6uK2nG26574677nmvl0ceeGi/3r5Z6qnHnujjo8/m6qev/gYaYJANBhtqiGGGG2mEUUb7YIxxxhpvoglO2GiySaaY6pMvTnnmgIOee+OFQw475rgrjjjqqtnOOe9MEOWrCy4G0UFMEBvEBfFB+N9Y/EJ9fNhL8zINDBwNoLQLi2tpUT5XelFiWapecmJxKm9KZmpRanFmMZjHlZhcWgKR4E/OLEouzU3LSa0A8zmLMvPSIYpKMnNSIIoAYXqDQQAAuQgACABjILABI0QgsAMjcLAURSAgsChgZiCKVViwAiVhsAFFYyNisAIjRLMJCgMCK7MLEAMCK7MRFgMCK1myBCgGRVJEswsQBAIrAA==' because it violates the following Content Security Policy directive: "default-src 'none'". Note that 'font-src' was not explicitly set, so 'default-src' is used as a fallback.
即使在谷歌搜索和阅读之后,我也不清楚内容安全策略。
答案 0 :(得分:1)
我想这可以解决问题:
@font-face {
font-family: 'gt_walsheimmedium';
src: url('gt-walsheim-medium-web-webfont.eot');
src: url('gt-walsheim-medium-web-webfont.eot#iefix') format('embedded-opentype'),
url('gt-walsheim-medium-web-webfont.woff') format('woff'),
url('gt-walsheim-medium-web-webfont.ttf') format('truetype'),
url('gt-walsheim-medium-web-webfont.svg#gt_walsheimmedium') format('svg');
font-weight: normal;
font-style: normal;
}