在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):nfroidure/gulp-svgicons2svgfont开源软件地址(OpenSource Url):https://github.com/nfroidure/gulp-svgicons2svgfont开源编程语言(OpenSource Language):JavaScript 81.5%开源软件介绍(OpenSource Introduction):gulp-svgicons2svgfont
You can test this library with the frontend generator. UsageFirst, install npm install --save-dev gulp-svgicons2svgfont Then, add it to your var svgicons2svgfont = require('gulp-svgicons2svgfont');
gulp.task('Iconfont', function(){
svgicons2svgfont(['assets/icons/*.svg'], {
fontName: 'myfont'
})
.on('glyphs', function(glyphs) {
console.log(glyphs);
// Here generate CSS/SCSS for your glyphs ...
})
.pipe(gulp.dest('www/font/'));
}); Every icon must be prefixed with it's codepoint. The The plugin stream emits a Please report icons to font issues to the svgicons2svgfont repository on wich this plugin depends. Note this Gulp plugin is strictly equivalent to the above module CLI interface. APIsvgicons2svgfont(options)options.prependUnicodeType: Allow to prepend unicode codepoints to icon file names in order to always keep the same codepoints accross each run. options.fileNameType: Allows to specify a fileName if needed it to be different from the fontName, eg. do not want to have spaces. options.startUnicodeType: Starting codepoint used for the generated glyphs. Defaults to a region within the Unicode private use area which is currently unused. See this blog post for further details and additional suggestions regarding accessibility of icon fonts. options.metadataProviderType: Allows to define your own logic to attach codepoints to input files. options.*The svgfont2svgicons options are also available:
NoteYou may look after a full Gulp web font workflow, see gulp-iconfont fot that matter. StatsContributingFeel free to push your code if you agree with publishing under the MIT license. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论