Search packages, repositories and app categories

Package detailsv1.0.2

font_mapper

A Dart CLI tool that automatically scans font assets and updates the `fonts:` section in your pubspec.yaml file.

AndroidiOSmacOSWindowsLinux
30-day downloads
40
Likes
9
Pub points
140

Install package

flutter pub add font_mapper

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Font Mapper is a Dart CLI tool designed to streamline font asset management in Flutter projects. It automatically scans local font files and updates the `fonts:` section in the pubspec.yaml file, eliminating manual configuration. Ideal for projects with numerous or frequently changing fonts, it ensures consistency and reduces setup time. The tool supports all major platforms, including Android, iOS, macOS, Windows, and Linux, making it versatile across development environments. By integrating seamlessly with Flutter’s build process, Font Mapper enhances developer productivity and minimizes configuration errors.

Use cases

  • Automating font asset registration
  • Updating pubspec.yaml after adding new fonts
  • Maintaining consistent font configurations across teams
  • Reducing manual errors in font setup
  • Streamlining CI/CD workflows with font changes

Key features

  • Auto-detects font files in project
  • Updates pubspec.yaml automatically
  • Supports multiple platforms
  • Command-line interface for easy integration
  • Preserves existing font configuration structure

Suitable for

  • Flutter developers managing many fonts
  • Teams requiring consistent font setup
  • CI/CD pipelines involving font assets
  • Developers seeking to reduce manual pubspec edits
  • Projects with frequent font updates

Considerations

  • Requires command-line access
  • May need permission to modify pubspec.yaml
  • Not suitable for non-Dart projects
  • Depends on correct font file naming conventions
  • Should be used carefully in shared repositories

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

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

Buy Me A Coffee

OR

7ezgif-5-20a8a8001a

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package

No data available yet.