Closed chuanxinwong closed 6 years ago
我在 mime中加了ttf 和 woff 的mime。 'ttf': 'application/octet-stream', 'woff': 'font/x-woff', 'woff2': 'application/font-woff2',
'ttf': 'application/octet-stream', 'woff': 'font/x-woff', 'woff2': 'application/font-woff2',
但是在浏览器中一直抱异常。
grids.html:1 Failed to decode downloaded font: http://127.0.0.1:3300/fonts/fontawesome-webfont.woff grids.html:1 OTS parsing error: incorrect file size in WOFF header grids.html:1 Failed to decode downloaded font: http://127.0.0.1:3300/fonts/fontawesome-webfont.ttf grids.html:1 OTS parsing error: incorrect entrySelector for table directory 请问这个怎么解决?
grids.html:1 Failed to decode downloaded font: http://127.0.0.1:3300/fonts/fontawesome-webfont.woff grids.html:1 OTS parsing error: incorrect file size in WOFF header grids.html:1 Failed to decode downloaded font: http://127.0.0.1:3300/fonts/fontawesome-webfont.ttf grids.html:1 OTS parsing error: incorrect entrySelector for table directory
试试在在服务器设置一下自己定义MIME类型。 扩展名: .woff Mime类型:application/x-font-woff 可以脑补一下ttf
感谢@prlei的回答, @chuanxinwong 添加一下字体的类型就好了哈
我在 mime中加了ttf 和 woff 的mime。
'ttf': 'application/octet-stream', 'woff': 'font/x-woff', 'woff2': 'application/font-woff2',
但是在浏览器中一直抱异常。
grids.html:1 Failed to decode downloaded font: http://127.0.0.1:3300/fonts/fontawesome-webfont.woff grids.html:1 OTS parsing error: incorrect file size in WOFF header grids.html:1 Failed to decode downloaded font: http://127.0.0.1:3300/fonts/fontawesome-webfont.ttf grids.html:1 OTS parsing error: incorrect entrySelector for table directory
请问这个怎么解决?