Buscar pacotes, repositórios e categorias de apps

Repositório GitHubfontsource/fontsource-flutter

fontsource-flutter

Adicione facilmente fontes Fontsource ao seu aplicativo Flutter. Inclui uma interface Dart para a API Fontsource.

Capa do projeto fontsource-flutter
Estrelas
8
Forks
1
Último push (UTC)
2 de nov. de 2022
Status do projeto
Ativo

README original

Texto original em inglês. Visite o GitHub para a versão atual.

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.

fontsource GitHub avatar
Autor no GitHub

fontsource ↗

Self-host Open Source fonts in neatly bundled NPM packages.

LinguagensDart

Categorias

Pacotes publicados por este repositório

Dependências usadas

Lista de dependências 9 itens

Como escolher um repositório para seu projeto?

Filtre pelo caso de uso, compare a atividade e confira o projeto original antes de adotá-lo.

  1. Busque por nome, autor ou descrição e filtre por tema.
  2. Compare estrelas, forks e envios recentes. Estrelas indicam interesse, mas não garantem qualidade.
  3. Confira o README, a licença e as issues no GitHub antes de usar o projeto.

Fontes e manutenção

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗