Create icon fonts from several SVG icons.
This plugin requires Grunt ~0.4.1
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-iconfont --save
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-iconfont');
Run this task with the grunt iconfont
command.
Task targets, files and options may be specified according to the grunt Configuring tasks guide.
Type: string
SVG glyphs. Wildcards are supported.
Type: string
Directory of the resulting font.
Type: String
Default value: targetName
A string value that is used to name your font-family.
And support all options that grunt-svgicons2svgfont
support. You could read this page for detail.
grunt.initConfig({
iconfont: {
options: {
},
your_target: {
fontName: 'my-font-name', // overrides font name, would default to 'your_target' in this example
src: 'glyphs/*.svg',
dest: 'font/'
}
},
})
You may want to contribute to this project, pull requests are welcome if you accept to publish under the MIT licence.