Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Loading Google Web Fonts using require.js font plugin

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.

like image 459
Joe Avatar asked Jun 15 '26 16:06

Joe


1 Answers

define(['backbone','app-init','font!google,families:[Yanone Kaffeesatz:700]'],
   function(Backbone, AppInit,Font) {
      AppInit.initialize();
   }
);
like image 115
Pranay Soni Avatar answered Jun 17 '26 04:06

Pranay Soni



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!