Package selection guidance compiled from public package information, community data, and project usage.
A Flutter/Dart package that converts SVG icons into OTF fonts and generates a corresponding Dart class for easy integration in Flutter apps. It offers both a command-line interface (CLI) and an API for automation, enabling developers to streamline icon management across multiple platforms. The generated font is compatible with Android, iOS, Web, macOS, Windows, and Linux, ensuring consistent icon rendering. Ideal for teams managing custom icon sets efficiently.
Use cases
Generate custom icon fonts from SVGs
Automate icon asset creation
Integrate vector icons into Flutter apps
Support multi-platform icon rendering
Streamline design-to-code workflows
Key features
SVG to OTF font conversion
Dart class generation for icons
CLI and API interfaces
Cross-platform support
Custom icon set management
Easy integration with Flutter
Suitable for
Flutter developers
Design teams
UI/UX engineers
Apps requiring custom icons
Projects with frequent icon updates
Considerations
Requires SVG files as input
Needs setup for CLI or API usage
May require additional build steps
Font file size considerations
Limited to icon-only use cases
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
icon_font_generator
The icon_font_generator package provides an easy way to convert SVG icons to OpenType font
and generate Flutter-compatible class that contains identifiers for the icons
(just like CupertinoIcons or Icons classes).
The package is written fully in Dart and doesn't require any external dependency.
Compatible with dart2js and dart2native.
Font generation
Install via dev dependency
$ flutter pub add --dev icon_font_generator
# And it's ready to go:
$ flutter pub run icon_font_generator:generate <input-svg-dir> <output-font-file> [options]
SVG transforms are applied to paths according to specs.
SVG <g> element's children are expanded to the root with transformations applied.
Anything else related to the group is ignored and group referencing is not supported.
When ignoreShapes is set to false,
every SVG shape's (circle, rect, etc.) outline is converted to path.
Note that any attributes like "fill" or "stroke" are ignored and only the outline is used,
so the resulting glyph may look different from SVG icon.
It's recommended to convert every element in SVG to path.
When normalize is set to false, it's recommended that SVG icons have the same height.
Otherwise, final result might not look as expected.
When Flutter class is generated, static variables names derive from SVG file name
converted to pascal case with non-allowed characters removed.
Name is set to 'unnamed', if it's empty.
Suffix '_{i+1}' is added, if name already exists.
Contributing
Any suggestions, issues, pull requests are welcomed.