【问题标题】:How to load font files from node_module(otf files)如何从 node_module(otf 文件) 加载字体文件
【发布时间】:2020-08-12 06:20:09
【问题描述】:

我们无法从节点模块加载字体文件。并低于错误。

Can't resolve 'assets/fonts/roman.woff2' in 'C:\Projects\GIT2\newbusinessapp\projects\newbusinessapp\src'

我们通过 angular.json 文件包含资产。但还是没有结果。

@font-face {
font-family: 'Publico Light Roman';
src: url('assets/fonts/roman.woff2');        

}

          {
            "glob": "**/*",
            "input": "node_modules/@mypackage/assets/assets/fonts",
            "output": "/assets/fonts"
          },

如果您有任何解决方案,请在此处发布。

【问题讨论】:

    标签: javascript css node.js angular sass


    【解决方案1】:

    我用~解决了这个问题

    @font-face {
    font-family: 'Publico Light Roman';
    src: url('~/assets/fonts/roman.woff2'); 
    }
    

    【讨论】:

      猜你喜欢
      • 2015-08-17
      • 1970-01-01
      • 2013-05-23
      • 2017-01-28
      • 1970-01-01
      • 1970-01-01
      • 2014-12-27
      • 2017-12-16
      • 2022-09-30
      相关资源
      最近更新 更多