Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-svgicons2svgfont

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-svgicons2svgfont

Create a SVG font from several SVG icons

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

gulp-svgicons2svgfont

Create an SVG font from several SVG icons with Gulp.

NPM version Build status Dependency Status devDependency Status Coverage Status Code Climate

You can test this library with the frontend generator.

Usage

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(){
  gulp.src(['assets/icons/*.svg'])
    .pipe(svgicons2svgfont({
      fontName: 'myfont'
     }))
    .on('codepoints', function(codepoints) {
      console.log(codepoints);
      // Here generate CSS/SCSS  for your codepoints ...
    })
    .pipe(gulp.dest('www/font/'));
});

Every icon must be prefixed with it's codepoint. The appendCodepoints 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.

API

svgicons2svgfont(options)

options.ignoreExt

Type: Boolean Default value: false

Set to true to also convert read icons that doesn't have the .svg extension.

A string value that is used to name your font-family (required).

options.appendCodepoints

Type: Boolean Default value: false

Allow to append codepoints to icon files in order to always keep the same codepoints.

options.startCodepoint

Type: integer Default value: 0xE001

Starting codepoint used for the generated glyphs. Defaults to the start of the Unicode private use area.

options.*

The svgfont2svgicons options are also available:

  • options.fontName
  • options.fixedWidth
  • options.centerHorizontally
  • options.normalize
  • options.fontHeight
  • options.round
  • options.descent
  • options.log

Stats

NPM NPM

Contributing

Feel free to push your code if you agree with publishing under the MIT license.

Keywords

FAQs

Package last updated on 03 Oct 2014

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc