패키지, 저장소 및 앱 카테고리 검색

패키지 상세v0.4.0

fontsource

Flutter 앱에 Fontsource 글꼴을 쉽게 추가하세요. Fontsource API용 Dart 인터페이스도 포함되어 있습니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
59
좋아요
12
Pub 점수
140

패키지 설치

flutter pub add fontsource

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Fontsource는 Flutter/Dart 패키지로, 애플리케이션에 Fontsource 폰트를 쉽게 통합할 수 있도록 도와줍니다. Fontsource API에 대한 Dart 인터페이스를 제공하여 모든 지원되는 플랫폼에서 고품질 오픈소스 폰트를 간편하게 포함할 수 있습니다. 패키지는 폰트 로딩 및 관리를 간소화하여 최소한의 구성으로 일관된 타이포그래피를 보장합니다. Android, iOS, Web, macOS, Windows, Linux를 지원하므로 사용자 정의가 가능하고 성능이 우수한 폰트 렌더링을 필요로 하는 크로스플랫폼 앱에 적합합니다.

사용 사례

  • Flutter 앱에 사용자 지정 오픈소스 폰트 추가하기
  • 크로스 플랫폼 글꼴 일관성
  • 글꼴 로딩 성능 최적화
  • Fontsource를 통한 Google 폰트 통합
  • 웹 및 모바일 앱에서의 커스텀 타이포그래피

주요 기능

  • Fontsource API용 Dart 인터페이스
  • 다중 플랫폼 지원
  • pub add를 통한 간편한 통합
  • 사전 최적화된 글꼴 파일
  • 자동 폰트 패밀리 처리
  • 경량이고 빠름

적합한 대상

  • 오픈소스 글꼴을 찾는 플러터 개발자
  • 다양한 플랫폼 간에 일관된 타이포그래피가 필요한 앱
  • 성능과 최소 설정을 우선시하는 프로젝트
  • 사용자 지정 글꼴을 사용하는 디자이너
  • 브랜드 중심의 타이포그래피를 갖춘 웹 및 모바일 애플리케이션

고려 사항

  • 초기 폰트를 가져오기 위해 인터넷 연결이 필요합니다
  • Fontsource 호스팅 폰트 패밀리로 제한됨
  • 큰 폰트 세트를 사용하면 앱 번들 크기가 증가할 수 있습니다
  • 오프라인 전용 애플리케이션에는 적합하지 않습니다
  • 폰트 프리로딩 전략과 함께 사용하는 것이 가장 좋습니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Fontsource for Flutter

Easily add Fontsource fonts to your flutter app. Includes a dart interface for the Fontsource API.

Getting started

To start, create a config in either your pubspec.yaml file under the fontsource key or in the fontsource.yaml file.

include: [my-package] # Defaults to all
fonts:
  alex-brush: # This can be any font id
    version: 4.5.3 # Defaults to latest
    subsets: [latin, latin-ext] # Defaults to all
    weights: [400] # Defaults to all
    styles: [normal] # Defaults to all

The config will tell fontsource what to download and bundle into your flutter app. To ensure everything is downloaded, execute dart run fontsource after your config is modified. Also, make sure to run it whenever your repository is cloned. This will generate a local package in the .fontsource directory.

You can then import the fontsource package:

import 'package:fontsource/fontsource.dart';

Use the FontsourceTextStyle class to use a Fontsource font:

const Text(
  'Hello world!',
  style: FontsourceTextStyle(fontFamily: 'Alex Brush', fontSize: 30),
),

FontsourceTextStyle extends the TextStyle class, so any styling properties can be used to change the way the text looks.

Use With Packages

To use this in a package, add a configuration like normal, but don't run the fontsource cli.

Packages with a fontsource configuration will automatically be included. To manually specify what packages should be scanned, provide an include key with a list of package names to scan.

Fontsource API

The Fontsource API also has a dart interface that can be accessed through fontsource/api.dart.

카테고리

의존성

의존성 목록 6 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.