0.5.2 • Published 5 years ago
gulp-fontello v0.5.2
gulp-fontello
Import svg files to Fontello icon font project, use svg filename as glyph name. Also provide task for auto download exported css and font files into destinated folder.
Install
npm install --save-dev gulp-fontelloDefault Zip Archive Structure
Usage
- You should get a
config.jsonfile from http://fontello.com project and save it somewhere in your project; - create Gulp Task:
var
gulp = require('gulp'),
$ = require('gulp-load-plugins')()
;
gulp.task('glyph', function () {
return gulp.src('config.json')
.pipe($.fontello())
.pipe($.print())
.pipe(gulp.dest('dist'))
});Options
var options = {
host : 'http://fontello.com', // Host for response
font : 'font', // Destination dir for Fonts and Glyphs
css : 'css', // Destination dir for CSS Styles,
assetsOnly : true // extract from ZipFile only CSS Styles and Fonts exclude config.json, LICENSE.txt, README.txt and demo.html
cache : $.fontello.simpleFsCache('cachedir') // object containing methods get(key, callback) and set(key, value)
}CLI Arguments
Script can accept input parameters in CLI mode and extends options parameters in gulp task, for example:
- Gulp global install
gulp <fontello-task> --no-assets-only - Gulp local install (For this make
gulpscripts in package.json)
npm run gulp <fontello-task> -- --no-assets-onlyAvailable arguments
--host=hostHost for response--css=cssDestination dir for Fonts and Glyphs--font=fontDestination dir for CSS Styles--no-assets-onlyExtract from ZipFile CSS Styles and Fontswithconfig.json, LICENSE.txt, README.txt and demo.html--assets-onlyExtract from ZipFile only CSS Styles and Fontsexcludeconfig.json, LICENSE.txt, README.txt and demo.html


