Skip to content
pubscout

icon_font_generator

4.1.0, released 10 months ago by serge.software

Converts SVG icons to OpenType fonts and generates Flutter-compatible icon classes.

$ flutter pub add icon_font_generator
Source repository

What it does

Processes a directory of SVG files, converts them into a single OTF font file, and generates a Dart class with identifiers for easy use in Flutter apps (similar to Material Icons). It provides both a CLI tool and a Dart API.

AI-written summary of version 4.1.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You have a custom set of SVG icons that you want to bundle into a single icon font.
  • You want code-generated static constants for your custom icon font to ensure type safety and autocomplete.

Skip it when

  • You prefer rendering vector SVGs directly at runtime without converting them to a font.
  • Your project requires complex multi-color vector assets that cannot be represented in a single-color font format.

Strengths

  • Works fully in Dart without external platform dependencies.
  • Provides both a CLI tool and programmatic API functions.
  • Supports YAML configuration via pubspec.yaml or icon_font.yaml.

Weaknesses

  • Generated font uses PostScript Table version 3.0 which doesn't contain glyph names.
  • Limited support for certain complex SVG attributes and features.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
11

Add as a dev dependency and run via CLI or add to pubspec.yaml.

import 'package:icon_font_generator/icon_font_generator.dart';

void main() async {
  await svgToOtf(inputDir: 'assets/svg/', outputFontFile: 'fonts/my_icons_font.otf');
}

Alternatives

Packages that do the same job and could replace icon_font_generator.

Works with

Packages commonly used together with icon_font_generator: ones it builds on, ones built on it, and its own family.