fontify_plus 0.4.1 copy "fontify_plus: ^0.4.1" to clipboard
fontify_plus: ^0.4.1 copied to clipboard

Converts SVG icons to OTF font and generates Flutter-compatible class. Provides an API and a CLI tool.

example/example.dart

import 'dart:io';

import 'package:fontify_plus/fontify_plus.dart';

void main() {
  const fontFileName = 'fontify_plus_icons.otf';
  const classFileName = 'fontify_plus_icons.dart';

  // Input data
  final svgMap = {'icon': '<svg viewBox="0 0 0 0"></svg>'};

  // Generating font
  final svgToOtfResult = svgToOtf(
    svgMap: svgMap,
    fontName: 'My Icons',
  );

  // Writing font to a file
  writeToFile(fontFileName, svgToOtfResult.font);

  // Generating Flutter class
  final generatedClass = generateFlutterClass(
    glyphList: svgToOtfResult.glyphList,
    familyName: svgToOtfResult.font.familyName,
    className: 'MyIcons',
    fontFileName: fontFileName,
  );

  // Writing class content to a file
  File(classFileName).writeAsStringSync(generatedClass);
}
0
likes
150
pub points
15%
popularity

Publisher

verified publisher4akloon.tech

Converts SVG icons to OTF font and generates Flutter-compatible class. Provides an API and a CLI tool.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

args, collection, logger, path, path_parsing, recase, vector_math, xml, yaml

More

Packages that depend on fontify_plus