# svgicon2webfont

> Convert svg icons to webfont.

Latest version **1.0.1** (published 2018-05-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install svgicon2webfont
pnpm add svgicon2webfont
yarn add svgicon2webfont
bun add svgicon2webfont
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2018-05-18 |
| First published | 2018-05-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 30.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | t1mer |
| Maintainers | t1mer |
| Keywords | svg, eot, ttf, woff, woff2 |

## Links

- npm: https://www.npmjs.com/package/svgicon2webfont
- Repository: https://github.com/deart1mer/svgicon2webfont
- Homepage: https://github.com/deart1mer/svgicon2webfont#readme
- Issues: https://github.com/deart1mer/svgicon2webfont/issues
- npm.io page: https://npm.io/package/svgicon2webfont

## Dependencies (6)

- [lodash](https://npm.io/package/lodash.md) ^4.17.10
- [svg2ttf](https://npm.io/package/svg2ttf.md) ^4.1.0
- [ttf2eot](https://npm.io/package/ttf2eot.md) ^2.0.0
- [ttf2woff](https://npm.io/package/ttf2woff.md) ^2.0.1
- [ttf2woff2](https://npm.io/package/ttf2woff2.md) ^2.0.3
- [svgicons2svgfont](https://npm.io/package/svgicons2svgfont.md) ^9.0.2

## Recent versions

- 1.0.1 (latest) — 2018-05-18

## README

# svgicon2webfont

Convert svg icons to webfont.

## Install

```
npm install svgicon2webfont --save
```

## Usage

```js
const svgicon2webfont = require('svgicon2webfont');

svgicon2webfont({
  fontName: 'iconfont',
  glyphs: [{
    name: 'xx',
    codepoint: 0xF101,
    svg: fs.readFileSync('xx.svg')).toString()
  }],
  dest: 'dest'
}).then((result) => {
  // handle result
}).catch((error) => {
  // handle error
})
```

## Options

### fontName

*required*

Type: `string`

Name of font and base name of font files.

### dest

*required*

Type: `string`

Directory for generated font files.

### glyphs

*required*

Type: `Array<Glyph>`

Specific `name`, `codepoint`, `svg` for icons.

```ts
interface Glyph {
  name: string;
  codepoint: number;
  svg: string;
}
```

### fontName, normalize, fontHeight, round, descent

Options that are passed directly to [svgicons2svgfont](https://github.com/nfroidure/svgicons2svgfont).

### formatOptions

Type: `object`

Specific per format arbitrary options to pass to the generator

format and matching generator:
- `svg` - [svgicons2svgfont](https://github.com/nfroidure/svgicons2svgfont).
- `ttf` - [svg2ttf](https://github.com/fontello/svg2ttf).
- `woff2` - [ttf2woff2](https://github.com/nfroidure/ttf2woff2).
- `woff` - [ttf2woff](https://github.com/fontello/ttf2woff).
- `eot` - [ttf2eot](https://github.com/fontello/ttf2eot).

```js
svgicon2webfont({
  // options
  formatOptions: {
  	// options to pass specifically to the ttf generator
  	ttf: {
  		ts: 1451512800000
  	}
  }
})
```

---
_Source: https://npm.io/package/svgicon2webfont · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
