# icon-font-buildr

> Build custom icon fonts, it supports remote and local icons sources.

Latest version **2.0.0** (published 2023-02-19) · 0 weekly downloads

## Install

```sh
npm install icon-font-buildr
pnpm add icon-font-buildr
yarn add icon-font-buildr
bun add icon-font-buildr
```

Provides the command `icon-font-buildr`.

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2023-02-19 |
| First published | 2018-09-14 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 8 |
| Unpacked size | 7.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 55 |
| Maintainers | fabiospampinato |
| Keywords | font, icon, builder, generator, cli |

## Links

- npm: https://www.npmjs.com/package/icon-font-buildr
- Repository: https://github.com/fabiospampinato/icon-font-buildr
- Homepage: https://github.com/fabiospampinato/icon-font-buildr#readme
- Issues: https://github.com/fabiospampinato/icon-font-buildr/issues
- npm.io page: https://npm.io/package/icon-font-buildr

## Dependencies (8)

- [svg2ttf](https://npm.io/package/svg2ttf.md) ^6.0.3
- [ttf2eot](https://npm.io/package/ttf2eot.md) ^3.1.0
- [wawoff2](https://npm.io/package/wawoff2.md) ^2.0.1
- [ttf2woff](https://npm.io/package/ttf2woff.md) ^3.0.0
- [specialist](https://npm.io/package/specialist.md) 1.1.0
- [find-up-json](https://npm.io/package/find-up-json.md) ^2.0.1
- [svgicons2svgfont](https://npm.io/package/svgicons2svgfont.md) ^12.0.0
- [plain-object-merge](https://npm.io/package/plain-object-merge.md) ^2.0.0

## 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

- 2.0.0 (latest) — 2023-02-19
- 1.4.2 — 2021-05-13
- 1.4.1 — 2021-05-12
- 1.4.0 — 2021-05-12
- 1.3.4 — 2020-02-08
- 1.3.3 — 2019-04-28
- 1.3.2 — 2019-03-23
- 1.3.1 — 2019-02-28
- 1.3.0 — 2019-02-28
- 1.2.4 — 2018-11-12
- 1.2.3 — 2018-11-12
- 1.2.2 — 2018-11-05
- 1.2.1 — 2018-09-14
- 1.2.0 — 2018-09-14
- 1.1.0 — 2018-09-14
- … 1 more at https://npm.io/package/icon-font-buildr/versions

## README

# Icon Font Buildr

Build custom icon fonts, it supports remote and local icons sources.

## Install

```sh
npm install --global icon-font-buildr # If you want to use the CLI
npm install --save icon-font-buildr # If you want to use the API
```

## Usage

#### CLI

<p align="center">
  <img src="resources/cli.gif" width="850" alt="CLI">
</p>

```sh
icon-font-buildr --config my_icon_font.json
icon-font-buildr # The `--config` option can be omitted if your configuration file is called `icon_font.json`
```

#### API

```js
import path from 'node:path';
import IconFontBuildr from 'icon-font-buildr';

const builder = new IconFontBuildr ({
  sources: [ // Where to get the icons, both remote and local sources are supported. `[icon]` will be replace with the name of your icon
    path.join ( __dirname, 'icons', '[icon].svg' ),
    'https://fonts.gstatic.com/s/i/materialicons/[icon]/v5/24px.svg',
    'https://fonts.gstatic.com/s/i/materialicons/[icon]/v4/24px.svg',
    'https://fonts.gstatic.com/s/i/materialicons/[icon]/v3/24px.svg',
    'https://raw.githubusercontent.com/Templarian/MaterialDesign/master/svg/[icon].svg'
  ],
  icons: [ // Icons to use/download
    'backup',
    'bug_report',
    'amazon',
    { // Advanced way to define an icon
      icon: 'android-debug-bridge',
      name: 'android debug icon', // Custom icon name
      codepoints: ['\ue042', '\ue064'], // Custom codepoints
      ligatures: ['debug', 'debug_alt'] // Custom ligatures
    }
  ],
  output: {
    // codepoints: true, // Enable support for codepoints
    // ligatures: false, // Disable support for ligatures
    // icons: path.join ( __dirname, 'builder-icons' ), // Where to save the icons, if not provided they won't be stored permanently
    fonts: path.join ( __dirname, 'builder-fonts' ), // Where to save the fonts
    fontName: 'MaterialDesign', // The name of the font to generate
    formats: [ // Font formats to output
      'eot',
      'ttf',
      'woff',
      'woff2'
    ]
  }
});

await builder.build ();

const codepoints = builder.getIconsCodepoints (); // Get a map of icon names to codepoints, useful for generating HTML/CSS/SCSS etc.
const ligatures = builder.getIconsLigatures (); // Get a map of icon names to ligatures, useful for generating HTML/CSS/SCSS etc.
```

## License

MIT © Fabio Spampinato

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