【发布时间】:2018-09-02 21:35:25
【问题描述】:
这个问题让我发疯了,所以如果有人能够提供帮助,请提前谢谢!
我正在尝试在 Laravel 项目中使用自定义字体,但该字体不起作用,我在 Chrome 控制台中收到此消息:
Failed to decode downloaded font: https://womenbirthphoto.com/fonts/lucyrose-regular-webfont.woff
我对 .ttf 和 .woff2 字体有相同的信息。 这是我的 CSS 代码中的内容:
@font-face {
font-family: 'Lucy Rose';
src: url('../fonts/lucyrose-regular-webfont.eot');
src: url('../fonts/lucyrose-regular-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/lucyrose-regular-webfont.woff2') format('woff2'),
url('../fonts/lucyrose-regular-webfont.woff') format('woff'),
url('../fonts/lucyrose-regular-webfont.ttf') format('truetype'),
url('../fonts/lucyrose-regular-webfont.svg#lucy_roseregular') format('svg');
font-weight: normal;
font-style: normal;
}
文件的名称/路径是正确的。这些文件是通过 Fontsquirrel webfont 生成器生成的。
我觉得我什么都试过了,我不明白为什么会出现这个错误。该字体不适用于任何浏览器。
提前感谢您的帮助!
【问题讨论】:
标签: css laravel google-chrome fonts