Insert a set of fonts using base64 encoding and CSS font-face tags
$ npm install --save insert-fonts
var insertFonts = require('insert-fonts')
insertFonts({
'Awesome Font Face': {
400: '...' // base 64 encoded font data for the 400 weight
500: '...' // base 64 encoded font data for the 500 weight
},
'Other Great Face': {
400: '...'
}
})
//=> creates fonts and inserts @font-face tags into the dom
Returns the inserted CSS string.
Required
Type: object
An object where the keys/values represent font face names and their weights, respectively. The weights are also objects, where the keys/values represent the weight and the font data (base 64 encoded), respectively.
MIT © Ben Drucker