So, I'm using gulp-iconfont to generate icon font from svg icons. I've set up task in a next way:
gulp.task('iconfont', function(){
gulp.src(['src/assets/icons/*.svg'])
.pipe($.iconfont({
fontName: 'material',
normalize: true
}))
.on('codepoints', function(codepoints) {
console.log(codepoints);
gulp.src('src/templates/material.styl')
.pipe($.consolidate('mustache', {
glyphs: codepoints,
fontName: 'material',
fontPath: '../fonts/',
className: 'md'
}))
.pipe(gulp.dest('src/styles/plugins'));
})
.pipe(gulp.dest('build/fonts/'));
});
console.log(codepoints)
gives me something like:
[ { name: 'notifications', codepoint: 57345 },
{ name: 'offline', codepoint: 57346 },
{ name: 'online', codepoint: 57347 },
...
]
I'm using this codepoints in my css to generate something like:
.md-notifications {
content: "\57345";
}
And it doesn't work, there is an empty space instead of my icon. But if I use the codepoint that I get directly from generated svg font it works:
.md-notifications {
content: "\E001"
}
What am I doing wrong?