我在使用angular2中读取自定义字体时遇到此问题,在部署到服务器后,它在解码时出错。看一下屏幕截图。
这是fonts.scss
@font-face {
font-family: 'Decalotype';
font-weight: 300;
src: url('./assets/fonts/Decalotype-Light.eot'); /* IE9 Compat Modes */
src: url('./assets/fonts/Decalotype-Light.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('./assets/fonts/Decalotype-Light.woff2') format('woff2'), /* Super Modern Browsers */
url('./assets/fonts/Decalotype-Light.woff') format('woff'), /* Pretty Modern Browsers */
url('./assets/fonts/Decalotype-Light.ttf') format('truetype'), /* Safari, Android, iOS */
url('./assets/fonts/Decalotype-Light.svg#svgFontName') format('svg'); /* Legacy iOS */
}