在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:poppinlp/grunt-svgicons2svgfont开源软件地址:https://github.com/poppinlp/grunt-svgicons2svgfont开源编程语言:JavaScript 100.0%开源软件介绍:grunt-svgicons2svgfontCreate a SVG font from multiple SVG glyph files. Getting StartedThis plugin requires Grunt 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-svgicons2svgfont --save-dev Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript: grunt.loadNpmTasks('grunt-svgicons2svgfont'); The "svgicons2svgfont" taskOverviewIn your project's Gruntfile, add a section named grunt.initConfig({
svgicons2svgfont: {
options: {
// Task-specific options go here.
},
your_target: {
// Target-specific file lists and/or options go here.
},
},
}) OptionssrcType: SVG glyphs. Wildcards are supported. destType: Directory of the resulting font. options.fontNameType: A string value that is used to name your font-family. options.appendCodepointsType: Allow to append codepoints to icon files in order to always keep the same codepoints. options.fixedWidthType: Creates a monospace font of the width of the largest input icon. options.centerHorizontallyType: Calculate the bounds of a glyph and center it horizontally. Warning: The bounds calculation is currently a naive implementation that may not work for some icons. We need to create a svg-pathdata-draw module on top of svg-pathdata to get the real bounds of the icon. It's in on the bottom of my to do, but feel free to work on it. Discuss it in the options.normalizeType: Normalize icons by scaling them to the height of the highest icon. options.fontHeightType: options.roundType: options.descentType: The font descent. It is usefull to fix the font baseline yourself. options.logType: Allows you to provide your own logging function. Set to options.errorType: Allows you to provide your own error function. Set to Examplegrunt.initConfig({
svgicons2svgfont: {
options: {
fontName: "my-font-name"
},
your_target: {
src: 'glyphs/*.svg',
dest: 'font/'
}
},
}) Related Grunt pluginsYou may use this plugin in addition of the following plugins: Contributing / IssuesPlease submit SVG related issue to the svgicons2svgfont project on wich grunt-svgicons2svgfont depends. This repository issues is only for grunt and grunt tasks related issues. You may want to contribute to this project, pull requests are welcome if you accept to publish under the MIT licence. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论