我正在使用 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
,它无法加载更粗的字体。
最佳答案
define(['backbone','app-init','font!google,families:[Yanone Kaffeesatz:700]'],
function(Backbone, AppInit,Font) {
AppInit.initialize();
}
);
关于javascript - 使用 require.js 字体插件加载 Google Web 字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19234299/