Skip to content

coderbk197/svg-to-font

 
 

Repository files navigation

Convert svg to font

npm version npm npm All Contributors

Demo

Github

Demo

Install

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

Setup

Create file: svgtofont.config.ts or svgtofont.config.mjs or svgtofont.config.js

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,
  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. Just create <FILE_NAME>.config.ts to build command
Exp: awesome.config.ts;
{
  ...
  "scripts": {
    ...
    "svg-2-font": "csvg-to-font -c awesome",
  },
  ...
}

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 83.6%
  • EJS 11.2%
  • JavaScript 5.2%