SVG 아이콘을 OTF 폰트로 변환하고 Flutter 앱에 쉽게 통합할 수 있도록 관련 Dart 클래스를 생성하는 플러터/다트 패키지입니다. 자동화를 위한 명령줄 인터페이스(CLI)와 API를 제공하여 여러 플랫폼에서 아이콘 관리를 간소화합니다. 생성된 폰트는 안드로이드, iOS, 웹, 맥OS, 윈도우, 리눅스와 호환되어 일관된 아이콘 렌더링을 보장합니다. 사용자 정의 아이콘 세트를 효율적으로 관리하는 팀에게 이상적입니다.
사용 사례
SVG에서 사용자 지정 아이콘 폰트 생성
아이콘 자산 생성 자동화
Flutter 앱에 벡터 아이콘 통합하기
다중 플랫폼 아이콘 렌더링 지원
디자인에서 코드로의 워크플로우를 간소화하세요
주요 기능
SVG에서 OTF 글꼴로의 변환
아이콘용 Dart 클래스 생성
CLI 및 API 인터페이스
크로스 플랫폼 지원
사용자 정의 아이콘 세트 관리
Flutter와의 간편한 통합
적합한 대상
Flutter 개발자
디자인 팀
UI/UX 엔지니어
사용자 지정 아이콘을 필요로 하는 앱
자주 아이콘을 업데이트하는 프로젝트
고려 사항
입력으로 SVG 파일이 필요합니다
CLI 또는 API 사용을 위해 설정이 필요합니다
추가 빌드 단계가 필요할 수 있습니다
폰트 파일 크기 고려 사항
아이콘만 사용 가능한 경우에 한정
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
icon_font_generator
The icon_font_generator 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.
Font generation
Install via dev dependency
$ flutter pub add --dev icon_font_generator
# And it's ready to go:
$ flutter pub run icon_font_generator:generate <input-svg-dir> <output-font-file> [options]
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.
Contributing
Any suggestions, issues, pull requests are welcomed.