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
npm install -g icont-cli
Usage
convert svg(s) to ttf & dart file
Usage: icont [options] [command] Convert SVG to ttf file Options: -v, --version output the version number -i, --input <path|dir> input svg dir or file path -o, --output <dir> output path -n, --fontname <name> output font name -h, --help display help
copy files
Usage: icont copy [options] copy file to target dir. Options: -d, --dist <dir> dist dir -s, --src <dir> copy form dir -e, --ext <extname> file ext name -h, --help display help
Flutter Project Configuration Demo
- pubspec.yaml
fonts: - family: iconfonts fonts: - asset: iconfonts/iconfonts.ttf
- script sample
#!/usr/bin/env bash 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 .ttficont copy -s $temp_dir -d $dart_path -e .dart # delete temp dir # rm -rf $temp_dir