v1.0.2
font_mapper
一个 Dart 命令行工具,可自动扫描字体资源并更新 pubspec.yaml 文件中的 `fonts:` 部分。
9喜欢 22近 30 天下载140Pub 分数
AndroidiOSmacOSWindowsLinux
一个 Dart 命令行工具,用于扫描字体文件并自动在您的 `pubspec.yaml` 中生成 `fonts:` 部分。
以下为英文项目原文快照,最新内容请访问 GitHub。
A Dart CLI tool to scan font files and auto-generate the fonts: section in your pubspec.yaml.
dart pub global activate font_mapper
font_mapper
This scans assets/fonts and updates the fonts: section in pubspec.yaml.
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
.ttf, .otf formats
Supports multi-family directories
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
MIT License. See LICENSE.
Feel free to open PRs or issues on GitHub!
OR
7ezgif-5-20a8a8001a