使用 require.js 字体插件加载 Google Web Fonts

3
我正在使用 https://github.com/millermedeiros/requirejs-plugins 加载谷歌字体,对于基本字体来说它运行良好。
require.config({
  paths : {
    font: 'lib/require/font',
  }
});

define([
  'font!google,families:[Roboto]'
  ], function(){
    //all dependencies are loaded
  }
);

上述内容没有问题,但如果我尝试使用Roboto:400,500,700,900,它无法加载更粗的字体。

嗨@Joe,你最终解决了这个问题吗? - Daniel Tate
1个回答

1
define(['backbone','app-init','font!google,families:[Yanone Kaffeesatz:700]'],
   function(Backbone, AppInit,Font) {
      AppInit.initialize();
   }
);

1
我收到了未捕获的引用错误:WebFont未定义。 - Daniel Tate
需要哪些其他要求才能使其正常工作? - Daniel Tate

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接