iconfontool 0.0.2 copy "iconfontool: ^0.0.2" to clipboard
iconfontool: ^0.0.2 copied to clipboard

generate flutter icons from iconfont.cn

description #

A command-line tool that generates a Flutter Icon class from fonts obtained from iconfont.cn.

usage #

1、add iconfontool to dev dependenceis

dev_dependencies:
  iconfontool: latest

2、add fonts assets which download from iconfont.cn to flutter

download fonts asset from iconfont.cn

Basically only need the iconfont.tts and iconfont.json file, and you can rename it according to your preference.

flutter:
  fonts:
    - family: iconfont
      fonts:
        - asset: assets/fonts/shiny_music.ttf

3、config iconfontool

iconfontool support seperate yaml or integrate into pubspec.yaml

iconfontool:
  - json_path: assets/fonts/iconfont.json # including icons information
    font_family: shiny_music # set font family
    font_path:  assets/fonts/shiny_music.ttf # the font asset file path
    icon_class: ShinyMusic # generated dart class name
    out_dir: lib/fonts/shiny/ # generated file output dir
  - json_path: assets/fonts/iconfont.json # including icons information
    font_family: shiny_music2 # set font family
    font_path:  assets/fonts/shiny_music.ttf # the font asset file path
    icon_class: ShinyMusic2 # generated dart class name
    out_dir: lib/fonts/shiny/ # generated file output dir

or seperate yaml

iconfontool.yaml

- json_path: assets/fonts/iconfont.json # including icons information
  font_family: shiny_music # set font family
  font_path:  assets/fonts/shiny_music.ttf # the font asset file path
  icon_class: ShinyMusic # generated dart class name
  out_dir: lib/fonts/shiny/ # generated file output dir
- json_path: assets/fonts/iconfont.json # including icons information
  font_family: shiny_music2 # set font family
  font_path:  assets/fonts/shiny_music.ttf # the font asset file path
  icon_class: ShinyMusic2 # generated dart class name
  out_dir: lib/fonts/shiny/ # generated file output dir

4、generate

flutter pub run iconfontool
# flutter pub run iconfontool -c iconfontool.yaml
1
likes
130
points
30
downloads

Publisher

verified publisherhumphreyd.cn

Weekly Downloads

generate flutter icons from iconfont.cn

Repository
View/report issues

Documentation

API reference

License

unknown (license)

Dependencies

args, lpinyin, path, yaml

More

Packages that depend on iconfontool