csvg-to-font
TypeScript icon, indicating that this package has built-in type declarations

1.0.20 • Public • Published

Convert svg to font

npm version npm npm All Contributors

  • Convert svg to font
  • Support React
  • Support React Native
  • Support Typescript

Demo

Github

Demo

Install

npm i csvg-to-font@latest --save-dev

Setup

Create file: svgtofont.config.{ts,js,mjs}

import { defineConfig } from 'csvg-to-font';

export default defineConfig({
  src: 'svg', // svg path
  dist: 'dist', // output path
  fontName: 'svgtofont', // font name
  css: true, // Create CSS files.
  outSVGReact: true,
  outSVGReactNative: true, // Create React native folder
  outSVGPath: true,
  typescript: true,
});

CLI (file package.json)

-c: Config
{
  ...
  "scripts": {
    ...
    "svg-2-font": "csvg-to-font",
  },
  ...
}

Custom config file

  • You can also use a custom config file instead of svgtofont.config.{ts,js,mjs}. Just create <FILE_NAME>.config.{ts,js,mjs} to build command
Exp: awesome.config.ts;
{
  ...
  "scripts": {
    ...
    "svg-2-font": "csvg-to-font -c awesome",
  },
  ...
}

About

Buy Me A Coffee

Gia Hung – hung.hg

Package Sidebar

Install

npm i csvg-to-font

Weekly Downloads

21

Version

1.0.20

License

MIT

Unpacked Size

50.8 kB

Total Files

15

Last publish

Collaborators

  • hunghg255