https://github.com/camus-design/svg_to_font
A tool for converting svg to font files.
https://github.com/camus-design/svg_to_font
dart flutter font svg-icons
Last synced: 2 months ago
JSON representation
A tool for converting svg to font files.
- Host: GitHub
- URL: https://github.com/camus-design/svg_to_font
- Owner: camus-design
- License: mit
- Created: 2022-11-08T08:59:07.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-08T05:31:59.000Z (about 2 years ago)
- Last Synced: 2025-03-25T16:23:38.531Z (3 months ago)
- Topics: dart, flutter, font, svg-icons
- Language: Dart
- Homepage: https://pub.dev/packages/svg_to_font
- Size: 155 KB
- Stars: 4
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# SvgToFont

[](https://pub.dev/packages/svg_to_font/changelog)


[](https://opensource.org/licenses/mit-license.php)A tool for converting SVG files to font files.
## Table of Contents
- [SvgToFont](#svgtofont)
- [Table of Contents](#table-of-contents)
- [Background](#background)
- [Requirements](#requirements)
- [Get Started](#get-started)
- [Install](#install)
- [An Example](#an-example)
- [Params](#params)
- [License](#license)## Background
To facilitate developers to quickly generate icon font (.ttf) and Flutter icon class, We developed the svg_to_font library.
Then you can use icons like the font.
## Requirements
Node.JS V10+ . [Install Node](https://nodejs.org/en/download/)
## Get Started
### Install
```shell
dart pub global activate svg_to_font
```### An Example
1. Put all of your icon SVG into some folder(example/assets);
2. Generated `camus_icons.dart` in `example/lib` and `camus_icons.ttf` in `example/assets````shell
svg_to_font generate --input=./example/assets --font-output=./example/assets/fonts --class-output=./example/lib
```3. Add some code to `pubspec.yaml`
```yaml
fonts:
- family: CamusIcons
fonts:
- asset: assets/fonts/camus_icons.ttf
```## Params
| parameter | description | default |
| :----: | :----: | :----: |
--help | Print this usage information | -- |
--input | Input your svg file path | -- |
--font-output | Output your fonts dir path | -- |
--class-output | Flutter icons Class output dir | -- |
--name | Flutter icons class Name | CamusIcons |
--delete-input | Is delete your input svg, if false, can preview svg | false |## License
[MIT](LICENSE) © Camus Design