Loading Google Web Fonts using require.js font plugin

天涯浪子 提交于 2019-12-10 20:17:52

问题


I'm using https://github.com/millermedeiros/requirejs-plugins to load the google font and it works fine for the basic font.

require.config({
  paths : {
    font: 'lib/require/font',
  }
});

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

the above is fine, but if I try Roboto:400,500,700,900, it won't work to load the bolder fonts.


回答1:


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


来源:https://stackoverflow.com/questions/19234299/loading-google-web-fonts-using-require-js-font-plugin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!