An open API service indexing awesome lists of open source software.

https://github.com/lyn-euler/icont-cli

a tool which convert svg(s) to ttf
https://github.com/lyn-euler/icont-cli

cli dart flutter fluttericon icon iconfont iconfonts node svg ttf

Last synced: 3 months ago
JSON representation

a tool which convert svg(s) to ttf

Awesome Lists containing this project

README

        

# icont-cli
A tool which convert svg(s) to tff, and output `.dart` file for flutter project
And u can copy result(s) to dist dir.
## Install

```shell
npm install -g icont-cli
```

## Usage

### convert svg(s) to ttf & dart file

```shell
Usage: icont [options] [command]

Convert SVG(s) to ttf file

Options:
-v, --version output the version number
-i, --input input svg dir or file path (default: "svg")
-o, --output output path (default: "output")
-n, --fontname output font name (default: "iconfonts")
-h, --help display help for command

Commands:
copy [options] copy file to target dir.
```

### copy files

```shell
Usage: icont copy [options]

copy file to target dir.

Options:
-d, --dist dist dir
-s, --src copy form dir
-e, --ext file ext name
-h, --help display help for command
```

## Flutter Project Configuration Demo

- pubspec.yaml

```shell
fonts:
- family: iconfonts
fonts:
- asset: iconfonts/iconfonts.ttf
```

- script sample

```shell
#!/usr/bin/env bash
if [ ! `command -v icont` ]; then
npm install -g icont-cli
fi

temp_dir='.icont'
fonts_dir='fonts'
dart_path='lib'

# svg to ttf & dart
icont -i svg -o $temp_dir

# copy to target dir
icont copy -s $temp_dir -d $fonts_dir -e .ttf
icont copy -s $temp_dir -d $dart_path -e .dart

# delete temp dir
# rm -rf $temp_dir
```