# svg2ttf

> Converts SVG font to TTF font

Latest version **6.1.0** (published 2026-05-02) · MIT license · 0 weekly downloads

## Install

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

Provides the command `svg2ttf`.

## Health

**Score 53/100 (C)** — status: active.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 6.1.0 |
| Published | 2026-05-02 |
| First published | 2013-07-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/svg2ttf) |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 76.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 540 |
| Author | Sergey Batishchev |
| Maintainers | vitaly |
| Keywords | font, ttf, svg, converter |

## Links

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

## Dependencies (6)

- [lodash](https://npm.io/package/lodash.md) ^4.17.10
- [svgpath](https://npm.io/package/svgpath.md) ^2.1.5
- [argparse](https://npm.io/package/argparse.md) ^2.0.1
- [cubic2quad](https://npm.io/package/cubic2quad.md) ^1.2.1
- [microbuffer](https://npm.io/package/microbuffer.md) ^1.0.0
- [@xmldom/xmldom](https://npm.io/package/@xmldom/xmldom.md) ^0.9.10

## Alternatives

- [@fortawesome/react-fontawesome](https://npm.io/package/@fortawesome/react-fontawesome.md) — 2.2M weekly downloads
- [roboto-fontface](https://npm.io/package/roboto-fontface.md) — 196.0K weekly downloads
- [@react-native-vector-icons/common](https://npm.io/package/@react-native-vector-icons/common.md) — 150.4K weekly downloads
- [@procore/core-icons](https://npm.io/package/@procore/core-icons.md) — 4.6K weekly downloads
- [@react-md/material-icons](https://npm.io/package/@react-md/material-icons.md) — 1.6K weekly downloads

## Recent versions

- 6.1.0 (latest) — 2026-05-02
- 6.0.3 — 2021-08-21
- 6.0.2 — 2021-07-01
- 6.0.1 — 2021-06-17
- 6.0.0 — 2021-05-27
- 5.2.0 — 2021-04-07
- 5.1.0 — 2021-03-02
- 5.0.0 — 2020-05-20
- 4.3.0 — 2019-05-24
- 4.2.1 — 2019-05-23
- 4.2.0 — 2018-12-10
- 4.1.0 — 2017-06-24
- 4.0.3 — 2017-05-27
- 4.0.2 — 2016-08-04
- 4.0.1 — 2016-06-02
- … 19 more at https://npm.io/package/svg2ttf/versions

## README

svg2ttf
=======

[![CI](https://github.com/fontello/svg2ttf/actions/workflows/ci.yml/badge.svg)](https://github.com/fontello/svg2ttf/actions/workflows/ci.yml)
[![NPM version](https://img.shields.io/npm/v/svg2ttf.svg?style=flat)](https://www.npmjs.org/package/svg2ttf)

> Converts SVG fonts to TTF format. It was initially written for
[Fontello](http://fontello.com), but you can find it useful for your projects.

__For developpers:__

Internal API is similar to FontForge's one. Since primary goal
is generating iconic fonts, sources can lack some specific TTF/OTF features,
like kerning and so on. Anyway, current code is a good base for development,
because it will save you tons of hours to implement correct writing & optimizing
TTF tables.


Using from CLI
----------------

Install:

``` bash
npm install -g svg2ttf
```

Usage example:

``` bash
svg2ttf fontello.svg fontello.ttf
```


API
---

### svg2ttf(svgFontString, options) -> buf

- `svgFontString` - SVG font content
- `options`
  - `copyright` - copyright string (optional)
  - `description` - description string (optional)
  - `ts` - Unix timestamp (in seconds) to override creation time (optional)
  - `url` - manufacturer url (optional)
  - `version` - font version string, can be `Version x.y` or `x.y`.
- `buf` - internal [byte buffer](https://github.com/fontello/microbuffer)
   object, similar to DataView. It's `buffer` property is  `Uin8Array` or `Array`
   with ttf content.

Example:

``` javascript
var fs = require('fs');
var svg2ttf = require('svg2ttf');

var ttf = svg2ttf(fs.readFileSync('myfont.svg', 'utf8'), {});
fs.writeFileSync('myfont.ttf', new Buffer(ttf.buffer));
```


## svg2ttf for enterprise

Available as part of the Tidelift Subscription.

The maintainers of `svg2ttf` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-svg2ttf?utm_source=npm-svg2ttf&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)

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