{"id":13491349,"url":"https://github.com/westracer/fontify","last_synced_at":"2025-10-23T06:58:15.302Z","repository":{"id":52644018,"uuid":"270061477","full_name":"westracer/fontify","owner":"westracer","description":"Converts SVG icons to OTF font and generates Flutter-compatible class. Provides an API and a CLI tool.","archived":false,"fork":false,"pushed_at":"2024-06-11T14:24:34.000Z","size":523,"stargazers_count":107,"open_issues_count":8,"forks_count":16,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-10-23T06:57:53.705Z","etag":null,"topics":["converter","dart","flutter","font-generator","svg-converter","svgtofont"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/westracer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-06T18:01:53.000Z","updated_at":"2025-08-01T06:20:13.000Z","dependencies_parsed_at":"2024-10-31T05:31:16.485Z","dependency_job_id":"afcf6d8a-f87d-4557-bc9e-df3c065232ff","html_url":"https://github.com/westracer/fontify","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/westracer/fontify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/westracer%2Ffontify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/westracer%2Ffontify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/westracer%2Ffontify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/westracer%2Ffontify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/westracer","download_url":"https://codeload.github.com/westracer/fontify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/westracer%2Ffontify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280577140,"owners_count":26354074,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-23T02:00:06.710Z","response_time":142,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["converter","dart","flutter","font-generator","svg-converter","svgtofont"],"created_at":"2024-07-31T19:00:55.980Z","updated_at":"2025-10-23T06:58:15.271Z","avatar_url":"https://github.com/westracer.png","language":"Dart","funding_links":[],"categories":["实用工具","工具集","Utilities [🔝](#readme)","Utilities","Dart"],"sub_categories":["Top","热门的"],"readme":"# Fontify\n\n[![pub package](https://img.shields.io/pub/v/fontify.svg)](https://pub.dartlang.org/packages/fontify)\n\nThe Fontify package provides an easy way to convert SVG icons to OpenType font\nand generate Flutter-compatible class that contains identifiers for the icons \n(just like [CupertinoIcons][] or [Icons][] classes).\n\nThe package is written fully in Dart and doesn't require any external dependency.\nCompatible with dart2js and dart2native.\n\n[CupertinoIcons]: https://api.flutter.dev/flutter/cupertino/CupertinoIcons-class.html\n[Icons]: https://api.flutter.dev/flutter/material/Icons-class.html\n\n# Using CLI tool\n\n[Globally activate][] the package:\n\n[globally activate]: https://dart.dev/tools/pub/cmd/pub-global\n\n```\n$ pub global activate fontify\n```\n\nAnd it's ready to go:\n\n```\n$ fontify \u003cinput-svg-dir\u003e \u003coutput-font-file\u003e [options]\n```\n\nRequired positional arguments:\n- `\u003cinput-svg-dir\u003e`\nPath to the input directory that contains .svg files.\n- `\u003coutput-font-file\u003e`\nPath to the output font file. Should have .otf extension.\n\nFlutter class options:\n- `-o` or `--output-class-file=\u003cpath\u003e`\nOutput path for Flutter-compatible class that contains identifiers for the icons.\n- `-i` or `--indent=\u003cindent\u003e`\nNumber of spaces in leading indentation for Flutter class file.\n  (defaults to \"2\")\n- `-c` or `--class-name=\u003cname\u003e`\nName for a generated class.\n- `-p` or `--package=\u003cname\u003e`\nName of a package that provides a font. Used to provide a font through package dependency.\n\nFont options:\n- `-f` or `--font-name=\u003cname\u003e`\nName for a generated font.\n- `--[no-]normalize`\nEnables glyph normalization for the font.\nDisable this if every icon has the same size and positioning.\n(defaults to on)\n- `--[no-]ignore-shapes`\nDisables SVG shape-to-path conversion (circle, rect, etc.).\n(defaults to on)\n\nOther options:\n- `-z` or `--config-file=\u003cpath\u003e`\nPath to Fontify yaml configuration file.\npubspec.yaml and fontify.yaml files are used by default.\n- `-r` or `--recursive`\nRecursively look for .svg files.\n- `-v` or `--verbose`\nDisplay every logging message.\n- `-h` or `--help`\nShows usage information.\n\n*Usage example:*\n\n```\n$ fontify assets/svg/ fonts/my_icons_font.otf --output-class-file=lib/my_icons.dart --indent=4 -r\n```\n\nUpdated Flutter project's pubspec.yaml:\n\n```yaml\n...\n\nflutter:\n  fonts:\n    - family: Fontify Icons\n      fonts:\n        - asset: fonts/my_icons_font.otf\n```\n\n# CLI tool config file\n\nFontify's configuration can also be placed in yaml file.\nAdd _fontify_ section to either `pubspec.yaml` or `fontify.yaml` file:\n\n```yaml\nfontify:\n  input_svg_dir: \"assets/svg/\"\n  output_font_file: \"fonts/my_icons_font.otf\"\n  \n  output_class_file: \"lib/my_icons.dart\"\n  class_name: \"MyIcons\"\n  indent: 4\n  package: my_font_package\n\n  font_name: \"My Icons\"\n  normalize: true\n  ignore_shapes: true\n\n  recursive: true\n  verbose: false\n```\n\n`input_svg_dir` and `output_font_file` keys are required.\nIt's possible to specify any other config file by using `--config-file` option.\n\n# Using API\n\n[svgToOtf][] and [generateFlutterClass][] functions can be used for generating font and Flutter class.\n\nThe example of API usage is located in [example folder][].\n\n[example folder]: https://github.com/westracer/fontify/tree/master/example/example.dart\n[svgToOtf]: https://pub.dev/documentation/fontify/latest/fontify/svgToOtf.html\n[generateFlutterClass]: https://pub.dev/documentation/fontify/latest/fontify/generateFlutterClass.html\n\n# Notes\n\n- Generated OpenType font is using CFF table.\n- Generated font is using PostScript Table (post) of version 3.0, i.e., it doesn't contain glyph names.\n- Supported SVG elements: path, g, circle, rect, polyline, polygon, line.\n- SVG transforms are applied to paths according to specs.\n- SVG `\u003cg\u003e` element's children are expanded to the root with transformations applied.\nAnything else related to the group is ignored and group referencing is not supported.\n- Consider using [Non-zero fill rule][].\n- When `ignoreShapes` is set to false,\nevery SVG shape's (circle, rect, etc.) outline is converted to path.\nNote that any attributes like \"fill\" or \"stroke\" are ignored and only the outline is used,\nso the resulting glyph may look different from SVG icon.\nIt's recommended to convert every element in SVG to path.\n- When `normalize` is set to false, it's recommended that SVG icons have the same height.\nOtherwise, final result might not look as expected.\n- When Flutter class is generated, static variables names derive from SVG file name\nconverted to pascal case with non-allowed characters removed.\nName is set to 'unnamed', if it's empty.\nSuffix '_{i+1}' is added, if name already exists.\n\n[Non-zero fill rule]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule\n\n# Planned\n\n- Support svg-to-ttf conversion (cubic-to-quad curves approximation needs to be done).\n- Support ligatures.\n- Support font variations.\n\n# Contributing\n\nAny suggestions, issues, pull requests are welcomed.\n\n# License\n\n[MIT](https://github.com/westracer/fontify/blob/master/LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwestracer%2Ffontify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwestracer%2Ffontify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwestracer%2Ffontify/lists"}