You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-3
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,13 @@
1
1
# Fontsource for Flutter
2
2
3
-
Add Fontsource fonts to your flutter app. Direct access to Fontsource API.
3
+
Easily add Fontsource fonts to your flutter app. Also includes a dart interface for the Fontsource API.
4
4
5
5
## Getting started
6
6
7
7
To start, create a config in either your `pubspec.yaml` file under the `fontsource` key or in the `fontsource.yaml` file.
8
8
9
9
```yaml
10
+
include: [my-package] # Defaults to all
10
11
fonts:
11
12
alex-brush: # This can be any font id
12
13
version: 4.5.3 # Defaults to latest
@@ -23,7 +24,7 @@ You can then import the `fontsource` package:
23
24
import 'package:fontsource/fontsource.dart';
24
25
```
25
26
26
-
Use [`FontsourceTextStyle`](https://pub.dev/documentation/fontsource/latest/fontsource/FontsourceTextStyle-class.html) to use a Fontsource font:
27
+
Use the [`FontsourceTextStyle`](https://pub.dev/documentation/fontsource/latest/fontsource/FontsourceTextStyle-class.html) class to use a Fontsource font:
27
28
28
29
```dart
29
30
const Text(
@@ -32,7 +33,13 @@ const Text(
32
33
),
33
34
```
34
35
35
-
[`FontsourceTextStyle`](https://pub.dev/documentation/fontsource/latest/fontsource/FontsourceTextStyle-class.html) extends the `TextStyle` class, so any styling properties can be used to change the way the text looks.
36
+
[`FontsourceTextStyle`](https://pub.dev/documentation/fontsource/latest/fontsource/FontsourceTextStyle-class.html) extends the [`TextStyle`](https://api.flutter.dev/flutter/painting/TextStyle-class.html) class, so any styling properties can be used to change the way the text looks.
37
+
38
+
## Use With Packages
39
+
40
+
To use this in a package, add a configuration like normal, but don't run the fontsource cli.
41
+
42
+
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.
0 commit comments