パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細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 を通じた簡単な統合
  • 最適化されたフォントファイル
  • 自動フォントファミリー処理
  • 軽量で高速

適している対象

  • オープンソースフォントを探しているFlutter開発者
  • 複数のプラットフォーム間で一貫したタイポグラフィを必要とするアプリ
  • パフォーマンスと最小限のセットアップを重視するプロジェクト
  • カスタムフォントを使用しているデザイナー
  • ブランド重視のタイポグラフィを備えたウェブおよびモバイルアプリケーション

注意事項

  • 初期のフォントを取得するにはインターネット接続が必要です
  • 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 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。