Font Mapper π§©
A Dart CLI tool to scan font files and auto-generate the fonts: section in your pubspec.yaml.
π§ Installation
dart pub global activate font_mapper
π Usage
π§ Basic
font_mapper
This scans assets/fonts and updates the fonts: section in pubspec.yaml.
π With options
font_mapper -t pubspec.yaml -d assets/my_fonts
-t / --target: Target YAML file (default: pubspec.yaml)
-d / --dir: Directory containing font files (default: assets/fonts)
-h / --help: Show help
π Supported Fonts
.ttf, .otf formats
Supports multi-family directories
π Output Example
If you have:
assets/fonts/
βββ SF-Pro-Display-BoldItalic.ttf
βββ SF-Pro-Display-Regular.ttf
βββ Inter-Light.otf
Running font_mapper generates:
flutter:
fonts:
- family: SF-Pro-Display
fonts:
- asset: assets/fonts/SF-Pro-Display-BoldItalic.ttf
weight: 700
style: italic
- asset: assets/fonts/SF-Pro-Display-Regular.ttf
weight: 400
- family: Inter
fonts:
- asset: assets/fonts/Inter-Light.otf
weight: 300
π License
MIT License. See LICENSE.
π§βπ» Contributing
Feel free to open PRs or issues on GitHub!
Sponsoring
OR

