Skip to main content

svg_icons_to_font 1.0.0 copy "svg_icons_to_font: ^1.0.0" to clipboard
svg_icons_to_font: ^1.0.0 copied to clipboard

A pure Dart package and CLI tool that converts a folder of SVG icons into an OpenType (.otf) font file and generates a corresponding Flutter IconData Dart class.

example/main.dart

import 'dart:io';

import 'package:svg_icons_to_font/svg_icons_to_font.dart';

Future<void> main() async {
  const config = FontGeneratorConfig(
    inputDir: 'assets/svg',
    fontOutputPath: 'assets/fonts/app_icons.otf',
    dartOutputPath: 'lib/app_icons.dart',
    fontFamily: 'AppIcons',
    className: 'AppIcons',
    startCodePoint: 0xE000,
  );

  final result = await SvgIconsToFontGenerator.generate(config);

  stdout.writeln('Generated ${result.glyphs.length} icons:');
  stdout.writeln('  Font file : ${result.fontOutputPath}');
  stdout.writeln('  Dart class: ${result.dartOutputPath}');
}
0
likes
150
points
--
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A pure Dart package and CLI tool that converts a folder of SVG icons into an OpenType (.otf) font file and generates a corresponding Flutter IconData Dart class.

Repository (GitHub)
View/report issues

Topics

#svg #icons #font #otf #flutter

License

MIT (license)

Dependencies

args, path, xml

More

Packages that depend on svg_icons_to_font