Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
gulp-svgicons2svgfont
Advanced tools
Readme
Create an SVG font from several SVG icons with Gulp.
You can test this library with the frontend generator.
First, install gulp-svgicons2svgfont
as a development dependency:
npm install --save-dev gulp-svgicons2svgfont
Then, add it to your gulpfile.js
:
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 prependUnicode
option
allows to do it automatically. Then, in your own CSS, you just have to use
the corresponding codepoint to display your icon. See this
sample less mixin
for a real world usage.
The plugin stream emits a codepoints
event letting you do whatever you want
with them.
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.
Type: Boolean
Default value: false
Allow to prepend unicode codepoints to icon file names in order to always keep the same codepoints accross each run.
Type: String
Default value: options.fontName
Allows to specify a fileName if needed it to be different from the fontName, eg. do not want to have spaces.
Type: integer
Default value: 0xEA01
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.
Type: Function
Default value: require('svgicons2svgfont/src/metadata')(options)
Allows to define your own logic to attach codepoints to input files.
The svgfont2svgicons options are also available:
You may look after a full Gulp web font workflow, see gulp-iconfont fot that matter.
Feel free to push your code if you agree with publishing under the MIT license.
FAQs
Create a SVG font from several SVG icons
The npm package gulp-svgicons2svgfont receives a total of 18,849 weekly downloads. As such, gulp-svgicons2svgfont popularity was classified as popular.
We found that gulp-svgicons2svgfont demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.