无法解码Chrome中下载的字体

时间:2018-07-23 06:55:07

标签: vue.js fonts stylus

在我的项目中,我使用字体图标。

我在icon.styl文件中定义了icon-close,这是核心代码:

@font-face {
font-family: 'sell-icon';
 src:  url('/src/common/fonts/sell-icon.eot?o23a15');
 src:  url('/src/common/fonts/sell-icon.eot?o23a15#iefix') format('embedded-opentype'),
 url('/src/common/fonts/sell-icon.ttf?o23a15') format('truetype'),
 url('/src/common/fonts/sell-icon.woff?o23a15') format('woff'),
 url('/src/common/fonts/sell-icon.svg?o23a15#sell-icon') format('svg');
 font-weight: normal;
 font-style: normal;
}

[class^="icon-"], [class*=" icon-"] {
/* use !important to prevent issues with browser extensions that change fonts 
 */
 font-family: 'sell-icon' !important;
 speak: none;
 font-style: normal;
 font-weight: normal;
 font-variant: normal;
 text-transform: none;
 line-height: 1;

/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
 }

.icon-keyboard_arrow_right:before {
 content: "\e900";
}
.icon-close:before {
  content: "\e901";
}
.......

现在,我想在head.vue文件中使用它:

<div class="detail-close">
     <i class="icon-close"></i>
</div>
<style lang="stylus" rel="stylesheet/stylus">
  @import "../../common/stylus/mixin"
  @import "../../common/stylus/icon.styl"

但是我有错误:

 Failed to decode downloaded font: 
 http://X.X.X.X:8080/src/common/fonts/sell-icon.ttf?o23a15

谁可以帮助我?

0 个答案:

没有答案