Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hunghg255/svg-to-font
Convert svg to font
https://github.com/hunghg255/svg-to-font
font icons npm svg svgtofont
Last synced: about 2 months ago
JSON representation
Convert svg to font
- Host: GitHub
- URL: https://github.com/hunghg255/svg-to-font
- Owner: hunghg255
- License: mit
- Created: 2023-07-15T16:48:49.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-05-03T08:55:21.000Z (8 months ago)
- Last Synced: 2024-08-08T20:56:10.753Z (5 months ago)
- Topics: font, icons, npm, svg, svgtofont
- Language: TypeScript
- Homepage: https://svg-to-font.vercel.app/
- Size: 885 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
A library convert svg file to font## Feature
- Convert svg to font
- Support React
- Support React Native
- Support Typescript## Demo
[Github](https://github.com/hunghg255/react-svg-to-font)
[Demo](https://react-svg-to-font.vercel.app/)
## Install
```bash
npm i csvg-to-font@latest --save-dev
```## Setup
### Create file: `svgtofont.config.{ts,js,mjs}`
```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,
outSVGReactNative: true, // Create React native folder
outSVGPath: true,
typescript: true,
});
```## CLI (file package.json)
```
-c: Config
``````json
{
...
"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 `.config.{ts,js,mjs}` to build command
```js
Exp: awesome.config.ts;
``````json
{
...
"scripts": {
...
"svg-2-font": "csvg-to-font -c awesome",
},
...
}
```### About
Gia Hung – [hung.hg](https://hung.thedev.id)