@ font-face找不到字体文件,我确认该文件的路径正确

问题描述

为了更有效地沟通,我将首先发布我的Github地址。 https://github.com/dumplings/iconfont

在根路径上有一个demo.html文件,我将css文件链接到头部,当我通过chrome打开html文件时,我看不到在网络上下载的字体文件

css结果如下:

@font-face {
    font-family: "dumplings-icons" !important;
    src: url('./dumplings-icons.woff') format('woff'),/* chrome,firefox */
         url('./dumplings-icons.ttf') format('truetype'),firefox,opera,Safari,Android,iOS 4.2+*/
         url('./dumplings-icons.svg#dumplings-icons') format('svg');
    font-weight: normal;
    font-style: normal;
}

.dp-icon {
    display: inline-block;
    /* use !important to prevent issues with browser extensions that change fonts */
    font-family: dumplings-icons !important;
    speak: none;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    vertical-align: baseline;

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


.dp-icon-question-circle::before {
    content: "\E001";
}

我有手册来更改字体文件路径,例如“ filename.woff”,但也不起作用。

文件路径为:

-dist
  dp-icons.css
  dumplings-icons.woff
  ...other font file
-svg
  svg.file
gulpfile.js

我想制作一个要发布到npm的软件包,并在npm之前安装它。

有没有人可以帮助我,谢谢!!!!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)