Fontify는 SVG 아이콘을 OTF 폰트로 변환하고, 쉽게 통합할 수 있도록 Flutter 호환 Dart 클래스를 생성합니다. 명령줄 인터페이스(CLI)와 API를 제공하여 개발자가 커스텀 아이콘을 Flutter 애플리케이션 내에서 폰트로 번들링할 수 있게 해줍니다. 이는 여러 이미지 자산이 필요하지 않게 하여 아이콘 관리를 간소화하고, 폰트 기반 렌더링을 통해 성능을 향상시킵니다. 이 도구는 커스텀 또는 브랜드 아이콘 세트가 필요한 프로젝트에 특히 유용합니다.
사용 사례
SVG에서 사용자 지정 아이콘 폰트 만들기
Flutter 앱에 브랜드 아이콘 통합하기
글꼴 기반 아이콘을 사용하여 앱 번들 크기 줄이기
CI/CD 파이프라인에서 아이콘 폰트 생성 자동화
주요 기능
SVG에서 OTF 폰트로의 변환
Flutter 클래스 생성
CLI 및 API 지원
사용자 정의 아이콘 이름 지정을 지원합니다
Flutter 성능에 최적화됨
적합한 대상
맞춤형 아이콘을 필요로 하는 플러터 개발자
대규모 아이콘 세트를 관리하는 팀
자산 오버헤드를 최소화하려는 프로젝트
고려 사항
입력으로 SVG 파일이 필요합니다
글꼴 기반 아이콘 렌더링에 제한됨
내장된 아이콘 편집 도구 없음
런타임 중에 아이콘을 동적으로 변경하는 데 적합하지 않습니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
Fontify
The Fontify 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.
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.
Planned
Support svg-to-ttf conversion (cubic-to-quad curves approximation needs to be done).
Support ligatures.
Support font variations.
Contributing
Any suggestions, issues, pull requests are welcomed.